// BROWSER DETECTION
var nn4 = document.layers ? true:false;
var d, dom, ie, ie4, ie5x, moz, mac, win, lin, old, ie5mac, ie5xwin, op;

d = document;
n = navigator;
na = n.appVersion;
nua = n.userAgent;
win = ( na.indexOf( 'Win' ) != -1 );
mac = ( na.indexOf( 'Mac' ) != -1 );
lin = ( na.indexOf( 'Linux' ) != -1 );

if ( !d.layers ){
dom = ( d.getElementById );
op = ( nua.indexOf( 'Opera' ) != -1 );
konq = ( nua.indexOf( 'Konqueror' ) != -1 );
saf = ( nua.indexOf( 'Safari' ) != -1 );
moz = ( nua.indexOf( 'Gecko' ) != -1 );
ie = ( d.all && !op );
ie4 = ( ie && !dom );
ie5x = ( d.all && dom );
ie5mac = ( mac && ie5x );
ie5xwin = ( win && ie5x );
}

// FOOTER SIZING
function footer(){
if (ie || op || ie5mac)	{
a = parseInt(document.all["cn1"].scrollHeight);
b = parseInt(document.all["cn2"].scrollHeight);
if(a<b) a=b;
document.all['cn3'].style.top = a + 69;
document.all['cn3'].style.visibility = "visible";
} else if (dom && !op){
a = document.body.scrollHeight;
document.getElementById("cn3").style.top =  a;
document.getElementById("cn3").style.visibility = "visible";
}
}

// POPUP
function Popup(url,name,width,height,resize,scroll) {
var dialogWin = new Object();
dialogWin.width = width;
dialogWin.height = height;
now = new Date();
var millis=now.getTime();
var mstr=""+millis;
if (navigator.appName == "Netscape") {
dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2);
dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2);
var attr = 'screenX=' + dialogWin.left + ',screenY=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
} else if (document.all) {
dialogWin.left = (screen.width - dialogWin.width) / 2;
dialogWin.top = (screen.height - dialogWin.height) / 2;
var attr = 'left=' + dialogWin.left + ',top=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
}
window.open(url,name,attr);
}

// PRELOAD DE IMAGENES //
var status = 1;
var toc = new Array();

function item(off, over){
this.off = new Image(); this.off.src = off;
this.over = new Image(); this.over.src = over;
}
function cache(id, off, over){
item[id] = new item(off, over);
toc[toc.length] = id;
}
function over(id){
document[id].src = item[id].over.src;
}
function out(id){
document[id].src = item[id].off.src;
}

function BannerDesplegable(){
	if (ie || op || ie5mac)	{
		a = parseInt(document.all["medidor"].offsetTop);
		document.all['bannerdesplegable'].style.top = a - 171;
		document.all['bannerdesplegable'].style.visibility = "visible";
	} else if ((dom && !op) || moz){
		a = document.getElementById("medidor").offsetTop;
		document.getElementById("bannerdesplegable").style.top =  a - 171;
		document.getElementById("bannerdesplegable").style.visibility = "visible";
	}
} 
