﻿/* Vap div menu 2006-2007 */

var uaVers=''; 
var ua=''; 
if (window.navigator.userAgent.indexOf ("Opera") >= 0){   ua = 'Opera';
   uaVers=window.navigator.userAgent.substr(window.navigator.userAgent.indexOf("Opera")+6,4);
  }else
if (window.navigator.userAgent.indexOf ("Gecko") >= 0){   ua = 'Netscape';
   uaVers=window.navigator.userAgent.substr(window.navigator.userAgent.indexOf("Gecko")+6,8)+ ' ('+ window.navigator.userAgent.substr(8,3) + ')';
  }else
if (window.navigator.userAgent.indexOf ("MSIE") >= 0){   ua = 'Explorer';
   uaVers=window.navigator.userAgent.substr(window.navigator.userAgent.indexOf("MSIE")+5,3);
  }else
ua = window.navigator.appName; 
  

NC = (document.layers);  
IE = (document.all);  
DOM = (document.getElementById);


var ona=1;

function not_mouse(num){  var xa; var xb; var ya; var vb;  
    if(!window.event.x){ return false; }
	if(num==1){ xa=20; xb=720; ya=107; yb=207; }
	if(num==2){ xa=20; xb=720; ya=107; yb=207; }
	if(num==3){ xa=20; xb=720; ya=107; yb=207; }
	if(num==4){ xa=20; xb=720; ya=107; yb=207; }
	if(num==5){ xa=20; xb=720; ya=107; yb=207; }
	if(num==6){ xa=20; xb=720; ya=107; yb=207; }
	var mX=window.event.x;
	var mY=window.event.y;
	//alert(mX+'  '+mY);
	if(mX>=xa && xb>=mX && mY>=ya && yb>=mY){ return true;}
	return false;
}






function off_all(num){
  off_a(1);  off_a(2);  off_a(3); 
 	//off_a(4);  
	off_a(5);// off_a(6); 
}
function off_all_1(num){  
  if(num!=1){ off_a(1); }  if(num!=2){ off_a(2); }  if(num!=3){ off_a(3); }
  //if(num!=4){ off_a(4); }
	if(num!=5){ off_a(5); } // if(num!=6){ off_a(6); }
}
function off_im_top_all(x){
	im_top(1,0);	im_top(2,0);	im_top(3,0);
	im_top(4,0);	im_top(5,0);	//im_top(6,0);	
}


function left_x(num){
	if(num==1){ return 17; }
	if(num==2){ return 83; }
	if(num==3){ return 184; }
	if(num==4){ return 274; }
	if(num==5){ return 274;}//367; }
	if(num==6){ return 492; }
}



function on_a(num){	ona=num;
  var divnum = 'tom' + num;
  var x_coodr = left_x(num);  // 20+80*(num-1);  
  off_all_1(num);
  // off_im_top_all(0);
  
  catchid(divnum,x_coodr,108);
  catchstyle(divnum,'block'); 
  im_top(num,1);  
}

function off_a(num){
  if(ua=='Opera'){if(not_mouse(num)){ return 0; }}
  var divnum = 'tom' + num;
  // timeoutID=setTimeout ("x=1;", 50);
  catchstyle(divnum,'none');
  im_top(num,0);
}


function catchid(idd,newPosX,newPosY){
  if (NC) { document.layers[idd].top = newPosY;  
            document.layers[idd].left = newPosX;}
  if (DOM){ document.getElementById(idd).style.top = newPosY;
            document.getElementById(idd).style.left = newPosX;}
  if (IE) { document.all[idd].style.top = newPosY;
            document.all[idd].style.left = newPosX;}
}

function catchstyle(idd,stil){
  if (NC) { document.layers[idd].display = stil;}
  if (DOM){ document.getElementById(idd).style.display = stil;}
  if (IE) { document.all[idd].style.display = stil;}
}

function getLeft(idd){
  if (NC) {return document.layers[idd].offsetLeft;}
  if (DOM){ offdom = document.getElementById(idd).offsetLeft;
          	return offdom;}	  
  if (IE) {return document.all[idd].offsetLeft;}
  return 0;
}



/*  quinta   */
function im_top(idd,of){ 
   var b='';  if(of==1){  b='a';  } 
   var a='/i/menu/ptm'+idd+b+'.gif';
   var tmi = 'tm'+idd+'i';
   document.getElementById(tmi).src=a;
   
}
function im_top_0(idd,slf,of){ var b=''; if(of==1){ b='a';  } 
   var a = '/i/menu/ptm'+idd+b+'.gif';
   slf.childNodes[0].src = a;
}
function imm2(idd,of){ 
   var a='/i/menu/m2~la.gif'; var b='/i/menu/m2~ra.gif'
   if(of==0){ a='/i/menu/m2~l.gif';  b='/i/menu/m2~r.gif'} 
   idd.childNodes[0].childNodes[0].src = a;
   idd.childNodes[0].childNodes[2].src = b;                      
}


/*
fun ction move_hide(){    
  off_ all_1(ona);	
  set Timeout('move_hide()',3000);
}
*/
function exipage(){ 	}

