/************
 *
 * Copyright (C) 1999 EquaVision AB
 * Developed by Pablo at EquaVision AB
 *
 ************/

function Is() {
    agent  = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns    = ((agent.indexOf('mozilla')   !=   -1) &&
                 ((agent.indexOf('spoofer')   ==   -1) &&
                 (agent.indexOf('compatible') ==   -1)));
    this.ns2   = (this.ns && (this.major      ==    3));
    this.ns3   = (this.ns && (this.major      ==    3));
    this.ns4b  = (this.ns && (this.major      ==    4) &&
                 (this.minor                  <= 4.03));
    this.ns4   = (this.ns && (this.major      >=    4));
    this.ns6    = (this.ns && (this.major     >=    5));
    this.ie    = (agent.indexOf("msie")       !=   -1);
    this.ie3   = (this.ie && (this.major      <     4));
    this.ie4   = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.0")   ==   -1));
    this.ie5   = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.0")   !=   -1));
    this.ie55  = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.5")   !=   -1));
}

var is = new Is();

if(is.ns4)
 {ns4 = (document.layers) ? 1 : 0;
 }else if(is.ie4 || is.ie5)
 {ie4 = (document.all) ? 1 : 0;}


var lastbutton='top';



function moveLayers() {
		if (ns4) {
			screenWidth = window.innerWidth;
			document.layers['ceroMenu'].left = 0;
			document.layers['ceroMenu'].top = 0;
			document.layers['compMenu'].left = 195 + (screenWidth/2) - 390;
			document.layers['compMenu'].top = 115; // 130
			document.layers['prodMenu'].left = 195 + (screenWidth/2) - 390;
			document.layers['prodMenu'].top = 173; // 180
			document.layers['newsMenu'].left = 195 + (screenWidth/2) - 390;
			document.layers['newsMenu'].top = 203; // 210
			//document.layers['investMenu'].left = 195 + (screenWidth/2) - 390;
			//document.layers['investMenu'].top = 233; // 240
		
		} else {
			screenWidth = document.body.clientWidth + 18;
			document.all['ceroMenu'].style.pixelLeft = 0;
			document.all['ceroMenu'].style.pixelTop = 0;
			document.all['compMenu'].style.pixelLeft = 196 + (screenWidth/2) - 390;// 186 +
			document.all['compMenu'].style.pixelTop = 115; // 130
			document.all['prodMenu'].style.pixelLeft = 196 + (screenWidth/2) - 390;// 186 +
			document.all['prodMenu'].style.pixelTop = 173; // 180
			document.all['newsMenu'].style.pixelLeft = 196 + (screenWidth/2) - 390;// 186 +
			document.all['newsMenu'].style.pixelTop = 203; // 210
			//document.all['investMenu'].style.pixelLeft = 196 + (screenWidth/2) - 390;// 186 +
			//document.all['investMenu'].style.pixelTop = 233; // 240
        }
}

function popUp(menuName,on) {
		if (on) {
			moveLayers();
			if (ns4) {
				document.layers[menuName].visibility = "show";
			} else {
				document.all[menuName].style.visibility = "visible";
			}
		} else {
			if (ns4) {
				document.layers[menuName].visibility = "hide";
			} else {
				document.all[menuName].style.visibility = "hidden";
			}
		}
}

function change(Name,No) {
	menuStop(); //Clear timeout, ML:010219
	if (No == 1) {
			popUp('ceroMenu',false);
			popUp('compMenu',false);
			popUp('prodMenu',false);
			popUp('newsMenu',false);
			//popUp('investMenu',false);
		}
			lastbutton = Name;
}

function hide() {
	if (document.images && (loaded == 1)) {
		change(lastbutton,0);
	}
}

var count = 0;

function preLoad() {

img1=new Image()
img1.src="graph/popup.about.lateral.0.gif"
img2=new Image()
img2.src="graph/popup.about.lateral.1.gif"

img3=new Image()
img3.src="graph/popup.about.lateral.2.gif"
img4=new Image()
img4.src="graph/popup.about.lateral.3.gif"

img5=new Image()
img5.src="graph/popup.about.lateral.4.gif"
img6=new Image()
img6.src="graph/popup.about.lateral.5.gif"

img7=new Image()
img7.src="graph/popup.about.lateral.6.gif"
img8=new Image()
img8.src="graph/popup.about.lateral.7.gif"

img9=new Image()
img9.src="graph/popup.about.lateral.8.gif"
img10=new Image()
img10.src="graph/popup.about.lateral.9.gif"

img11=new Image()
img11.src="graph/popup.about.lateral.10.gif"

img12=new Image()
img12.src="graph/popup.menu.arm.0.gif"
img13=new Image()
img13.src="graph/popup.menu.arm.1.gif"

img14=new Image()
img14.src="graph/popup.menu.barr.0.gif"
img15=new Image()
img15.src="graph/popup.menu.barr.1.gif"

}

function loadCheck() {
	count++;
	if(count == 15) {
		moveLayers();
	}
}


var timeout;
function menuStop(){
timeout = clearTimeout(timeout);
}

function menuDown(){
timeout = clearTimeout(timeout); //Prevent multiple timeouts
timeout = setTimeout('go()',3000); //Previously 500
}

function go(){
popUp('ceroMenu',false);
change('cero',1);
}

function linkselect (url) {
  if (url.length > 0) {
   window.parent.location = "http://" + url;
    }
}

function setDatum(){
var mydate=new Date()
var year=mydate.getYear()
if (year<2000)
year=1900+year
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym=""+daym
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

document.write("<FONT COLOR='C2C2C2' FACE='Verdana,Geneva, Arial, Helvetica' STYLE='FONT-SIZE: 12px'>&nbsp;"+dayarray[day]+", "+daym+" "+montharray[month]+" , "+year+"</font>")
}