function getDocumentSize(doc){var r={width:0,height:0};var width1=0,width2=0,width3=0,width4=0,maxWidth=0;var height1=0,height2=0,height3=0,height4=0,maxHeight=0;if(doc.width)maxWidth=doc.width;if(doc.body){if(doc.body.scrollWidth)width1=doc.body.scrollWidth;if(doc.body.offsetWidth)width2=doc.body.offsetWidth}if(doc.documentElement){width3=doc.documentElement.scrollWidth;width4=doc.documentElement.clientWidth}maxWidth=Math.max(Math.max(Math.max(width1,width2),Math.max(width3,width4)),maxWidth);if(doc.height)maxHeight=doc.height;if(doc.body){if(doc.body.scrollHeight)height1=doc.body.scrollHeight;if(doc.body.offsetHeight)height2=doc.body.offsetHeight}if(doc.documentElement){height3=doc.documentElement.scrollHeight;height4=doc.documentElement.clientHeight}maxHeight=Math.max(Math.max(Math.max(height1,height2),Math.max(height3,height4)),maxHeight);document.getElementById('shadow_overlay').style.height=maxHeight+"px"}var ul=document.getElementById('topmenu_items');var lis=new Array();var st=null;var nst=null;var mst=null;var q=0;getDocumentSize(document);for(i=0;i<ul.childNodes.length;i++){if(ul.childNodes[i].nodeName=="LI"){q++;if(q==15){ul.childNodes[i].onmouseover=hide_menu;lis.push(ul.childNodes[i].firstChild)}else{ul.childNodes[i].onmouseover=show_menu;lis.push(ul.childNodes[i].firstChild)}}}for(j=0;j<4;j++){if(j==2){continue}var dv=$('menu'+j);for(i=0;i<dv.childNodes.length;i++){if(dv.childNodes[i].nodeName=='UL'){var uls=dv.childNodes[i];for(k=0;k<uls.childNodes.length;k++){if(uls.childNodes[i].firstChild.nodeName=="A"){lis[j].href=uls.childNodes[i].firstChild.href}}}}}$('shadow_overlay').onmouseover=hide_menu;$('lang_ch').onmouseover=hide_menu;function show_menu(e){if(e){elt=e.target}else{elt=event.srcElement}if(elt.tagName=='LI')return;nst=elt;if(st!=elt&&st){return_style(st);hide_part(st)}st=elt;for(i=0;i<lis.length;i++){if(elt==lis[i]){mst=document.getElementById('menu'+i)}}show_shadow()}var fade_si=null;var fade_num=0;function show_shadow(){if($('shadow_overlay').style.display=="block"){show_menus();return}$('shadow_overlay').setOpacity(0);$('shadow_overlay').style.display="block";if(!fade_si){fade_si=setInterval(fade_in,1)}}var k=0.3;function fade_in(){if($('shadow_overlay').style.display!="block"){return}$('shadow_overlay').setOpacity(fade_num);fade_num+=k;k=k/2;if(k<0.1)k=0.1;if(fade_num>0.75){clearInterval(fade_si);fade_si=null;fade_num=0;show_menus()}}function show_menus(){set_new_style(nst);mst.style.display="block"}function hide_menu(event){for(i=0;i<4;i++){document.getElementById('menu'+i).style.display="none"}document.getElementById('shadow_overlay').style.display="none";return_style(st);st=null}function hide_part(elt){for(i=0;i<lis.length;i++){if(elt==lis[i]){document.getElementById('menu'+i).style.display="none"}}}function set_new_style(el){if(!el)return;el.style.color='#343434';el.className='white_bg'}function return_style(el){if(!el)return;el.style.color='#FFFFFF';el.className='';el.style.backgroundColor='transparent'}
