var win = null;

function openabrir() { 
  str="http://www.2tres.com/intro.html"; 
  win = window.open(str,'abrirWin','resizable=yes, scrollbars, status=no, location=no, toolbar=no, channelmode=yes'); 
  win.focus();
}

function RandomNumber(){
   var today = new Date();
   var num= Math.abs(Math.sin(today.getTime()/1000));
   return num;
}

function RandomGraphics() {
   var x = RandomNumber();

   if (x > .60){
     win.document.write("<A HREF='http://www.ibest.com.mx/prevoting/prevote.asp?IDCategoria=22&NomeCategoria=Entretenimiento' target='_blank'><img src='http://www.2tres.com/imagenes/vota2tres.gif' align=left border=0></a>");
     return; 
   }

  if (x > .40){
     win.document.write("<A HREF='mailto:boogielula@aol.com' target='_blank'><img src='http://www.2tres.com/imagenes/bnboogie.gif' align=left border=0></a>");
     return; 
   }

   if (x > .20){
     win.document.write("<A HREF='http://www.2tres.com/top10/index.html' target='_blank'><img src='http://www.2tres.com/imagenes/top10.gif' align=left border=0></a>");
     return; 
   }

   if (x > 0){
     win.document.write("<A HREF='http://www.2tres.com/webmail/' target='_blank'><img src='http://www.2tres.com/imagenes/email.gif' align=left border=0></a>");
     return; 
   }

}

function Abrir2tresWin(theURL,winName,width,height) { 
if(window.screen){
		per_ancho=(width/800)*100;//porcentaje screen-ancho
		per_alto=(height/width)*100;//porcentaje de ancho-alto
		win_ancho=(screen.width*per_ancho)/100;//ancho de la ventana
		win_alto=(win_ancho*per_alto)/100;//alto de la ventana
		x=(screen.width-win_ancho)/2;//centra x
		y=(screen.height-win_alto)/2;//centra y
	}else{// si el buscador es 4-- queda todo igual :(
		x=0;
		y=0;
		win_ancho=w;
		win_alto=y;
	}
	features=("top="+y+",left="+x+",width="+win_ancho+",height="+win_alto+",channelmode=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=1,toolbar=1");
	ventana=window.open(theURL,winName,features);
	ventana.focus();
}


function PopupCenter(theURL,winName,width,height) { 
	if(window.screen){
		per_ancho=(width/800)*100;//porcentaje screen-ancho
		per_alto=(height/width)*100;//porcentaje de ancho-alto
		win_ancho=(screen.width*per_ancho)/100;//ancho de la ventana
		win_alto=(win_ancho*per_alto)/100;//alto de la ventana
		x=(screen.width-win_ancho)/2;//centra x
		y=(screen.height-win_alto)/2;//centra y
	}else{// si el buscador es 4-- queda todo igual :(
		x=0;
		y=0;
		win_ancho=w;
		win_alto=y;
	}
	features=("top="+y+",left="+x+",width="+win_ancho+",height="+win_alto+",scrollbars=1,resizable=yes");
	window.open(theURL,winName,features);
}


function PopupCenter2(theURL,winName,width,height) { 
	if(window.screen){
		per_ancho=(width/800)*100;//porcentaje screen-ancho
		per_alto=(height/width)*100;//porcentaje de ancho-alto
		win_ancho=(screen.width*per_ancho)/100;//ancho de la ventana
		win_alto=(win_ancho*per_alto)/100;//alto de la ventana
		x=(screen.width-win_ancho)/2;//centra x
		y=(screen.height-win_alto)/2;//centra y
	}else{// si el buscador es 4-- queda todo igual :(
		x=0;
		y=0;
		win_ancho=w;
		win_alto=y;
	}
	features=("top="+y+",left="+x+",width="+win_ancho+",height="+win_alto+",scrollbars=yes,resizable=yes");
	window.open(theURL,winName,features);
}

function PopupCenter3(theURL,winName,width,height) { 
	if(window.screen){
		per_ancho=(width/800)*100;//porcentaje screen-ancho
		per_alto=(height/width)*100;//porcentaje de ancho-alto
		win_ancho=(screen.width*per_ancho)/100;//ancho de la ventana
		win_alto=(win_ancho*per_alto)/100;//alto de la ventana
		x=(screen.width-win_ancho)/2;//centra x
		y=(screen.height-win_alto)/2;//centra y
	}else{// si el buscador es 4-- queda todo igual :(
		x=0;
		y=0;
		win_ancho=w;
		win_alto=y;
	}
	features=("top="+y+",left="+x+",width="+win_ancho+",height="+win_alto+",scrollbars=no,resizable=yes");
	window.open(theURL,winName,features);
}

