// -----------------------------------------
// Scripts para Abrir Ventanas de promociones
// -----------------------------------------

function bNavegador() {
  if( navigator.appName )
  {
    if( navigator.appName == "Microsoft Internet Explorer")  return 1;
    if( navigator.appName == "Netscape")  return 2;
  }
  return 0;
}
	
var contador = 1;

function AbreVentana(ventana){
  var w=640, h=480;
  var windowName = new String( contador );
  windowName = "v" + windowName;
  var x = bNavegador();	
  if (window.screen && window.screen.availHeight) {
    h = window.screen.availHeight - 120; // 63
    if( x==2 ) h = h - 11;
    w = window.screen.availWidth - 8; //4
  }

if (ventana==1)
  window.open("encarte/index.html", windowName, "status=yes,resizable=yes,toolbar=no,scrollbars=no,menubar=yes,top=0,left=0,width=800,height=" + h, 1 );

if (ventana==2)
  window.open("../encarte/index.html", windowName, "status=yes,resizable=yes,toolbar=no,scrollbars=no,menubar=no,top=20,left=120,width=800,height=" + h, 1 );

if (ventana==3)
  window.open("cumpleanios/ind_inscrip.html", windowName, "status=yes,resizable=yes,scrollbars=yes,top=0,left=0,width=" + w + ",height=" + h, 1);

if (ventana==4)
  window.open("cumpleanios/ind_inscrip.html",windowName,
"scrollbars=no,resizable=yes,toolbar=no,width=730,height=540,left=0,top=0");

if (ventana==5)
window.open("cumpleanios/ind_inscrip.html",windowName,"top=0,left=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=760,screenX=25,screenY=30,height=540");

if (ventana==6)
  window.open("cumpleanios/ind_inscrip.html",windowName,
"status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=790,height=520,top=0,left=0");

if (ventana==7) window.open("cumpleanios/ind_inscrip.html",windowName,"scrollbars=yes,resizable=yes,width=780,height=540,left=0,top=0");

if (ventana==8)
window.open("cumpleanios/ind_inscrip.html",windowName,"scrollbars=yes,resizable=yes,width=780,height=540,left=0,top=0");

if (ventana==9)
  window.open("cumpleanios/ind_inscrip.html", windowName, "status=yes,resizable=yes,scrollbars=yes,top=0,left=0,width=" + w + ",height=" + h, 1);

if (ventana==10)
window.open("cumpleanios/ind_inscrip.html",windowName,"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=630,height=400");

if (ventana==11)
window.open("cumpleanios/ind_inscrip.html", windowName, "status=yes,resizable=yes,scrollbars=yes,top=0,left=0,width=" + w + ",height=" + h, 1);

if (ventana==12)
  window.open("cumpleanios/ind_inscrip.html", windowName, "scrollbars=yes,resizable=yes,width=780,height=540,left=0,top=0");

if (ventana==13)
window.open("cumpleanios/ind_inscrip.html",windowName,"scrollbars=yes,resizable=yes,width=780,height=540,left=0,top=0");

contador = contador + 1;
}

// -----------
// fin scripts 
// -----------


esjs = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )))

IE = navigator.appName=="Microsoft Internet Explorer";
NS = navigator.appName=="Netscape";
bVer = parseInt(navigator.appVersion);

var newWin=null;

function popupwp(URL) {
day = new Date();
id = day.getTime();
//ancho=511
// alto 580
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=320,height=240,left=50,top=55');");
}

function popup(loc, name, width, height) {
	var _params = "width="+width+",height="+height+",resizable=no,status=no,scrollbars=no";

	// CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
	if (bVer >= 4) {
		 _left = ( (screen.width-width) >>1 );
		 _top = ( (screen.height-height) >>1 );
	} else {
		 _left = ( (800-width) >>1 );
		 _top = ( (600-height) >>1 );
	}

	if (IE) _params += ",top=" + _top + ",left=" + _left;
	else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

	newWin = window.open(loc, name, _params);
	if ( newWin!=null && !(IE && bVer<5) )
		newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}

function popupsc(loc, name, width, height) {
	var _params = "width="+width+",height="+height+",resizable=no,status=no,scrollbars=no";

	// CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
	if (bVer >= 4) {
		 _left = ( (screen.width-width) >>1 );
		 _top = ( (screen.height-height) >>1 );
	} else {
		 _left = ( (800-width) >>1 );
		 _top = ( (600-height) >>1 );
	}

	if (IE) _params += ",top=" + _top + ",left=" + _left;
	else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

	newWin = window.open(loc, name, _params);
	if ( newWin!=null && !(IE && bVer<5) )
		newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}

function popup0(URL) {
day = new Date();
id = day.getTime();
//ancho=511
// alto 580
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=670,height=459,left=25,top=25');");
}

function imprime(URL) {
day = new Date();
id = day.getTime();
//ancho=511
// alto 580
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=0,width=400,height=459,left=25,top=25');");
}

function popup1(URL) {
day = new Date();
id = day.getTime();
//ancho=511
// alto 580
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=695,height=459,left=25,top=25');");
}


function download(ruta,areaid,paginaid) {
window.open(ruta,'Downloads','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=260,screenX=220,screenY=220,height=100');
}

function cerrar() {
window.close();
}
/*
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
*/

/* //JAVASCRIPT, DESACTIVA RUTA DE HREF

var barrabajo = 'VIVANDA'; 
function barra()
{
window.status = barrabajo;
timerID= setTimeout("barra()", 15);
}
barra();

// FIN  */

var abriraqui = 0;
var abrirnuevo = 1;
var abrirotro = 2;
function openPag(f, dondeabrir , nelem) {
	if (dondeabrir==abriraqui) {
		pag = f.elements[nelem].options[f.elements[nelem].selectedIndex].value ;
		if (pag!="x") {window.location=pag;}		
		}
	else
		if (dondeabrir==abrirnuevo)	{
			pag = f.elements[nelem].options[f.elements[nelem].selectedIndex].value ;
			if (pag!="x") {w1 = window.open(pag , "w1" , "scrollbars,width=550,height=390");}
			}
		else 
			if (dondeabrir==abrirotro) {
				pag = f.elements[nelem].options[f.elements[nelem].selectedIndex].value ;
					if (pag!="x") {w2 = window.open(pag , "w2");}
				}
   }