function showsubmenu1(value){ for (var ii = 0; ii <= 10; ii++){ var mainbav = document.getelementbyid("mainbav" + ii); var submenu = document.getelementbyid("submenu" + ii); if( mainbav == null ) break; if(ii == value){ submenu.style.display="block"; }else if(ii != value){ submenu.style.display="none"; } } } function hidden(value, e) { var obj = document.getelementbyid("mainbav" + value); var submenu = document.getelementbyid("submenu" +value); var e = e || window.event, nowobj = e.toelement || e.relatedtarget; var sourceobj=nowobj; while(nowobj && nowobj != obj){ nowobj = nowobj.parentnode; } if(!nowobj){ submenu.style.display="none";; } } function showsubmenu(value){ for (var ii = 0; ii <= 10; ii++){ var mainbav = document.getelementbyid("mainbav" + ii); var submenu = document.getelementbyid("submenu" + ii); if( mainbav == null ) break; if(ii == value){ submenu.style.display="block"; // 如果没有内容,则不显示子菜单 if(submenu.getelementsbytagname('a').length==0){ submenu.style.display="none"; continue; } var mainleft=mainbav.offsetleft; var dtwidth=submenu.offsetwidth; var tbwidth; var leftpadding1; var leftpadding2; //判断ospod变量是否存在,兼容老版本 if((typeof(ospod) != 'undefined' && ospod.browser.isie) || browser.isie){ tbwidth=submenu.firstchild.offsetwidth; leftpadding1=mainleft; leftpadding2=dtwidth-tbwidth; }else{ tbwidth=submenu.childnodes[1].offsetwidth; leftpadding1=mainleft - document.getelementbyid("mainbav0").offsetleft; leftpadding2=dtwidth-tbwidth - document.getelementbyid("mainbav0").offsetleft; } if(typeof(tbwidth) == 'undefined'){ // ie9、ie10的修复补丁 tbwidth=submenu.childnodes[1].offsetwidth; leftpadding1=mainleft - document.getelementbyid("mainbav0").offsetleft; leftpadding2=dtwidth-tbwidth - document.getelementbyid("mainbav0").offsetleft; } if(mainleft+tbwidth