function PopupBanerFijo(theURL,winName,width,height) { 
	if(window.screen){
		per_ancho=(width/800)*100;//porcentaje screen-ancho
		per_alto=(height/width)*100;//porcentaje de ancho-alto
		win_ancho=(screen.width*per_ancho)/100;//ancho de la ventana
		win_alto=(win_ancho*per_alto)/100;//alto de la ventana
		x=(screen.width-win_ancho)/2;//centra x
		y=(screen.height-win_alto)/2;//centra y
	}else{// si el buscador es 4-- queda todo igual :(
		x=0;
		y=0;
		win_ancho=w;
		win_alto=y;
	}
	features=("top="+y+",left="+x+",width="+win_ancho+",height="+win_alto+",scrollbars=no,resizable=yes");
	window.open(theURL,winName,features);
}
function popupbanner(page) {
        win = window.open(page, "popUpBaner", "width=250,innerwidth=250,height=250,innerheight=250,toolbar=no,titlebar=no,menubar=no,location=no,scrollbars=no,resizable=yes");
	RandomGraphics();
}

function popup(page) {
        win = window.open(page, "popUpWindow", "width=320,innerwidth=320,height=270,innerheight=270,toolbar=no,titlebar=no,menubar=no,location=no,scrollbars=no,resizable=yes");
}

function popupmx(page) {
        win = window.open(page, "popUpWindow", "width=420,innerwidth=420,height=320,innerheight=320,toolbar=no,titlebar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}

function contacto(contacto) {
		win = window.open(contacto, "contactWindow", "width=600,innerwidth=600,height=350,innerheight=350,toolbar=no,titlebar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}

function turismo(page) {
		win = window.open(page, "turismo", "width=600,innerwidth=600,height=350,innerheight=350,toolbar=no,titlebar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}

function icq(page) {
		win = window.open(page, "icq", "width=350,innerwidth=600,height=400,innerheight=350,toolbar=no,titlebar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}
function saludos(page) {
		win = window.open(page, "icq", "width=350,innerwidth=400,height=300,innerheight=350,toolbar=no,titlebar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}
function zucaritas(ganadora) {
		win = window.open("", "ZUCARITAS", "width=450,innerwidth=400,height=350,innerheight=350,toolbar=no,titlebar=no,menubar=no,location=no,scrollbars=no,resizable=no");
		win.document.write("<body bgcolor='#0099FF' text='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
		win.document.write("<center>");
		win.document.write("<table width='446' border='0' cellspacing='10' cellpadding='0' align='center'><tr>");
		win.document.write("<td rowspan='2' bgcolor='#000000' width='210'><img src='http://www.2tres.com/html/correos/imagenes/tigre.gif' width='210' height='272'>a</td>");
		win.document.write("<td width='206' height='193'><div align='center'>");
		win.document.write("<p><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>Hemos otorgado el galardón<br><br>");
		win.document.write("<font size='5'><b>ZUCARITA </b></font><br><br>en este evento.</font></p>");
		win.document.write("<p><font size='4' face='Verdana, Arial, Helvetica, sans-serif'>a: <b><u> " + ganadora + "</u></b><br></font></p>");
		win.document.write("<p><font size='2' face='Verdana, Arial, Helvetica, sans-serif'> <br>2tres Staff<br><br>");
		win.document.write("<font size='5'><b><font color='#FFFFFF'>FELICIDADES</font></b></font></font></p></td></tr><tr>");
		win.document.write("<td height='2' width='206'><p>");
		win.document.write("<center><input type='submit' name='Submit' value='Cerrar' onclick='window.close()'></center></p></td></tr><tr><td colspan='2'>");
		win.document.write("<center><font size='1' face='Verdana, Arial, Helvetica, sans-serif'><i>El Tigre To&ntilde;o (Tony the Tiger) es &copy; de Kellogs Inc.<br>Todos los Derechos Reservados.</i></font><center>");
		win.document.write("</td></tr></table></body>");		
		
}
function popupc(filename,windowname,w,h) {
	var xw = w;	var xh = h;
	if(screen) { var xxw = (screen.width-xw)/2; var xxh = (screen.height-xh)/2 }
		else { var xxw = 80; var xxh = 80; }

	var newwin = open(filename, windowname,'scrollbars=1,status=no,menubar=no,directories=no,resize=no,width=' +w +',height=' + h + ',top=0,left=0');
					}



function Abrir2tresWin(theURL,winName,width,height) { 
if(window.screen){
		per_ancho=(width/800)*100;//porcentaje screen-ancho
		per_alto=(height/width)*100;//porcentaje de ancho-alto
		win_ancho=(screen.width*per_ancho)/100;//ancho de la ventana
		win_alto=(win_ancho*per_alto)/100;//alto de la ventana
		x=(screen.width-win_ancho)/2;//centra x
		y=(screen.height-win_alto)/2;//centra y
	}else{// si el buscador es 4-- queda todo igual :(
		x=0;
		y=0;
		win_ancho=w;
		win_alto=y;
	}
	features=("top="+y+",left="+x+",width="+win_ancho+",height="+win_alto+",channelmode=0,directories=0,location=0,menubar=0,resizable=0,scrollbars=1,toolbar=1");
	ventana=window.open(theURL,winName,features);
	ventana.focus();
}

