function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function marqueeStop(){
	document.getElementById("marquesina").stop();
}
function marqueePlay(){
	document.getElementById("marquesina").start();
}


function llamarasincrono(url, id_contenedor){
	var pagina_requerida = false
	if (window.XMLHttpRequest) {
		pagina_requerida = new XMLHttpRequest()
	} else if (window.ActiveXObject){
		try {
			pagina_requerida = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
				pagina_requerida = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else
		return false
		pagina_requerida.onreadystatechange=function(){
		cargarpagina(pagina_requerida, id_contenedor)
	}
	pagina_requerida.open('GET', url, true) 
	pagina_requerida.send(null)
}
function cargarpagina(pagina_requerida, id_contenedor){
	if (pagina_requerida.readyState == 4 && (pagina_requerida.status==200 || window.location.href.indexOf("http")==-1))
	document.getElementById(id_contenedor).innerHTML=pagina_requerida.responseText
}
function AmpliarFuente()
{
	for(var j=0; j<document.styleSheets.length; j++) {
		for(var i=0; i<document.styleSheets[j].rules.length; i++) {
			if (document.styleSheets[j].rules.item(i).selectorText == ".texto_mod" || document.styleSheets[j].rules.item(i).selectorText == ".titulo_mod" || document.styleSheets[j].rules.item(i).selectorText == ".link_mod") {
				var f = document.styleSheets[j].rules.item(i).style.fontSize;
				if (f != "") {
					var c = parseInt(f.substring(0,f.length - 2));
					if(!isNaN(c)) {
						document.styleSheets[j].rules.item(i).style.fontSize = (c + 2) + "px";
					}
				}
			}
		}
	}
}
function ReducirFuente()
{
	for(var j=0; j<document.styleSheets.length; j++) {
		for(var i=0; i<document.styleSheets[j].rules.length; i++) {
			if (document.styleSheets[j].rules.item(i).selectorText == ".texto_mod" || document.styleSheets[j].rules.item(i).selectorText == ".titulo_mod" || document.styleSheets[j].rules.item(i).selectorText == ".link_mod") {
				var f = document.styleSheets[j].rules.item(i).style.fontSize;
				if (f != "") {
					var c = parseInt(f.substring(0,f.length - 2));
					if(!isNaN(c)) {
						document.styleSheets[j].rules.item(i).style.fontSize = (c - 2) + "px";
					}
				}
			}
		}
	}
}

function imprime_seleccion(x) {
  var ficha = document.getElementById("seleccion_imprimir_"+x);
  
  var imprime="<html>";
  imprime+="<head>";
  imprime+="<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>";
  imprime+="<link rel='stylesheet' href='css/style.css' type='text/css' />";
  imprime+="</head>";
  imprime+="<style>";
  imprime+="div#agregar_comentario_"+x+" { display:none; }";
  imprime+="div#enviar_mail_"+x+" { display:none; }";
  imprime+="</style>";
  imprime+="<body>"+ficha.innerHTML;
   
  var ventimp = window.open(' ', 'popimpr');
  ventimp.document.write( imprime );
  ventimp.document.close();
  ventimp.print();
  //ventimp.close();
}
  
function addBookmark(x,y) {
  if (window.external){
    external.AddFavorite("http://"+y,x)
  }else{
    alert("Su navegador no soporta esta operación.");
  }
}  

function votar(){
	var marcado = -1;
	with (document.form_encuesta){
		for ( var i = 0; i < item.length; i++ ) {
			if ( item[i].checked ) {
				marcado = i;
			}
		}
		if ( marcado == -1 ){
			window.alert("Debes seleccionar alguna opción" ) ;
		}else{
			llamarasincrono("externos/votar.asp?id="+document.form_encuesta.id.value+"&item="+marcado, "seccion_encuesta");
		}
	}
}

function form_participa(s){
	var ErrorTXT="Debes completar los siguientes datos:\n\n";
	DatosOK=true;
	x = eval("nombre = document.form_"+s+".nombre.value");
	if(nombre=="") {
		DatosOK=false;
		ErrorTXT+="   · Nombre.\n";
	}	
	x = eval("apellido = document.form_"+s+".apellido.value");
	if(apellido=="") {
		DatosOK=false;
		ErrorTXT+="   · Apellido.\n";
	}	
	x = eval("dni = document.form_"+s+".dni.value");
	if(dni=="") {
		DatosOK=false;
		ErrorTXT+="   · DNI.\n";
	}
	x = eval("nacimiento = document.form_"+s+".nacimiento.value");
	if(nacimiento=="") {
		DatosOK=false;
		ErrorTXT+="   · Año de nacimiento.\n";
	}
	x = eval("email = document.form_"+s+".email.value");
	if(email=="") {
		DatosOK=false;
		ErrorTXT+="   · E-mail.\n";
	}

	x = eval("celular = document.form_"+s+".celular.value");
	x = eval("domicilio = document.form_"+s+".domicilio.value");
	x = eval("provincia = document.form_"+s+".provincia.value");
	
	if (! DatosOK) {
		alert(ErrorTXT);
	} else {
		llamarasincrono("externos/formulario_participa.asp?seccion="+s+"&nombre="+nombre+"&apellido="+apellido+"&dni="+dni+"&nacimiento="+nacimiento+"&email="+email+"&celular="+celular+"&domicilio="+domicilio+"&provincia="+provincia, "div_"+s);
	}
}
function form_contacto(s){
	var ErrorTXT="Debes completar los siguientes datos:\n\n";
	DatosOK=true;
	x = eval("nombre = document.form_"+s+".nombre.value");
	if(nombre=="") {
		DatosOK=false;
		ErrorTXT+="   · Nombre.\n";
	}	
	x = eval("apellido = document.form_"+s+".apellido.value");
	if(apellido=="") {
		DatosOK=false;
		ErrorTXT+="   · Apellido.\n";
	}	
	x = eval("email = document.form_"+s+".email.value");
	if(email=="") {
		DatosOK=false;
		ErrorTXT+="   · E-mail.\n";
	}
	x = eval("comentarios = document.form_"+s+".comentarios.value");
	if(comentarios=="") {
		DatosOK=false;
		ErrorTXT+="   · Comentarios.\n";
	}
	
	x = eval("ciudad = document.form_"+s+".ciudad.value");
	
	if (! DatosOK) {
		alert(ErrorTXT);
	} else {
		llamarasincrono("externos/formulario_contacto.asp?seccion="+s+"&nombre="+nombre+"&apellido="+apellido+"&email="+email+"&ciudad="+ciudad+"&comentarios="+comentarios, "div_"+s);
	}
}
function form_red(s){
	var ErrorTXT="Debes completar los siguientes datos:\n\n";
	DatosOK=true;
	x = eval("nombre = document.form_"+s+".nombre.value");
	if(nombre=="") {
		DatosOK=false;
		ErrorTXT+="   · Nombre.\n";
	}	
	x = eval("apellido = document.form_"+s+".apellido.value");
	if(apellido=="") {
		DatosOK=false;
		ErrorTXT+="   · Apellido.\n";
	}	
	x = eval("organizacion = document.form_"+s+".organizacion.value");
	if(organizacion=="") {
		DatosOK=false;
		ErrorTXT+="   · Nombre de la Organización.\n";
	}
	x = eval("telefono = document.form_"+s+".telefono.value");
	if(telefono=="") {
		DatosOK=false;
		ErrorTXT+="   · Teléfono.\n";
	}
	x = eval("email = document.form_"+s+".email.value");
	if(email=="") {
		DatosOK=false;
		ErrorTXT+="   · E-mail.\n";
	}
	x = eval("comentarios = document.form_"+s+".comentarios.value");
	if(comentarios=="") {
		DatosOK=false;
		ErrorTXT+="   · Comentarios.\n";
	}
	
	x = eval("web = document.form_"+s+".web.value");
	x = eval("ciudad = document.form_"+s+".ciudad.value");
	
	if (! DatosOK) {
		alert(ErrorTXT);
	} else {
		llamarasincrono("externos/formulario_red.asp?seccion="+s+"&nombre="+nombre+"&apellido="+apellido+"&organizacion="+organizacion+"&telefono="+telefono+"&email="+email+"&web="+web+"&ciudad="+ciudad+"&comentarios="+comentarios, "div_"+s);
	}
}
function form_contribucion(s){
	var ErrorTXT="Debes completar los siguientes datos:\n\n";
	DatosOK=true;
	x = eval("nombre = document.form_"+s+".nombre.value");
	if(nombre=="") {
		DatosOK=false;
		ErrorTXT+="   · Nombre.\n";
	}	
	x = eval("apellido = document.form_"+s+".apellido.value");
	if(apellido=="") {
		DatosOK=false;
		ErrorTXT+="   · Apellido.\n";
	}	
	x = eval("email = document.form_"+s+".email.value");
	if(email=="") {
		DatosOK=false;
		ErrorTXT+="   · E-mail.\n";
	}
	x = eval("comentarios = document.form_"+s+".comentarios.value");
	if(comentarios=="") {
		DatosOK=false;
		ErrorTXT+="   · Comentarios.\n";
	}
	
	x = eval("ciudad = document.form_"+s+".ciudad.value");
	
	if (! DatosOK) {
		alert(ErrorTXT);
	} else {
		llamarasincrono("externos/formulario_contribucion.asp?seccion="+s+"&nombre="+nombre+"&apellido="+apellido+"&email="+email+"&ciudad="+ciudad+"&comentarios="+comentarios, "div_"+s);
	}
}

function form_monitoreo(s){
	var ErrorTXT="Debes completar los siguientes datos:\n\n";
	DatosOK=true;
	x = eval("nombre = document.form_"+s+".nombre.value");
	if(nombre=="") {
		DatosOK=false;
		ErrorTXT+="   · Nombre.\n";
	}	
	x = eval("apellido = document.form_"+s+".apellido.value");
	if(apellido=="") {
		DatosOK=false;
		ErrorTXT+="   · Apellido.\n";
	}	
	x = eval("email = document.form_"+s+".email.value");
	if(email=="") {
		DatosOK=false;
		ErrorTXT+="   · E-mail.\n";
	}
	x = eval("ciudad = document.form_"+s+".ciudad.value");
	if(ciudad=="") {
		DatosOK=false;
		ErrorTXT+="   · Ciudad donde vota.\n";
	}
	x = eval("provincia = document.form_"+s+".provincia.value");
	if(provincia=="") {
		DatosOK=false;
		ErrorTXT+="   · Provincia donde vota.\n";
	}
	
	x = eval("dni = document.form_"+s+".dni.value");
	x = eval("sexo = document.form_"+s+".sexo.value");
	x = eval("celular = document.form_"+s+".celular.value");
	x = eval("compania = document.form_"+s+".compania.value");
	
	
	if (! DatosOK) {
		alert(ErrorTXT);
	} else {
		llamarasincrono("externos/formulario_monitoreo.asp?seccion="+s+"&nombre="+nombre+"&apellido="+apellido+"&dni="+dni+"&sexo="+sexo+"&celular="+celular+"&compania="+compania+"&email="+email+"&ciudad="+ciudad+"&provincia="+provincia, "div_"+s);
	}
}



function form_elecciones2009(s){
	var ErrorTXT="Debes completar los siguientes datos:\n\n";
	DatosOK=true;
	x = eval("nombre = document.form_"+s+".nombre.value");
	if(nombre=="") {
		DatosOK=false;
		ErrorTXT+="   · Nombre.\n";
	}	
	x = eval("apellido = document.form_"+s+".apellido.value");
	if(apellido=="") {
		DatosOK=false;
		ErrorTXT+="   · Apellido.\n";
	}	
	x = eval("dni = document.form_"+s+".dni.value");
	if(dni=="") {
		DatosOK=false;
		ErrorTXT+="   · D.N.I.\n";
	}
	x = eval("email = document.form_"+s+".email.value");
	if(email=="") {
		DatosOK=false;
		ErrorTXT+="   · E-mail.\n";
	}
	x = eval("prefijo = document.form_"+s+".prefijo.value");
	x = eval("celular = document.form_"+s+".celular.value");
	if(celular=="" || prefijo=="") {
		DatosOK=false;
		ErrorTXT+="   · Teléfono Celular.\n";
	}

	
	x = eval("sex = document.form_"+s+".sexo[0].checked");
	if (sex){
		sexo = "masculino";
	}else{
		sexo = "femenino";
	}	
	
	x = eval("compania = document.form_"+s+".compania.value");
	x = eval("comentarios = document.form_"+s+".comentarios.value");
	
	
	if (! DatosOK) {
		alert(ErrorTXT);
	} else {
		llamarasincrono("externos/formulario_elecciones2009.asp?seccion="+s+"&nombre="+nombre+"&apellido="+apellido+"&dni="+dni+"&email="+email+"&sexo="+sexo+"&prefijo="+prefijo+"&celular="+celular+"&compania="+compania+"&comentarios="+comentarios, "div_"+s);
	}
}


function formulario_newsletter(s){
	var ErrorTXT="Debes completar todos los datos.";
	DatosOK=true;
	x = eval("nombre = document.form_"+s+".nombre.value");
	x = eval("def_nombre = document.form_"+s+".nombre.defaultValue");
	x = eval("email = document.form_"+s+".email.value");
	x = eval("def_email = document.form_"+s+".email.defaultValue");
	if(nombre=="" || email=="" || nombre==def_nombre || email==def_email) {
		DatosOK=false;
	}	

	if (! DatosOK) {
		alert(ErrorTXT);
	} else {
		llamarasincrono("externos/formulario_newsletter.asp?seccion="+s+"&nombre="+nombre+"&email="+email, "div_"+s);
	}
}



function formulario_comentario(s){
	var ErrorTXT="Debes completar todos los campos.";
	DatosOK=true;
	x = eval("nombre = document.form_comentario_"+s+".nombre.value");
	x = eval("email = document.form_comentario_"+s+".email.value");
	x = eval("comentario = document.form_comentario_"+s+".comentario.value");
	
	if(nombre=="" || email=="" || comentario=="") {
		DatosOK=false;
	}	
	if (! DatosOK) {
		alert(ErrorTXT);
		return false;
	} else {
		return true;
	}
}




function formulario_enviar_mail(s){
	var ErrorTXT="Debes completar el destinatario y tu nombre.";
	DatosOK=true;
	x = eval("email = document.form_enviar_mail_"+s+".email.value");
	x = eval("nombre = document.form_enviar_mail_"+s+".nombre.value");
	x = eval("mensaje = document.form_enviar_mail_"+s+".mensaje.value");
	
	if(email=="" || nombre=="") {
		DatosOK=false;
	}	
	if (! DatosOK) {
		alert(ErrorTXT);
	} else {
		llamarasincrono("externos/formulario_enviar_mail.asp?id="+s+"&nombre="+nombre+"&email="+email+"&mensaje="+mensaje, "enviar_mail_"+s);
	}
	return false;
}

function enviar_pagina(p){
	window.open("externos/enviar_pagina.asp?pag="+p,"enviar_pagina","menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=290,height=270");
}
function envia_formulario(){
	var ErrorTXT="Debes completar los siguientes campos:\n\n";
	DatosOK=true;
	if(document.form1.email.value=="") {
		DatosOK=false;
		ErrorTXT+="   · Enviar a.\n";
	}	
	if(document.form1.nombre.value=="") {
		DatosOK=false;
		ErrorTXT+="   · Tu nombre.\n";
	}
	if (! DatosOK) {
		alert(ErrorTXT);
	} else {
		llamarasincrono("enviar_pagina1.asp?nombre="+document.form1.nombre.value+"&email="+document.form1.email.value+"&pagina="+document.form1.pagina.value, "seccion_enviar");
	}
}
function buscador(){
	var ErrorTXT="Antes debes ingresar la palabra que querés buscar.";
	DatosOK=true;
	if(document.form_buscar.buscar.value=="" || document.form_buscar.buscar.value==document.form_buscar.buscar.defaultValue) {
		DatosOK=false;
	}	
	if (! DatosOK) {
		alert(ErrorTXT);
		return false;
	} else {
		return true;
	}
}

function cambia_almanaque(mes,ano){
	llamarasincrono("externos/almanaque.asp?mes="+mes+"&ano="+ano, "almanaque");
}




function form_leydemedios(s){
	var ErrorTXT="Debes completar los siguientes datos:\n\n";
	DatosOK=true;
	x = eval("nombre = document.form_"+s+".nombre.value");
	if(nombre=="") {
		DatosOK=false;
		ErrorTXT+="   · Nombre.\n";
	}	
	x = eval("apellido = document.form_"+s+".apellido.value");
	if(apellido=="") {
		DatosOK=false;
		ErrorTXT+="   · Apellido.\n";
	}	
	x = eval("dni = document.form_"+s+".dni.value");
	if(dni=="") {
		DatosOK=false;
		ErrorTXT+="   · D.N.I.\n";
	}
	x = eval("email = document.form_"+s+".email.value");
	if(email=="") {
		DatosOK=false;
		ErrorTXT+="   · E-mail.\n";
	}
	
	x = eval("provincia = document.form_"+s+".provincia.value");
	
	
	if (! DatosOK) {
		alert(ErrorTXT);
	} else {
		llamarasincrono("externos/formulario_leydemedios.asp?seccion="+s+"&nombre="+nombre+"&apellido="+apellido+"&dni="+dni+"&email="+email+"&provincia="+provincia, "div_"+s);
	}
}