// cbddm.js<br />// V 1.4f<br />// 01/Jun/2003<br />// © Andrew Holt<br />// <a href='http://www.webdevtips.co.uk' target='_blank'>http://www.webdevtips.co.uk</a><br />// <a href='http://www.dropmenu.co.uk' target='_blank'>http://www.dropmenu.co.uk</a><br />// <a href='http://www.webdesignhelp.co.uk' target='_blank'>http://www.webdesignhelp.co.uk</a><br />// <a href='http://www.andys-onestop.co.uk' target='_blank'>http://www.andys-onestop.co.uk</a><br />//14/08 konqueror workaround<br />//works in chimera<br />//You are free to use this script providing you leave all the comments intact<br />//Scripts can end up all over the net and by removing comments you are stopping people from getting proper updates from the author.<br />//End of preaching <!--emo&--><img src='style_emoticons/<#EMO_DIR#>/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo--><br />//http://www.dropmenu.co.uk<br /><br />//Enjoy<br /><br />//Andy<br /><br />var toggleswitch=0;<br />var Mac = (navigator.userAgent.indexOf("mac")!=-1) || (navigator.userAgent.indexOf("Mac")!=-1);<br />var opnew = (navigator.userAgent.indexOf('Opera 7')!=-1);<br />var opold = (navigator.userAgent.indexOf('Opera')!=-1);<br />var msie = (navigator.userAgent.indexOf('MSIE')!=-1);<br />var moz = (navigator.userAgent.indexOf('Gecko')!=-1);<br />var NS6 = (navigator.userAgent.indexOf('Netscape')!=-1 && navigator.userAgent.indexOf('Gecko')!=-1);<br />var Nav4 = (document.layers);<br />var konq = (navigator.userAgent.indexOf('Konqueror')!=-1);<br />if (opold && msie || opold){var opold=1; msie=0;}<br />if (msie && !opold){msie=1;}<br />if(opnew && opold){opold=0;}<br />if(msie || moz || opnew){var dom = 1;}<br />var stopshow=0;<br />var noway=0;<br /><br /><br /><br />if(konq){noway=1}<br /><br />var timerID=null<br />var timerID2=null<br />var stopclose=1;<br />var whatsopen = "none";<br />var newsonoff=0;<br />var operaload=0;<br />var isform="no";<br />var menutop=0;<br />var menuleft=0;<br />var nsmenutop=0;<br />var nsmenuleft=0;<br /><br />if (Nav4) {<br /> window.captureEvents(Event.MOUSEMOVE);<br /> window.onmousemove=move;<br />}<br />function move(e) {<br />nsmenuleft=e.pageX;<br />nsmenutop=e.pageY;<br />nsmenuleft1-=0;<br />nsmenutop-=0;<br />}<br /><br />if(noway==0){<br />document.write("<link rel=\"stylesheet\" href=\""+path_to_stylesheet+"\">");<br />}<br />//###################################################<br />function startup(){<br />if(noway){return;}<br />if (msie && !Mac)<br /> {<br />for(var i = 0 ; i <= howmanymenus ; i++){<br />toggle2(menunames);}<br /> }<br /> else<br /> {return false;}<br />}<br />//End Startup function<br />//###################################################<br /><br /><br />//###################################################<br />function toggle(whatmenu,isMain){<br />if(noway){return;}<br />getpositions();<br />if(newsonoff==1){return false;}<br />if (isMain==1){<br /><br /> if(timerID){clearTimeout(timerID);}<br /><br /> if (whatsopen == "none"){<br /> toggle2(whatmenu);<br /><br /> isMain=0;<br /> }<br /><br /> if(whatsopen == whatmenu){<br /> isMain=0;<br /> }<br /><br /> if(whatsopen != whatmenu && whatsopen != "none"){<br /> toggle2(whatsopen);<br /> toggle2(whatmenu);<br /> isMain=0;<br /> }<br />if(timerID2){clearTimeout(timerID2)}<br />timerID2=setTimeout("toggle2('"+whatmenu+"');",5000);<br />return;<br />}<br />if(isMain==0){<br /> if(whatsopen != "none" && isMain!=1){<br /> toggle2(whatmenu);<br /> }<br />}<br />}<br />//###################################################<br /><br /><br />//###################################################<br /><br />function toggle2(whatmenu)<br />{<br />if(noway){return;}<br /><br />//================================================<br /> if (msie)<br /> {<br /> if(effectopen != -1 && effectclose != -1){<br /> eval(whatmenu+".filters(0).Apply();");<br /> }<br /><br /> if (eval(whatmenu+".style.visibility") == 'hidden')<br /> {<br /> if(isform=="yes"){document.getElementById('formhide').style.visibility='hidden';}<br /><br /> eval(whatmenu+".style.visibility='visible';");<br /><br /> eval(whatmenu+".filters[0].transition=effectopen");<br /> whatsopen=whatmenu;<br /> }<br /> else<br /> {<br /><br /> if(isform=="yes"){document.getElementById('formhide').style.visibility='visible';}<br /><br /> eval(whatmenu+".style.visibility = 'hidden';");<br /><br /> eval(whatmenu+".filters[0].transition=effectclose");<br /><br /> whatsopen="none";<br /> }<br /> if(effectopen != -1 && effectclose != -1){<br /> eval(whatmenu+".filters(0).Play();");<br /> }<br /> }<br />//================================================<br /><br /><br />//================================================<br />if (opold)<br />{<br />if(newsonoff !=1){<br /> menuheight = buttonheight;<br /> winx = event.x;<br /> menuleft=winx;<br /> x1=buttonwidth/2;<br /> if(operaload==0 && menudir=="hor"){<br /> operatop = event.y+buttonheight;;<br /> operaload=1;<br /> }<br /> if(operaload!=0 && menudir=="hor"){<br /> menutop=operatop;<br /> }<br /> widtot = winx + x1;<br /> if (widtot > docwidth && menudir=="hor"){<br /> menuleft = winx - buttonwidth;<br /> }<br /> else<br /> {<br /> var menuleft = winx -x1;<br /> }<br /> if (menudir=="ver"){<br /> menuleft = winx+30;<br /> menutop = event.y;<br /> }<br /> eval("document.getElementById('"+whatmenu+"').style.left="+menuleft);<br /> eval("document.getElementById('"+whatmenu+"').style.top="+menutop);<br />}<br /> if (toggleswitch==0)<br /> {<br /> if(isform=="yes"){document.getElementById('formhide').style.visibility='hidden';}<br /> eval(whatmenu+".style.visibility='visible';");<br /> toggleswitch=1;<br /> whatsopen=whatmenu;<br /> return;<br /> }<br /> if (toggleswitch==1)<br /> {<br /> if(isform=="yes"){document.getElementById('formhide').style.visibility='visible';}<br /> eval(whatmenu+".style.visibility = 'hidden';");<br /> toggleswitch=0;<br /> whatsopen="none";<br /> return;<br /> }<br /><br />}<br />//================================================<br /><br /><br />//================================================<br />if(Nav4){<br /><br />if (toggleswitch==0 && isform=='yes'){document.layers["formhide"].visibility = 'hidden';}<br />if (toggleswitch==1 && isform=='yes'){document.layers["formhide"].visibility = 'visible';}<br />if (toggleswitch==0 && whatmenu=="newsitem"){document['newsitem'].visibility='visible';toggleswitch=1;return; }<br />if (toggleswitch==1 && whatmenu=="newsitem"){document['newsitem'].visibility='hidden';toggleswitch=0;return; }<br />if (toggleswitch==0){<br /> if(menudir =="hor"){<br /> x1=buttonwidth/2;<br /> nsmenuleft-=x1;<br /> eval("document['"+whatmenu+"'].top="+nsmenutop+"+"+buttonheight);<br /> eval("document['"+whatmenu+"'].left="+nsmenuleft+"+10");<br /> }<br /> if(menudir =="ver"){<br /> eval("document['"+whatmenu+"'].top="+nsmenutop);<br /> eval("document['"+whatmenu+"'].left="+nsmenuleft+"+20");<br /> }<br />document.layers[whatmenu].visibility='visible';<br />toggleswitch=1;<br />whatsopen=whatmenu;<br />return;<br />}<br /> if (toggleswitch==1){<br /> document.layers[whatmenu].visibility='hidden';<br /> toggleswitch=0;<br /> whatsopen="none";<br /> return;<br /> }<br />}<br />//================================================<br /><br /><br />//================================================<br />if (moz || opnew)<br /> {<br /> if(toggleswitch == 0){<br /> if(isform=="yes"){document.getElementById('formhide').style.visibility='hidden';}<br /> eval("document.getElementById('"+whatmenu+"').style.visibility = 'visible';");<br />toggleswitch=1;<br />whatsopen=whatmenu;<br />;return;}<br /> if(toggleswitch == 1){<br /> if(isform=="yes"){document.getElementById('formhide').style.visibility='visible';}<br /> eval("document.getElementById('"+whatmenu+"').style.visibility = 'hidden';");toggleswitch=0;whatsopen="none";return;}<br /> }<br /><br /><br />//================================================<br />}<br /><br /><br /><br />//###################################################<br />function goSub(where,what,tgt)<br />{<br />stopshow=-1;<br />clearTimeout(timerID);<br />clearTimeout(timerID2);<br />if(tgt==''){var wintgt="self";}<br />else<br />{var wintgt=tgt;}<br />if(effectopen!=-1 || effectclose!=-1){toggle2(what);}<br /> if(tgt == ''){whereto= "location.href='"+where+"'";}<br /> if(tgt == 'new'){whereto= "window.open('"+where+"','"+tgt+"');";}<br /> if(tgt != 'new' && tgt != ''){whereto= "parent."+tgt+".location.href='"+where+"'";}<br /> setTimeout("eval(whereto)",550);<br />}<br />//###################################################<br /><br /><br /><br />//###################################################<br />function getpositions(){<br />if(noway){return;}<br />if (Nav4 || NS6){<br />docwidth = window.innerWidth;docwidth-=0; }<br />if(msie || (moz && !NS6) || konq || opold || opnew ){<br />docwidth = document.body.clientWidth;<br />docwidth-=0;<br />}<br /><br />//================================================<br />if (dom){<br />var menutop = document.getElementById('navbar').offsetTop;<br />var menuleft = document.getElementById('navbar').offsetLeft;<br />var menuheight = document.getElementById('navbar').offsetHeight;<br /><br />if(menudir=="hor"){<br />menutop += menuheight-4; menuleft +=6;}<br /><br />if(menudir=="ver"){ menuleft += navwidth[0]+0;menutop += cellpad;}<br /><br />for(var i = 0 ; i <= howmanymenus ; i++){<br />if(menudir == "hor"){menuleft+=cellpad;}<br />eval("document.getElementById('"+menunames+"').style.left="+menuleft);<br />eval("document.getElementById('"+menunames+"').style.top="+menutop);<br /><br /> if(menudir=="hor"){<br /> tot=menuleft+navwidth+buttonwidth;<br /> if( tot >= docwidth ){<br /> menuleft += navwidth+navwidth[i+1];<br /> menuleft -= buttonwidth;<br /> }<br /> else<br /> {<br /> menuleft += navwidth+cellpad;<br /> if(NS6){menuleft += cellpad;}<br /> }<br />}<br /><br /> if(menudir=="ver"){<br /> menutop +=cellpad+cellpad;<br /> if(moz){menutop += cellpad;}<br /> }<br />}<br />//================================================<br /><br />//###################################################<br />}<br />}<br /><br />function donewsitem(onoff){<br />if(noway){return;}<br />newsonoff=onoff;<br /> if (window.innerWidth){<br /> docwidth = window.innerWidth;<br /> docheight = window.innerHeight;<br /> }<br /> else<br /> {<br /> docwidth = document.body.clientWidth;<br /> docheight = document.body.clientHeight;<br /> }<br /><br />newsleft = docwidth-newswide;<br />newsleft=newsleft/2;<br />newstop = docheight-newshigh;<br />newstop=newstop/2;<br />timer=newstimer*1000;<br />effectopenbak=effectopen;<br />effectclosebak=effectclose;<br /><br />if(newsonoff != 1){return false;}<br /><br /><br />if(dom || konq || opold || opnew){<br /> toggleswitch = 1;<br /> effectopen=newseffect;<br /> effectclose=newseffect;<br /> document.getElementById("newsitem").style.left=newsleft;<br /> document.getElementById("newsitem").style.top=newstop;<br /> toggle2('newsitem');<br /> }<br /><br />if (Nav4) {<br />toggleswitch = 0;<br /> document['newsitem'].top=newstop;<br /> document['newsitem'].left=newsleft;<br /> }<br />toggle2('newsitem');<br />setTimeout("toggle2('newsitem');newsonoff=0;effectopen=effectopenbak;effectclose=effectclosebak",timer);<br /><br />}<br />function killMenu(whatwait){<br />if(noway){return;}<br />if(stopshow==-1){return;}<br />if(timerID){clearTimeout(timerID)}<br />if(timerID2){clearTimeout(timerID2)}<br />timerID=setTimeout("toggle2('"+whatwait+"');",500);<br />}<br />function checkMenu(){<br />if(noway){return;}<br />if(stopshow==-1){return;}<br />if(timerID){clearTimeout(timerID)}<br />if(timerID2){clearTimeout(timerID2)}<br /><br />}<br /><br />//End of Script<br />// Get updates and fixes @ <a href='http://www.dropmenu.co.uk' target='_blank'>http://www.dropmenu.co.uk</a><br />//Please leave these com |