function menu() { document.getElementById("dropmenu").innerHTML=categoryMenu; } var categoryMenu='Rubber SlippersLadies SandalsGents SandalsGents ShoesCanvas Shoes'; var i=0; var jsMenu={ img:null, disappearDelay: 250, //set delay in miliseconds before menu disappears onmouseout disableMenuClick: true, //when user clicks on a menu item with a drop down menu, disable menu item's link? enableSwipe: 1, //enable swipe effect? 1 for yes, 0 for no enableIframeShim: 1, //enable "iframe shim" technique to get drop down menus to correctly appear on top of controls such as form objects in IE5.5/IE6? 1 for yes, 0 for no //-------------------------------------------------------------------------------------- dropMenuObj: null, ie: document.all, firefox: document.getElementById&&!document.all, swipeTimer: undefined, bottomClip:0, onMouseOut:function() { /********************************************************************************************** keep the onmouseout function here.Please keep the variable name as itis. for accurate functionality you should have the name of the img tag as the parameter of the javascript function. Eg: in the web page. function swapimgV(vname) as javascript function. { if(vname=="001") document.images.001.src="menu/menu01On.gif"; } ***********************************************************************************************/ swaprestoreV(jsMenu.img) }, getPosOffset:function(what, offsetType) { var totalOffset=(offsetType=="left")? what.offsetLeft : what.offsetTop; var parentEl=what.offsetParent; while (parentEl!=null) { totalOffset=(offsetType=="left")? totalOffset+parentEl.offsetLeft : totalOffset+parentEl.offsetTop; parentEl=parentEl.offsetParent; } // alert(what.offsetParent.offsetTop); // alert(what.offsetTop); /*alert(what.offsetLeft); alert(what.offsetTop);*/ // totalOffset = 12; return totalOffset; }, swipeEffect:function() { if (this.bottomClipobject,e->event { if (this.ie || this.firefox) this.dropMenuObj.style.left=this.dropMenuObj.style.top="-500px" if (e.type=="click" && obj.style.visibility==hidden || e.type=="mouseover") { if (this.enableSwipe==1) { if (typeof this.swipeTimer!="undefined") clearTimeout(this.swipeTimer) obj.style.clip="rect(10 auto 10 10)" //hide menu via clipping this.bottomClip=0 this.swipeEffect() } obj.style.visibility="visible" } else if (e.type=="click") obj.style.visibility="hidden" }, ieCompatTest:function() { return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body }, clearBrowserEdge:function(obj, whichEdge) { var edgeOffset=0 if (whichEdge=="rightedge") { var windowEdge=this.ie && !window.opera? this.ieCompatTest().scrollLeft+this.ieCompatTest().clientWidth-15 : window.pageXOffset+window.innerWidth-15 this.dropMenuObj.contentMeasure=this.dropMenuObj.offsetWidth if (windowEdge-this.dropMenuObj.x < this.dropMenuObj.contentMeasure) //move menu to the left? edgeOffset=this.dropMenuObj.contentMeasure-obj.offsetWidth } else { var topEdge=this.ie && !window.opera? this.ieCompatTest().scrollTop : window.pageYOffset//0 var windowEdge=this.ie && !window.opera? this.ieCompatTest().scrollTop+this.ieCompatTest().clientHeight-15 : window.pageYOffset+window.innerHeight-18//552,50 this.dropMenuObj.contentMeasure=this.dropMenuObj.offsetHeight//92 if (windowEdge-this.dropMenuObj.y /*18*/ < this.dropMenuObj.contentMeasure) { //move up? edgeOffset=this.dropMenuObj.contentMeasure+obj.offsetHeight//15 if ((this.dropMenuObj.y-topEdge)0) { //this.bottomClip+=10+(this.bottomClip/10) //unclip drop down menu visibility gradually this.bottomClip-=5+(this.bottomClip/10) //unclip drop down menu visibility gradually this.dropMenuObj.style.clip="rect(0 auto "+this.bottomClip+"px 0)" } else { jsMenu.onMouseOut() //Unhighloght the image. return } this.swipeTimer=setTimeout("jsMenu.delayHideMenuOut()", 10) }, */ clearHideMenu:function() { if (this.delayHide!="undefined") { clearTimeout(this.delayHide) // jsMenu.onMouseOut() //unhighlights onmouseover of different drop menu. } }, //testing clearHideMenu_1:function() { if (this.delayHide!="undefined") clearTimeout(this.delayHide) }, startMenu:function() { for (var ids=0; idspath,event->object Event,this.getAttribute("rel")->dropmenu1..2..3 } } } /*for(var r=0; rold image is unhighlighted. { jsMenu.onMouseOut() } jsMenu.img=this.getAttribute("name") //assigns the name of the img tag to jsMenu.img } } }*/ } if (window.createPopup && !window.XmlHttpRequest) { //if IE5.5 to IE6, create iframe for iframe shim technique document.write('') this.shimObject=document.getElementById("iframeshim") //reference iframe object } } } //IF YOU NEED TO KEEP ONMOUSEOVER FUNCTION IN .js FILE UNCOMMENT OBJECT BELOW OTHERVISE USE IT IN THE WEB PAGE ITSELF. /*var h={ doSomething:function() { for (var ids=0; ids