﻿if(navigator.appName.charAt(0)=='M'){document.getElementById("multi").style.marginLeft=(screen.width-868)/2;}
pos = new Array();states = new Array();
var sign=0;
manu=document.getElementById("main");
links=manu.getElementsByTagName("a");
manu=manu.getElementsByTagName("th");
for(i=0;i<manu.length;i++){
             pos[i]=0; 
             if(manu[i].attachEvent){ links[i].attachEvent("onmouseover",handleX);
                                      links[i].attachEvent("onmouseout",handleX);  } 
             else{ links[i].onmouseover=handleY;
                   links[i].onmouseout=handleY;  }
}

function change() { 
                    for(i=0;i<manu.length;i++){  
                      if(states[i]=='mouseover'){  
                         if(pos[i]>36){pos[i]=72-pos[i];}if(pos[i]<36){pos[i]+=1.5;manu[i].style.background="url(manubg.jpg) 0 "+pos[i]+'px';}     
                                               }
                      if(states[i]=='mouseout'){
                         if(pos[i]<36){pos[i]=72-pos[i];}if(pos[i]<72){pos[i]+=1.5;manu[i].style.background="url(manubg.jpg) 0 "+ -pos[i]+'px';}                
                                              }                    
                                            }
}

function handleX(z) {                       
                      if(sign>0){clearInterval(setID);}
                      for(i=0;i<manu.length;i++){ if(links[i]==z.srcElement){states[i]=z.type;} } 
                      sign++;       
                      setID=setInterval(change,15);
}
function handleY(z) {                       
                      if(sign>0){clearInterval(setID);}
                      for(i=0;i<manu.length;i++){ if(links[i]==z.target){states[i]=z.type;} } 
                      sign++;       
                      setID=setInterval(change,15);
}