// JavaScript Document

function POPIMG(file, ancho, alto) {
	var ventana, txtBody;

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open('','ventana','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	txtbody = "<HTML><HEAD><title>Rosario3.com</title></HEAD>";
	txtbody += "<body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' onBlur='self.close()'>";
	txtbody += "<a href='javascript:self.close()'><img src='upload/popContent/img/" + file + "' border='0' width='"+ancho+"' height='"+alto+"'></a>";
	txtbody += "</body></html>"

  ventana.document.write(txtbody);
  ventana.document.close();

	if(ventana.focus)
		ventana.focus();
}

function POPSWF(file, ancho, alto) {
	var flash, txtBody;
	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	flash= window.open('','ventana','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);
	txtbody= "<HTML><HEAD><title>Rosario3.com</title></HEAD>";
	txtbody+= "<body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>";
	txtbody+= "<table width='100' border='0' cellspacing='w0' cellpadding='0'><tr><td>";
	txtbody+= "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+ancho+"' height='"+alto+"'>";
	txtbody+= "<param name='movie' value='upload/popContent/swf/" + file + "'>";
	txtbody+= "<param name='quality' value='high'>";
	txtbody+= "<embed src='upload/popContent/swf/" + file + "' quality='high' pluginspage='http:\/\/www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+ancho+"' height='"+alto+"'></embed></object>";
	txtbody+= "</td></tr></table></body></html>"

  	flash.document.write(txtbody);
  	flash.document.close();

	if(flash.focus)
		flash.focus();
}
function POPHTM(file, ancho, alto) {
	var ventana, txtBody;

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana1','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}


function POPHTMREPRODUCTOR(id, id2) {
	var ventana, txtBody;
	
	file = "reproductormp3.aspx?idNot=" + id + "&idHom=" + id2;
	ancho = 450;
	alto = 250;
	

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana2','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}

function POPHTMREPRODUCTORVIDEO(id, id2) {
	var ventana, txtBody;
	
	file = "reproductorflv.aspx?idNot=" + id + "&idHom=" + id2;
	ancho = 450;
	alto = 335;
	

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana3','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}

function POPENC(id) {
	var ventana, txtBody;
	
	file = "encuestas.aspx?idEnc=" + id;
	ancho = 450;
	alto = 400;
	

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana4','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}


function POPENCUESTA(id) {
	var ventana, txtBody, voto;
	
	

	voto=0;
	estado=false;
	ctrl=document.Form1.opcion;
	for(i=0;i<ctrl.length;i++) {
        if(ctrl[i].checked) {
			voto=ctrl[i].value;
			estado=true;			
		}
	}

	if (estado) {

	file = "comunidad/votar.aspx?idEnc=" + id + "&campooculto=voto&opcion=" + voto;
	ancho = 450;
	alto = 400;
	

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;


	ventana=window.open(file,'ventana5','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

		if (ventana.focus) 
			ventana.focus();

	
	}
	else
	{
	alert("Para votar debe seleccionar una respuesta");	
	}

}

function POPENCUESTARES(id) {
	var ventana, txtBody;
	
	file = "comunidad/encuestas.aspx?idEnc=" + id;
	ancho = 450;
	alto = 400;
	

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana6','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}


function POPENCUESTAint(id, ruta) {
	var ventana, txtBody, voto;
	
	voto=0;
	estado=false;
	ctrl=document.Form1.opcion;
	for(i=0;i<ctrl.length;i++) {
        if(ctrl[i].checked) {
			voto=ctrl[i].value;
			estado=true;	
		}
	}


	if (estado) {
		
	file = ruta + "comunidad/votar.aspx?idEnc=" + id + "&campooculto=voto&opcion=" + voto;
	ancho = 450;
	alto = 400;
	

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana7','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();

	
	}
	else
	{
	alert("Para votar debe seleccionar una respuesta");	
	}		
}

function POPENCUESTARESint(id, ruta) {
	var ventana, txtBody;
	
	file = ruta + "comunidad/encuestas.aspx?idEnc=" + id;
	ancho = 450;
	alto = 400;
	

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana8','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}


function POPHTMRADIO() {
	var ventana, txtBody;
	ancho=273;
	alto=280;

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open('http://www.rosario3.com/radios/radio2.html','ventana9','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}

function POPHTMRADIOFM() {
	var ventana, txtBody;
	ancho=273;
	alto=150;

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open('http://www.rosario3.com/radios/RadioFM.html','ventana10','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}


function Favoritos () 
{
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
      var url="http://www.rosario3.com/"; 
      var titulo="rosario3.com";
      window.external.AddFavorite(url,titulo);
   } else { 
      if(navigator.appName == "Netscape") 
         alert("Presione Crtl+D para agregar este sitio en sus Bookmarks"); 
   }

   /*if (navegador.ie5 || navegador.ie6 || navegador.ie4)  window.external.AddFavorite("http://www.rosario3.com","rosario3.com");
   else alert("Presione Ctrl+D para agregar este sitio en sus Favoritos");*/
} 


function POPimprimir(id, ruta) {
	var ventana, txtBody;
	
	file = ruta + "imprimir.aspx?idNot=" + id;
	ancho = 500;
	alto = 600;
	
	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana11','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}

function POPmail(id, ruta) {
	var ventana, txtBody;
	
	file = ruta + "mail.aspx?idNot=" + id;
	ancho = 450;
	alto = 340;
	
	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana12','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}



function POPHTMREPRODUCTORint(id, id2, ruta) {
	var ventana, txtBody;
	
	file = ruta + "reproductormp3int.aspx?idNot=" + id + "&idHom=" + id2;
	ancho = 450;
	alto = 250;
	

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana13','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}




function POPHTMREPRODUCTORVIDEOint(id, id2, ruta) {
	var ventana, txtBody;
	
	file = ruta + "reproductorflvint.aspx?idNot=" + id + "&idHom=" + id2;
	ancho = 450;
	alto = 335;
	

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana14','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}


var est_bot = "";
var timer;
function cambiar_estado (position) {
		cerrar_grupos ()
		if (position!=0 ) {
			
			est_bot="";
		} else {
			clearTimeout(timer);
		}
		
		switch (position) { 
			case 1: 
				a_1.style.visibility='visible';
				est_bot="ab";
				break 
			case 2: 
				a_2.style.visibility='visible';
				est_bot="ab";
				break 	   
			case 3: 
				a_3.style.visibility='visible';
				est_bot="ab";
				break 	   
			case 4: 
				a_4.style.visibility='visible';
				est_bot="ab";
				break 	   
			case 5: 
				a_5.style.visibility='visible';
				est_bot="ab";
				break 	   
			case 6: 
				a_6.style.visibility='visible';
				est_bot="ab";
				break 
			case 7: 
				a_7.style.visibility='visible';		   
				est_bot="ab";
				break 	   
		} 
		if (est_bot=="ab") {
			cerrar();
		}
}
function cerrar_grupos () {
		clearTimeout(timer);
		a_1.style.visibility='hidden';
		a_2.style.visibility='hidden';
		a_3.style.visibility='hidden';
		a_4.style.visibility='hidden';
		a_5.style.visibility='hidden';
		a_6.style.visibility='hidden';
		a_7.style.visibility='hidden';
		est_bot="";
}

function cerrar() {
	timer = setTimeout('cerrar_grupos()',4000);
}


