// Author: Vince Reid, vince@virtualred.net // Copyright: Internet Business Solutions S.L. // http://www.ibswebdesign.com // PopOutTextMenu: v1.31 var ie,ns6,ns,opera,ismac; var menuid,d6,c2ref; var c1,c2,c3; var globalsdefined=false; var debugstr=""; var debug=false; function addtodebug(str){ debugstr += str+'\n'; }; function showdebug(){ alert(debugstr+'\n'); debugstr=""; }; function d3(ginfref,top,c4,sub,c9){ this.d4=ginfref; this.d5=top; this.c4=c4; this.submenu=0; this.sub=sub; this.c9=c9; this.d1=0; this.d2=0; this.b1=0; this.a8=0; this.a9=0; }; function a0(){ this.b2=0; this.b3=0; this.b4=0; this.b5=0; this.b8=0; this.b9=0; this.b7=0; this.b6=0; this.hideselect=false; this.hideobject=false; }; function defineglobals(){ if(globalsdefined==true) return; ie=(document.all); ns6=(document.getElementById&&!document.all); ns=(document.layers != (void 0)); ismac=(navigator.appVersion.indexOf("Mac") != -1); opera=false; if(ie){ var agent=navigator.userAgent.toLowerCase(); opera=(agent.indexOf("opera") != -1); }; c1=new Array(); c3=new Array(); c2 = new Array(); menuid=1; d6=1; c2ref=1; }; function showrootmenu(c8){ if(ie){ mnn=eval('vrsub'+c8); mnn.style.visibility="visible"; } else if(ns6){ mnn=document.getElementById('vrsub'+c8); mnn.style.visibility="visible"; } else if(ns){ mnn=eval('document.layers.vrsub'+c8); mnn.visibility="show"; }; }; function c6(c8, whichmenu){ c8=c3[c8].sub; while(c8 != 0){ if(c3[c8].c4 == whichmenu) return true; c8=c3[c8].sub; }; return false; }; function c7(c8, whichitem){ while(whichitem != 0){ if(whichitem == c8) return true; whichitem=c3[whichitem].d5; }; return false; }; function c5(c8){ var loindex=65535, hiindex=0, tm = new Array(), thetop, ii; for(ii=c2[c3[c8].d4].b8;ii <= c2[c3[c8].d4].b9;ii++){ if(c3[ii].c4 < loindex) loindex=c3[ii].c4; if(c3[ii].c4 > hiindex) hiindex=c3[ii].c4; if(c3[ii].d5 == 0) thetop = ii; if(c7(ii, c2[c3[c8].d4].b5)){ tm[c3[ii].c4]=true; } else if(c2[c3[c8].d4].b4 != 0 && c3[ii].c4 == c3[c2[c3[c8].d4].b5].submenu) tm[c3[ii].c4]=true; }; tm[c2[c3[c8].d4].b4]=true; for(ii=loindex;ii <= hiindex;ii++){ if(tm[ii]==true){ mnn=eval('document.layers.vrsub'+ii); if(mnn.visibility != "show") mnn.visibility="show"; } else{ if(ii != c3[thetop].c4){ mnn=eval('document.layers.vrsub'+ii); if(mnn.visibility != "hide") mnn.visibility="hide"; }; }; }; }; function showhideobjects(showhide,bSelect,bObject){ if(bSelect){ for(ii=0; iithis.firstmenuitem&&this.mainspacery>0){ this.d8 += ''; this.d8 += ''; this.d8 += ''; }; if(ie){ this.d8 += ''; this.d8 += ''; } else if(ns){ this.d8 += ''; this.d8 += ''; if(this.nnmainheight > 0) this.d8 += '
'; this.d8 += ' '; if(mlink != "") this.d8 += ''; this.d8 += mtext; if(mlink != "") this.d8 += ''; this.d8 += '
'; } else if(ns6){ this.d8 += ''; this.d8 += ''; }; }; POTMenu.prototype.addSubMenu=function(mid, submid, mtext, murl){ if(!c1[mid]) alert('No menu named '+mid+' has been defined.'); d6++; if(this.g4 != mid){ if(this.g4!=null){ var d1=((this.nomenus-1)*this.subspacery)+this.nomenus*this.subcheight; this.d7 += ''; this.d7 += ''; this.d7 += ''; this.d7 += ''; if(ns) this.d7 += ''; else this.d7 += ''; this.d7=this.d7.replace("imgplaceholder", d1-this.d9); this.nomenus=0; } menuid++; this.g4=mid; if(ie) this.d7 += ''; } else if(ns6){ this.d7 += ''; } else if(ns) this.d7 += ''; document.write(this.d7.replace("imgplaceholder", d1-this.d9)); c2[this.f3].b9=d6; c1=new Array(); showrootmenu(this.rootmenu); }; POTMenu.prototype.mainmenuitemsize=function(width,height){ this.g3=width; this.g1=height; this.mainpreimy=height-3; }; POTMenu.prototype.submenuitemsize=function(width,height){ this.subcwidth=width; this.subcheight=height; this.subpreimy=height-3; }; POTMenu.prototype.submenuplacing=function(b2,b3){ this.b2=Math.abs(b2); this.b3=b3; }; POTMenu.prototype.mainborderimages=function(left,right,top,bottom){ this.imgleft=left; this.imgright=right; this.imgtop=top; this.imgbottom=bottom; }; POTMenu.prototype.mainbordercorners=function(topleft,topright,bottomleft,bottomright){ this.f7=topleft; this.f6=topright; this.f5=bottomleft; this.f4=bottomright; }; POTMenu.prototype.mainborderdimensions=function(leftwidth,rightwidth,height){ this.imgcornerleft=this.f8=leftwidth; this.imgcornerright=this.f9=rightwidth; this.imgheight=height; this.mainba=0; }; POTMenu.prototype.subborderimages=function(left,right,top,bottom){ this.h9=left; this.f1=right; this.h6=top; this.h5=bottom; }; POTMenu.prototype.subbordercorners=function(topleft,topright,bottomleft,bottomright){ this.h4=topleft; this.h3=topright; this.h2=bottomleft; this.h1=bottomright; }; POTMenu.prototype.subborderdimensions=function(leftwidth,rightwidth,height){ this.a2=this.h8=leftwidth; this.a1=this.f1width=rightwidth; this.g2=height; this.subba=0; }; POTMenu.prototype.definejoin=function(join,joinheight){ this.f2=join; this.d9=joinheight; }; POTMenu.prototype.maincornerwidths=function(leftwidth,rightwidth){ this.imgcornerleft=leftwidth; this.imgcornerright=rightwidth; this.mainba=(leftwidth+rightwidth)-(this.f8+this.f9); }; POTMenu.prototype.subcornerwidths=function(leftwidth,rightwidth){ this.a2=leftwidth; this.a1=rightwidth; this.subba=(leftwidth+rightwidth)-(this.h8+this.f1width); }; POTMenu.prototype.mainmenucolor = function(bgcolor){ this.maincalign = "left"; this.maincbgcolor = bgcolor; }; POTMenu.prototype.submenucolor = function(bgcolor){ this.subcalign = "left"; this.subcbgcolor = bgcolor; }; POTMenu.prototype.mainpreimage = function(pim,pio,pix,piy){ this.mainpreim = pim; this.mainpreimov = pio; this.mainpreimx = pix; this.mainpreimy = piy; }; POTMenu.prototype.subpreimage = function(pim,pio,pix,piy){ this.subpreim = pim; this.subpreimov = pio; this.subpreimx = pix; this.subpreimy = piy; }; POTMenu.prototype.definemainspacer = function(name,height){ this.mainspacer = name; this.mainspacery = height; }; POTMenu.prototype.definesubspacer = function(name,height){ this.subspacer = name; this.subspacery = height; }; POTMenu.prototype.netscapeadjust = function(main,sub){ this.nnmainheight = main; this.nnsubheight = sub; }; POTMenu.prototype.hideobjects = function(bSelect,bObject){ this.hideselect = bSelect; this.hideobject = bObject; }; this.mainmenuitemsize(160,30); this.submenuitemsize(100,30); this.submenuplacing(0,0); this.mainborderdimensions(1,1,1); this.subborderdimensions(1,1,1); this.mainborderimages("clearpixel.gif","clearpixel.gif","clearpixel.gif","clearpixel.gif"); this.mainbordercorners("clearpixel.gif","clearpixel.gif","clearpixel.gif","clearpixel.gif"); this.subborderimages("clearpixel.gif","clearpixel.gif","clearpixel.gif","clearpixel.gif"); this.subbordercorners("clearpixel.gif","clearpixel.gif","clearpixel.gif","clearpixel.gif"); this.definejoin("",0); this.mainpreimage("clearpixel.gif","clearpixel.gif",5,27); this.subpreimage("clearpixel.gif","clearpixel.gif",5,27); this.definemainspacer("",0); this.definesubspacer("",0); this.g4=null; this.d8=""; this.d7=""; this.nomenus=0; this.netscapeadjust(0,0); this.hideselect=false; this.hideobject=false; c0=false; }