var mcolors=new Array(); //bgcolor tables
mcolors[0]='#666666';
mcolors[1]='#D79033';
mcolors[2]='#8AC426';
mcolors[3]='#EFC046';
mcolors[4]='#FB8C15';
mcolors[5]='#286D98';
mcolors[6]='#8AC426';

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

var pxcorrect=0; // correct menu mixel position

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

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;
						 boff+=atag.offsetTop;
					}
 				 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("td");
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;
									}
							 }
						 }
				 }
	   }
	 }
}
		
