// JavaScript Document
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 popup(loc, name, width, height) {
	var _params = "width="+width+",height="+height+",resizable=yes,status=no,scrollbars=yes";

	// 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=yes";

	// 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 disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
*/

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");}
			}
}


function wopen(url, name, w, h, scroll)
{
  w += 0;
  h += 56;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  var win = window.open(url,name,'width=' + w + ', height=' + h + ', ' + 'left=' + wleft + ', top=' + wtop + ', ' + 'location=no, menubar=no, ' + 'status=no, toolbar=no, scrollbars=' + scroll + ', resizable=yes');
  win.resizeTo(w, h);
  win.moveTo(wleft, wtop);
  win.focus();
}