//Drop Down Tabs Menu- Author: Dynamic Drive (http://www.dynamicdrive.com) //Created: May 16th, 07' function searchgo(term){ var newterm = trim(term); if(newterm.length < 3) alert('Your search query must be at least 3 characters in length.'); else if(!alphaNumericCheck(term)) alert('You search query must solely consist of numbers and letters.'); else window.location = 'http://TutorialTub.com/search/' + newterm.replace(/ /g, "-"); } function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); } function alphaNumericCheck(word){ var regex=/^[0-9A-Za-z +]+$/; if(regex.test(word)) return true; else return false; } var tabdropdown={ disappeardelay: 200, //set delay in miliseconds before menu disappears onmouseout disablemenuclick: false, //when user clicks on a menu item with a drop down menu, disable menu item's link? enableiframeshim: 1, //1 or 0, for true or false //No need to edit beyond here//////////////////////// dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, previousmenuitem:null, currentpageurl: window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, ""), //get current page url (minus hostname, ie: http://www.dynamicdrive.com/) 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; } return totaloffset; }, showhide:function(obj, e, obj2){ //obj refers to drop down menu, obj2 refers to tab menu item mouse is currently over if (this.ie || this.firefox) this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px" if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){ if (obj2.parentNode.className.indexOf("default")==-1) //if tab isn't a default selected one obj2.parentNode.className="selected" obj.visibility="visible" } else if (e.type=="click") obj.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.standardbody.scrollLeft+this.standardbody.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.standardbody.scrollTop : window.pageYOffset var windowedge=this.ie && !window.opera? this.standardbody.scrollTop+this.standardbody.clientHeight-15 : window.pageYOffset+window.innerHeight-18 this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up? edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight if ((this.dropmenuobj.y-topedge)