// JavaScript Document

function abrir(p) {

	var le = (screen.width - 650) / 2;

  	var to = (screen.height - 500) / 2;

	newwindow=window.open(p,'_blank','height=500,width=650,left='+le+',top='+to+',resizable=no,scrollbars=yes,toolbar=no,status=no');

}

function abrir3(p) {

	var le = (screen.width - 221) / 2;

  	var to = (screen.height - 160) / 2;

	newwindow=window.open(p,'_blank','height=160,width=221,left='+le+',top='+to+',resizable=no,scrollbars=yes,toolbar=no,status=no');

}

function abrir2(w) {

  var myWidth = 0, myHeight = 0;

  if( typeof( window.innerWidth ) == 'number' ) {

    //Non-IE

    myWidth = window.innerWidth;

    myHeight = window.innerHeight;

  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {

    //IE 6+ in 'standards compliant mode'

    myWidth = document.documentElement.clientWidth;

    myHeight = document.documentElement.clientHeight;

  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {

    //IE 4 compatible

    myWidth = document.body.clientWidth;

    myHeight = document.body.clientHeight;

  }


  	var to = (myHeight - 500) / 2;

	var le = (myWidth - 600) / 2;

	newwindow=window.open(w,'_blank','height=500,width=600,left='+le+',top='+to+',resizable=no,scrollbars=yes,toolbar=no,status=no');

}

function ajusta() {	

	var myHeight = 0;

	if( typeof( window.innerWidth ) == 'number' ) {

    	myHeight = window.innerHeight;

  	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {

    	myHeight = document.documentElement.clientHeight;

  	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {

   		myHeight = document.body.clientHeight;

  	}

	document.getElementById('tabla').style.height=myHeight+'px';

	document.getElementById('cua').style.height=myHeight-140+'px';

	document.getElementById('t2').style.height=myHeight-50+'px';

}



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.01

  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 && d.getElementById) x=d.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];}

}



//   ##############  SIMPLE  BROWSER SNIFFER

if (document.layers) {navigator.family = "nn4"}

if (document.all) {navigator.family = "ie4"}

if (window.navigator.userAgent.toLowerCase().match("gecko")) {navigator.family = "gecko"}



overdiv="0";



//  ##########  CREATES POP UP BOX 

function popLayer(txt){

if (navigator.family == "gecko") {pad="0"; bord="1 bordercolor=black";}

else {pad="1"; bord="0";}

desc = 	  "<table cellspacing=0 cellpadding="+pad+" border=0  bgcolor=000000><tr><td>\n"

	+"<table cellspacing=0 cellpadding=3 border=0 width=100%><tr><td bgcolor=eeeeff><font size=-2 face='Tahoma' color=000000>\n"

	+txt

	+"\n</td></tr></table>\n"

	+"</td></tr></table>";

if(navigator.family =="nn4") {

	document.object1.document.write(desc);

	document.object1.document.close();

	document.object1.left=x+15;

	document.object1.top=y-5;

	}

else if(navigator.family =="ie4"){

	object1.innerHTML=desc;

	object1.style.pixelLeft=x+15;

	object1.style.pixelTop=y-5;

	}

else if(navigator.family =="gecko"){

	document.getElementById("object1").innerHTML=desc;

	document.getElementById("object1").style.left=x+15;

	document.getElementById("object1").style.top=y-5;

	}

}



function hideLayer(){

if (overdiv == "0") {

	if(navigator.family =="nn4") {eval(document.object1.top="-500");}

	else if(navigator.family =="ie4"){object1.innerHTML="";}

	else if(navigator.family =="gecko") {document.getElementById("object1").style.top="-500";}

	}

}



//  ########  TRACKS MOUSE POSITION FOR POPUP PLACEMENT

var isNav = (navigator.appName.indexOf("Netscape") !=-1);

function handlerMM(e){

x = (isNav) ? e.pageX : event.clientX + document.body.scrollLeft;

y = (isNav) ? e.pageY : event.clientY + document.body.scrollTop;

}

if (isNav){document.captureEvents(Event.MOUSEMOVE);}

document.onmousemove = handlerMM;

