var mcolors=new Array(); //bgcolor tables

mcolors[6]='#666666';
mcolors[5]='#D79033';
//mcolors[2]='#8AC426';
mcolors[4]='#EFC046';
mcolors[3]='#FB8C15';
mcolors[2]='#286D98';
mcolors[1]='#8AC426';
mcolors[0]='#8AC426';

var lcolors=new Array(); // layer bgcolor tables
lcolors[6]='#000000';
lcolors[5]='#C0781A';
//lcolors[2]='#75AE12';
lcolors[4]='#DBA418';
lcolors[3]='#E47804';
lcolors[2]='#1A567C';
lcolors[1]='#c1781a';
lcolors[0]='#000000';

var pxcorrect=0; // correct menu mixel position

if(navigator.userAgent.indexOf("MSIE")!=-1)pxcorrect=0;

function hover1()
{
  tid=parseInt(this.id);
  this.style.backgroundColor=lcolors[tid];
  dv=this.getElementsByTagName("div");
	if(dv.length)
	 {
		 atag=this;
		 loff=0; //left offset
		 boff=atag.offsetHeight;
		 while(atag)
		   {
			   if(atag.style.position!='absolute')
				  {
						 loff+=atag.offsetLeft;
                         if(navigator.userAgent.indexOf("MSIE")!=-1){
                            boff+=atag.offsetTop-2; //-4
                          }  
						 else boff+=atag.offsetTop-3; // -5
					}
 				 atag=atag.offsetParent;
			 } 
		if(pxcorrect)
		  {
			 loff+=pxcorrect;
			// boff+=pxcorrect;
			}	 
	   dv[0].style.left=loff+'px';
	   dv[0].style.top=boff+'px';
	   dv[0].style.display='block';
	 }
}

function hout1()
{
  this.style.backgroundColor='';
  dv=this.getElementsByTagName("div");
	if(dv.length)
	 {
	   dv[0].style.display='none';
	 }
}

function hover2()
{
  tid=parseInt(this.id);
  this.style.backgroundColor=lcolors[tid];
}

function hout2()
{
  tid=parseInt(this.id);
  this.style.backgroundColor=mcolors[tid];
}
	
newHover = function() {
//get top menu
var sfEls = document.getElementById("ynn_menut").getElementsByTagName("span");
for (i=0;i<sfEls.length;i++)
   {
	 if(sfEls[i].className=='sect' || sfEls[i].className=='sect sels')
	   {
            
	      rf=sfEls[i].getElementsByTagName("a");
				if(rf.length>0)
				 {
				   sfEls[i].id=i+'menu';
				   sfEls[i].onmouseover=hover1;
				   sfEls[i].onmouseout=hout1;
					 dv=sfEls[i].getElementsByTagName("div");
					 if(dv[0])
					  {
						 dv[0].className='subsect';
					   dv[0].style.backgroundColor=mcolors[i];
						 at=dv[0].getElementsByTagName("a");
						  if(at.length)
							 {
							   for(x=0;x<at.length;x++)
								  {
									  at[x].id=i+'smenu';
									  at[x].onmouseover=hover2;
									  at[x].onmouseout=hout2;
									}
							 }
						 }
				 }
	   }
	 }
}
		
