/******************************************************************************* Copyright (c) 1999 Thomas Brattli (www.bratta.com) eXperience DHTML coolMenus - Get it at www.bratta.com Version 1.0 This script can be used freely as long as all copyright messages are intact. Visit www.bratta.com/dhtml for the latest version of the script. This is the actual script page. You shouldn't really have to edit anything in here. *******************************************************************************/ //Default browsercheck, added to all scripts! function checkBrowser(){ this.ver=navigator.appVersion this.dom=document.getElementById?1:0 this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; if (this.ie5==0) { this.ie5=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0; } this.ie4=(document.all && !this.dom)?1:0; this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; this.ns4=(document.layers && !this.dom)?1:0; this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) return this } var bw=new checkBrowser() //Ie var var explorerev='' var lvl=''; var offline= 'file:///C:/asites/toyvault3/'; var online= 'http://www.sculptimage.com/'; //toyvault/'; var cnt=0; var off_cnt=0 function getLevel(){ var cnt=0; var addr=''; var tmp= location.href; if(tmp.indexOf('file:')>-1 || tmp.charAt(1)==':') addr= offline; else if(tmp.indexOf('http:')>-1) addr= online; for(var i=0;ioff_cnt)lvl+='../'; } } } getLevel(); function goMenus(){ /******************************************************************************** Variables to set. Remember that to set fontsize and fonttype you set that in the stylesheet above! ********************************************************************************/ //Making a menu object oMenu=new menuObj('oMenu') //Place a name for the menu in there. Must be uniqe for each menu //Setting menu object variables //Style variables NOTE: The stylesheet have been removed. Use this instead! (some styles are there by default, like position:absolute ++) oMenu.clMain='padding:5px; font-family:verdana; font-size:12px; font-weight:bold' //The style for the main menus oMenu.clSub='padding:5px; font-family:verdana; font-size:10px' //The style for the submenus oMenu.clSubSub='padding:5px; font-family:verdana; font-size:10px' //The style for the subsubmenus oMenu.clAMain='text-decoration:none; color:White' //The style for the main links oMenu.clASub='text-decoration:none; color:White' //The style for the sub links oMenu.clASubSub='text-decoration:none; color:White' //The style for the subsub links //Background bar properties oMenu.backgroundbar=0 //Set to 0 if no backgroundbar oMenu.backgroundbarfromleft=0 //The left placement of the backgroundbar in pixel or % oMenu.backgroundbarfromtop=0 //The top placement of the backgroundbar in pixel or % oMenu.backgroundbarsize="100%" //The size of the bar in pixel or % oMenu.backgroundbarcolor="#000000" //The backgroundcolor of the bar oMenu.mainheight=20 //The height of the main menuitems in pixel or % oMenu.mainwidth=130 //The width of the main menuitems in pixel or % /*These are new variables. In this example they are set like the previous version*/ oMenu.subwidth=oMenu.mainwidth // ** NEW ** The width of the submenus oMenu.subheight=24 //The height if the subitems in pixel or % oMenu.subsubwidth=oMenu.mainwidth // ** NEW ** The width of the subsubmenus in pixel or % oMenu.subsubheight=oMenu.subheight //** NEW ** The height if the subsubitems in pixel or % //Writing out the style for the menu (leave this line!) oMenu.makeStyle() oMenu.subplacement=oMenu.mainheight //** NEW ** Relative to the main item oMenu.subsubXplacement=oMenu.subwidth/2 //** NEW ** The X placement of the subsubmenus, relative to the sub item oMenu.subsubYplacement=7 //** NEW ** The Y placement of the subsubmenus, relative to the sub item oMenu.mainbgcoloroff='#000000' //The backgroundcolor of the main menuitems oMenu.mainbgcoloron='#660000' //The backgroundcolor on mouseover of the main menuitems oMenu.subbgcoloroff='#999999' //The backgroundcolor of the sub menuitems oMenu.subbgcoloron='#993300' //The backgroundcolor on mouseover of the sub menuitems oMenu.subsubbgcoloroff='#666666' //The backgroundcolor of the subsub menuitems oMenu.subsubbgcoloron='#996666' //The backgroundcolor on mouseover of the subsub menuitems oMenu.stayoncolor=0 //Do you want the menus to stay on the mouseovered color when clicked? oMenu.menuspeed=10 //The speed of the clipping in px oMenu.menusubspeed=15 //The speed of the submenus clipping in px oMenu.menurows=1 //Set to 0 if you want rows and to 1 if you want columns oMenu.menueventon="mouse" //Set this to "mouse" if you want the menus to appear onmouseover, set it to "click" if you want it to appear onclick oMenu.menueventoff="mouse" //Set this to "mouse" if you them to disappear onmouseout, if not set it to "click" //Placement of the menuitems //Example in %: //oMenu.menuplacement=new Array("20%","40%","60%","50%","65%") //Remember to make the arrays contain as many values as you have main menuitems //Example in px: (remember to use the ' ' around the numbers) //oMenu.menuplacement=new Array(10,200,300,400,500) //Example right beside eachother (only adding the pxbetween variable) oMenu.menuplacement=0 //If you use the "right beside eachother" you cant how many pixel there should be between each here oMenu.pxbetween=0 //in pixel or % //And you can set where it should start from the left here oMenu.fromleft=306 //in pixel or % //This is how much from the top the menu should be. oMenu.fromtop=66 //in pixel or % /******************************************************************************** Construct your menus below ********************************************************************************/ //MAIN 0 //Main items: // makeMain(MAIN_NUM,'TEXT','LINK','FRAME_TARGET') (set link to 0 if you want submenus of this menu item) /*oMenu.makeMain(0,'Company Info',0) //Sub items: // makeSub(MAIN_NUM,SUB_NUM,'TEXT','LINK',TOTAL,'FRAME_TARGET') (set link to 0 if you want submenus of this menu item) oMenu.makeSub(0,0,'Contact Us','contact.html',4) oMenu.makeSub(0,1,'The Creators','creators.html',4) oMenu.makeSub(0,2,'History','history.html',4) oMenu.makeSub(0,3,'Press Releases','press.html',4) */ //MAIN 1 /*oMenu.makeMain(1,'Where to Buy',0) oMenu.makeSub(1,0,'Toy Vault ToyClub','http:\/\/www.toyvaulttoyclub.com',3) oMenu.makeSub(1,1,'OnLine Retail','account/online.php',3) oMenu.makeSub(1,2,'Stores in your Area','account/area.php',3) */ // oMenu.makeMain(2,'The Action Figures',0) /* oMenu.makeMain(2,'The Toys',0) oMenu.makeSub(2,0,'Middle-earth Toys','middleearth/index.html',10) oMenu.makeSub(2,1,'Farscape','farscape/index.html',10) oMenu.makeSub(2,2,'EverQuest','everquest/index.html',10) oMenu.makeSub(2,3,'Cthulhu','cthulhu/index.html',10) oMenu.makeSub(2,4,'Elric','elric/index.html',10) oMenu.makeSub(2,5,'DeadLands','deadlands/index.html',10) oMenu.makeSub(2,6,'Looking Glass','alice/index.html',10) oMenu.makeSub(2,7,'AstroCity','astrocity/index.html',10) oMenu.makeSub(2,8,'Tooth&Claw','toothandclaw/index.html',10) oMenu.makeSub(2,9,'Wheel of Time','wheel/index.html',10) */ /******************************************************************************** End menu construction ********************************************************************************/ //When all the menus are written out we initiates the menu oMenu.construct() } /******************************************************************************** Object constructor and object functions ********************************************************************************/ function makePageCoords(){ this.x=0;this.x2=(bw.ns4 || bw.ns5)?innerWidth:document.body.offsetWidth-20; this.y=0;this.y2=(bw.ns4 || bw.ns5)?innerHeight:document.body.offsetHeight-5; this.x50=this.x2/2; this.y50=this.y2/2; return this; } function makeMenu(parent,obj,nest,type,num,subnum,subsubnum){ nest=(!nest) ? '':'document.'+nest+'.' this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0; this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0; this.height=bw.ns4?this.css.document.height:this.evnt.offsetHeight this.width=bw.ns4?this.css.document.width:this.evnt.offsetWidth this.moveIt=b_moveIt; this.bgChange=b_bgChange; this.clipTo=b_clipTo; this.parent=parent; this.active=0; this.nssubover=0 if(type==0){ this.evnt.onmouseover=new Function("mmover("+num+","+this.parent.name+")"); this.evnt.onmouseout=new Function("mmout("+num+","+this.parent.name+")"); }else if(type==1){ this.clipIn=b_clipIn; this.clipOut=b_clipOut; this.clipy=0 if(bw.ns4 && this.parent.menueventoff=="mouse"){ this.evnt.onmouseout=new Function("setTimeout('if(!"+this.parent.name+"["+num+"].nssubover)"+this.parent.name+".hideactive("+num+");',100)") this.evnt.onmouseover=new Function(this.parent.name+"["+num+"].nssubover=true") } }else if(type==2){ this.evnt.onmouseover=new Function("submmover("+num+","+subnum+","+this.parent.name+")"); this.evnt.onmouseout=new Function("submmout("+num+","+subnum+","+this.parent.name+")"); }else if(type==3){ this.evnt.onmouseover=new Function("subsubmmover("+num+","+subnum+","+subsubnum+","+this.parent.name+")"); this.evnt.onmouseout=new Function("subsubmmout("+num+","+subnum+","+subsubnum+","+this.parent.name+")"); } this.tim=100 this.obj = obj + "Object"; eval(this.obj + "=this") return this } function b_clipTo(t,r,b,l,h){if(bw.ns4){this.css.clip.top=t;this.css.clip.right=r this.css.clip.bottom=b;this.css.clip.left=l; this.clipx=r; }else{this.css.clip="rect("+t+","+r+","+b+","+l+")"; this.clipx=r;; if(h){ if(bw.ie4 || bw.ie5){ this.css.height=b; this.css.width=r}}}} function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x;this.css.top=this.y} function b_bgChange(color){if(bw.dom || bw.ie4) this.css.backgroundColor=color; else if(bw.ns4) this.css.bgColor=color} function b_clipIn(speed){ if(this.clipy>0){ this.clipy-=speed if(this.clipy<0) this.clipy=0 this.clipTo(0,this.clipx,this.clipy,0,1) this.tim=setTimeout(this.obj+".clipIn("+speed+")",10) }else{this.clipy=0; this.clipTo(0,this.clipx,this.clipy,0,1)} } function b_clipOut(speed){ if(this.clipy0){ this.subsuby=0 this[i].sub[j].subs=new makeMenu(this,'div'+this.name+'Sub'+i+'_'+j+'_sub','',1,i,j) this[i].sub[j].subs.moveIt(this[i].subs.x+this.subsubXplacement,this[i].subs.y+this[i].sub[j].y+this.subsubYplacement) this[i].sub[j].sub=new Array() for(a=0;a\n'} str+='
' if(link){ link=(link=='#' || (link.indexOf(':')>-1))?link:lvl+link; str+=''+text+'
\n' this.mainmenus++; document.write(str) } function makeSub(num,subnum,text,link,total,target){ str="" if(subnum==0) str='
\n' str+='\t
' if(link){ link=(link=='#' || (link.indexOf(':')>-1))?link:lvl+link; str+=''+text+'
\n' if(subnum==total-1){ str+='
\n'; this.submenus[num]=new Array() this.submenus[num]["main"]=total; this.submenus[num]["submenus"]=new Array() } document.write(str) } function makeSubSub(num,subnum,subsubnum,text,link,total,target){ str="" if(subsubnum==0) str='
\n' str+='\t
' if(link){ link=(link=='#' || (link.indexOf(':')>-1))?link:lvl+link; str+=''+text+'
\n' if(subsubnum==total-1){str+='
\n'; this.submenus[num]["submenus"][subnum]=total} document.write(str) } /********************************************************************************************* END Menu script *********************************************************************************************/