/*

  CASCADING POPUP MENUS v5.2beta (c) 2001-2003 Angus Turnbull, http://www.twinhelix.com
  This notice may not be altered or removed. See my site for licensing and more scripts!

*/

var isDOM=document.getElementById?1:0,isIE=document.all?1:0,isNS4=navigator.appName=='Netscape'&&!isDOM?1:0,isIE4=isIE&&!isDOM?1:0,isOp=self.opera?1:0,isDyn=isDOM||isIE||isNS4;function getRef(i,p){p=!p?document:p.navigator?p.document:p;return isIE?p.all[i]:isDOM?(p.getElementById?p:p.ownerDocument).getElementById(i):isNS4?p.layers[i]:null;};function getSty(i,p){var r=getRef(i,p);return r?isNS4?r:r.style:null;};if(!self.LayerObj)var LayerObj=new Function('i','p','this.ref=getRef(i,p);this.sty=getSty(i,p);return this');function getLyr(i,p){return new LayerObj(i,p)};function LyrFn(n,f){LayerObj.prototype[n]=new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px";'+'with(this){'+f+'}');};LyrFn('x','if(!isNaN(p))sty.left=p+px;else return parseInt(sty.left)');LyrFn('y','if(!isNaN(p))sty.top=p+px;else return parseInt(sty.top)');LyrFn('vis','sty.visibility=p');LyrFn('bgColor','if(isNS4)sty.bgColor=p?p:null;'+'else sty.background=p?p:"transparent"');LyrFn('bgImage','if(isNS4)sty.background.src=p?p:null;'+'else sty.background=p?"url("+p+")":"transparent"');LyrFn('clip','if(isNS4)with(sty.clip){left=a[0];top=a[1];right=a[2];bottom=a[3]}'+'else sty.clip="rect("+a[1]+"px "+a[2]+"px "+a[3]+"px "+a[0]+"px)" ');LyrFn('write','if(isNS4)with(ref.document){write(p);close()}else ref.innerHTML=p');LyrFn('alpha','var f=ref.filters,d=(p==null);if(f){'+'if(!d&&sty.filter.indexOf("alpha")==-1)sty.filter+=" alpha(opacity="+p+")";'+'else if(f.length&&f.alpha)with(f.alpha){if(d)enabled=false;else{opacity=p;enabled=true}}}'+'else if(isDOM)sty.MozOpacity=d?"":p/100');function setLyr(v,dw,p){if(!setLyr.seq)setLyr.seq=0;if(!dw)dw=0;var o=!p?isNS4?self:document.body:!isNS4&&p.navigator?p.document.body:p,IA='insertAdjacentHTML',AC='appendChild',id='_sl_'+setLyr.seq++;if(o[IA])o[IA]('beforeEnd','<div id="'+id+'" style="position:absolute"></div>');else if(o[AC]){var n=document.createElement('div');o[AC](n);n.id=id;n.style.position='absolute';}else if(isNS4){var n=new Layer(dw,o);id=n.id;}var l=getLyr(id,p);with(l)if(ref){vis(v);x(0);y(0);sty.width=dw+(isNS4?0:'px')}return l;};if(!window.page)var page={win:window,minW:0,minH:0,MS:isIE&&!isOp,db:document.compatMode&&document.compatMode.indexOf('CSS')>-1?'documentElement':'body'};page.winW=function(){with(this)return Math.max(minW,MS?win.document[db].clientWidth:win.innerWidth)};page.winH=function(){with(this)return Math.max(minH,MS?win.document[db].clientHeight:win.innerHeight)};page.scrollX=function(){with(this)return MS?win.document[db].scrollLeft:win.pageXOffset};page.scrollY=function(){with(this)return MS?win.document[db].scrollTop:win.pageYOffset};function addProps(obj,data,names,addNull){for(var i=0;i<names.length;i++)if(i<data.length||addNull)obj[names[i]]=data[i];};function PopupMenu(myName){this.myName=myName;this.showTimer=this.hideTimer=this.showDelay=0;this.hideDelay=500;this.menu=[];this.litNow=[];this.litOld=[];this.overM='';this.overI=0;this.hideDocClick=0;this.actMenu=null;PopupMenu.list[myName]=this;};PopupMenu.list=[];var PmPt=PopupMenu.prototype;PmPt.callEvt=function(mN,iN,evt){var i=this.menu[mN][iN],r=this[evt]?(this[evt](mN,iN)==false):0;if(i[evt]){if(i[evt].substr)i[evt]=new Function('mN','iN',i[evt]);r|=(i[evt](mN,iN)==false);}return r;};PmPt.over=function(mN,iN){with(this){clearTimeout(hideTimer);overM=mN;overI=iN;var cancel=iN?callEvt(mN,iN,'onmouseover'):0;litOld=litNow;litNow=[];var litM=mN,litI=iN;if(mN)do{litNow[litM]=litI;litI=menu[litM][0].parentItem;litM=menu[litM][0].parentMenu;}while(litM);var same=1;for(var z in menu)same&=(litNow[z]==litOld[z]);if(same)return 1;clearTimeout(showTimer);for(var thisM in menu)with(menu[thisM][0]){if(!lyr)continue;lI=litNow[thisM];oI=litOld[thisM];if(lI!=oI){if(lI)changeCol(thisM,lI);if(oI)changeCol(thisM,oI);}if(!lI)clickDone=0;if(isRoot)continue;if(lI&&!visNow)doVis(thisM,true);if(!lI&&visNow)doVis(thisM,false);}nextMenu='';if(!cancel&&menu[mN]&&menu[mN][iN].type=='sm:'){var m=menu[mN],targ=m[iN].href;if(!menu[targ])return 0;if(m[0].clickSubs&&!m[0].clickDone)return 0;nextMenu=targ;if(showDelay)showTimer=setTimeout(myName+'.doVis("'+targ+'",true)',showDelay);else doVis(targ,true);}return 1;}};PmPt.out=function(mN,iN){with(this){if(mN!=overM||iN!=overI)return;var thisI=menu[mN][iN],cancel=callEvt(mN,iN,'onmouseout');if(thisI.href!=nextMenu){clearTimeout(showTimer);nextMenu='';}if(hideDelay&&!cancel){var delay=(menu[mN][0].isRoot&&(thisI.type!='sm:'))?50:hideDelay;hideTimer=setTimeout(myName+'.over("",0)',delay);}overM='';overI=0;}};PmPt.click=function(mN,iN){with(this){var m=menu[mN];if(callEvt(mN,iN,'onclick'))return 0;with(m[iN])S:switch(type){case 'sm:':{if(m[0].clickSubs){m[0].clickDone=1;doVis(href,true);return 1;}break S;}case 'js:':{eval(href);break S}case '':type='window';default:if(href)eval(type+'.location.href="'+href+'"');}return over('',0);}};PmPt.changeCol=function(mN,iN,fc){with(this.menu[mN][iN]){if(!lyr||!lyr.ref)return;var bgFn=outCol!=overCol?(outCol.indexOf('.')==-1?'bgColor':'bgImage'):0;var ovr=(this.litNow[mN]==iN)?1:0,doFX=(!fc&&this.litNow[mN]!=this.litOld[mN]);var col=ovr?overCol:outCol;if(fade[0]){clearTimeout(timer);col='#';count=Math.max(0,Math.min(count+(2*ovr-1)*parseInt(fade[ovr][0]),100));var oc,nc,hexD='0123456789ABCDEF';for(var i=1;i<4;i++){oc=parseInt('0x'+fade[0][i]);nc=parseInt(oc+(parseInt('0x'+fade[1][i])-oc)*(count/100));col+=hexD.charAt(Math.floor(nc/16)).toString()+hexD.charAt(nc%16);}if(count%100>0)timer=setTimeout(this.myName+'.changeCol("'+mN+'",'+iN+',1)',50);}if(bgFn&&isNS4)lyr[bgFn](col);var reCSS=(overClass!=outClass||outBorder!=overBorder);if(doFX)with(lyr){if(!this.noRW&&(overText||overInd||isNS4&&reCSS))write(this.getHTML(mN,iN,ovr));if(!isNS4&&reCSS){ref.className=(ovr?overBorder:outBorder);var chl=(isDOM?ref.childNodes:ref.children);if(chl&&!overText)for(var i=0;i<chl.length;i++)chl[i].className=ovr?overClass:outClass;}}if(bgFn&&!isNS4)lyr[bgFn](col);if(doFX&&outAlpha!=overAlpha)lyr.alpha(ovr?overAlpha:outAlpha);}};PmPt.position=function(posMN){with(this){for(mN in menu)if(!posMN||posMN==mN)with(menu[mN][0]){if(!lyr||!lyr.ref||!visNow)continue;var pM,pI,newX=eval(offX),newY=eval(offY);if(!isRoot){pM=menu[parentMenu];pI=pM[parentItem].lyr;if(!pI)continue;}var eP=eval(par),pW=(eP&&eP.navigator?eP:window);with(pW.page)var sX=scrollX(),wX=sX+winW(),sY=scrollY(),wY=winH()+sY;wX=isNaN(wX)||!wX?9999:wX;wY=isNaN(wY)||!wY?9999:wY;var sb=page.MS?5:20;if(pM&&typeof(offX)=='number')newX=Math.max(sX,Math.min(newX+pM[0].lyr.x()+pI.x(),wX-menuW-sb));if(pM&&typeof(offY)=='number')newY=Math.max(sY,Math.min(newY+pM[0].lyr.y()+pI.y(),wY-menuH-sb));lyr.x(newX);lyr.y(newY);}}};PmPt.doVis=function(mN,show){with(this){var m=menu[mN],mA=(show?'show':'hide')+'Menu';if(!m)return;m[0].visNow=show;if(show)position(mN);if(this[mA])this[mA](mN);else m[0].lyr.vis(show?'visible':'hidden');}};function ItemStyle(){var names=['len','spacing','popInd','popPos','pad','outCol','overCol','outClass','overClass','outBorder','overBorder','outAlpha','overAlpha','normCursor','nullCursor'];addProps(this,arguments,names,true);};PmPt.startMenu=function(mName){with(this){if(!menu[mName]){menu[mName]=new Array();menu[mName][0]=new Object();}actMenu=menu[mName];aM=actMenu[0];actMenu.length=1;var names=['name','isVert','offX','offY','width','itemSty','par','clickSubs','clickDone','visNow','parentMenu','parentItem','oncreate','isRoot'];addProps(aM,arguments,names,true);aM.extraHTML='';aM.menuW=aM.menuH=0;if(!aM.lyr)aM.lyr=null;if(mName.substring(0,4)=='root'){aM.isRoot=true;aM.oncreate=new Function('this.visNow=true;'+myName+'.position("'+mName+'");this.lyr.vis("visible")');}return aM;}};PmPt.addItem=function(){with(this)with(actMenu[0]){var aI=actMenu[actMenu.length]=new Object();var names=['text','href','type','itemSty','len','spacing','popInd','popPos','pad','outCol','overCol','outClass','overClass','outBorder','overBorder','outAlpha','overAlpha','normCursor','nullCursor','iX','iY','iW','iH','overText','overInd','lyr','onclick','onmouseover','onmouseout'];addProps(aI,arguments,names,true);var iSty=(arguments[3]?arguments[3]:actMenu[0].itemSty);for(prop in iSty)if(aI[prop]+''=='undefined')aI[prop]=iSty[prop];var r=RegExp,re=/^SWAP:(.*)\^(.*)$/;if(aI.text.match(re)){aI.text=r.$1;aI.overText=r.$2}if(aI.popInd.match(re)){aI.popInd=r.$1;aI.overInd=r.$2}aI.timer=aI.count=0;aI.fade=[];for(var i=0;i<2;i++){var oC=i?'overCol':'outCol';if(aI[oC].match(/^(\d+)\#(..)(..)(..)$/)){aI[oC]='#'+r.$2+r.$3+r.$4;aI.fade[i]=[r.$1,r.$2,r.$3,r.$4];}}if(aI.outBorder&&isNS4)aI.pad++;aI.iW=(isVert?width:aI.len);aI.iH=(isVert?aI.len:width);var lastGap=(actMenu.length>2)?actMenu[actMenu.length-2].spacing:0;var spc=((actMenu.length>2)&&aI.outBorder?1:0);if(isVert){menuH+=lastGap-spc;aI.iX=0;aI.iY=menuH;menuW=width;menuH+=aI.iH;}else{menuW+=lastGap-spc;aI.iX=menuW;aI.iY=0;menuW+=aI.iW;menuH=width;}if(aI.outBorder&&(page.db=='documentElement'||isOp&&!document.compatMode||document.doctype&&document.doctype.name.indexOf('.dtd')>-1||isDOM&&!isIE)){aI.iW-=2;aI.iH-=2;}return aI;}};PmPt.getHTML=function(mN,iN,isOver){with(this){var itemStr='';with(menu[mN][iN]){var textClass=(isOver?overClass:outClass),txt=(isOver&&overText?overText:text),popI=(isOver&&overInd?overInd:popInd);if((type=='sm:')&&popI){if(isNS4)itemStr+='<layer class="'+textClass+'" left="'+((popPos+iW)%iW)+'" top="'+pad+'" height="'+(iH-2*pad)+'">'+popI+'</layer>';else itemStr+='<div class="'+textClass+'" style="position:absolute;left:'+((popPos+iW)%iW)+'px;top:'+pad+'px;height:'+(iH-2*pad)+'px">'+popI+'</div>';}if(isNS4)itemStr+=(outBorder?'<span class="'+(isOver?overBorder:outBorder)+'"><spacer type="block" width="'+(iW-8)+'" height="'+(iH-8)+'"></span>':'')+'<layer left="'+pad+'" top="'+pad+'" width="'+(iW-2*pad)+'" height="'+(iH-2*pad)+'"><a class="'+textClass+'" href="#" '+'onClick="return false" onMouseOver="status=\'\';'+myName+'.over(\''+mN+'\','+iN+');return true">'+txt+'</a></layer>';else itemStr+='<div class="'+textClass+'" style="position:absolute;left:'+pad+'px;top:'+pad+'px;width:'+(iW-2*pad)+'px;height:'+(iH-2*pad)+'px">'+txt+'</div>';}return itemStr;}};PmPt.update=function(docWrite,upMN){with(this){if(!isDyn)return;for(mN in menu)with(menu[mN][0]){if(upMN&&(upMN!=mN))continue;var str='';for(var iN=1;iN<menu[mN].length;iN++)with(menu[mN][iN]){var itemID=myName+'_'+mN+'_'+iN;var targM=menu[href];if(targM&&(type=='sm:')){targM[0].parentMenu=mN;targM[0].parentItem=iN;}var isImg=(outCol.indexOf('.')!=-1)?true:false;if(!isIE){if(normCursor=='hand')normCursor='pointer';if(nullCursor=='hand')nullCursor='pointer';}if(isDOM||isIE4){str+='<div id="'+itemID+'" '+(outBorder?'class="'+outBorder+'" ':'')+'style="position:absolute;left:'+iX+'px;top:'+iY+'px;width:'+iW+'px;height:'+iH+'px;z-index:1000;'+(outCol?'background:'+(isImg?'url('+outCol+')':outCol):'')+((typeof(outAlpha)=='number')?';filter:alpha(opacity='+outAlpha+');-moz-opacity:'+(outAlpha/100):'')+';cursor:'+((type!='sm:'&&href)?normCursor:nullCursor)+'" ';}else if(isNS4){str+='<layer id="'+itemID+'" left="'+iX+'" top="'+iY+'" width="'+iW+'" height="'+iH+'" z-index="1000" '+(outCol?(isImg?'background="':'bgcolor="')+outCol+'" ':'');}var evtMN='(\''+mN+'\','+iN+')"';str+='onMouseOver="'+myName+'.over'+evtMN+' onMouseOut="'+myName+'.out'+evtMN+' onClick="'+myName+'.click'+evtMN+'>'+getHTML(mN,iN,false)+(isNS4?'</layer>':'</div>');}var eP=eval(par);var sR=myName+'.setupRef('+(docWrite?1:0)+',"'+mN+'")';if(isOp)setTimeout(sR,1000);var mVis=(isOp&&isRoot)?'visible':'hidden';if(docWrite){var targFr=(eP&&eP.navigator?eP:window);targFr.document.write('<div id="'+myName+'_'+mN+'_Div" style="position:absolute;'+'visibility:'+mVis+';left:-1000px;top:0px;width:'+(menuW+2)+'px;height:'+(menuH+2)+'px;z-index:1000">'+str+extraHTML+'</div>');}else{if(!lyr||!lyr.ref)lyr=setLyr(mVis,menuW,eP);else if(isIE4)setTimeout(myName+'.menu.'+mN+'[0].lyr.sty.width='+(menuW+2),50);with(lyr){sty.zIndex=1000;write(str+extraHTML)}}if(!isOp)setTimeout(sR,100);}}};PmPt.setupRef=function(docWrite,mN){with(this)with(menu[mN][0]){if(docWrite||!lyr||!lyr.ref)lyr=getLyr(myName+'_'+mN+'_Div',eval(par));for(var i=1;i<menu[mN].length;i++)menu[mN][i].lyr=getLyr(myName+'_'+mN+'_'+i,(isNS4?lyr.ref:eval(par)));menu[mN][0].lyr.clip(0,0,menuW+2,menuH+2);if(menu[mN][0].oncreate)oncreate();}};

// FUNCTIONS CALLED BY THE EFFECTS SECTION: Can be deleted if you're not using them.
// Alternatively, if you're using several menu data files, you may want to move them to the
// "core" script file.


// This is the "positioning from page anchors" code used by the advanced positioning expressions.
page.elmPos=function(e,p)
{
 var x=0,y=0,w=p?p:this.win;
 e=e?(e.substr?(isNS4?w.document.anchors[e]:getRef(e,w)):e):p;
 if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.pageX;y+=p.pageY}}
 else if (e && e.focus && e.href && this.MS && /Mac/.test(navigator.platform))
 {
  e.onfocus = new Function('with(event){self.tmpX=clientX-offsetX;' +
   'self.tmpY=clientY-offsetY}');
  e.focus();x=tmpX;y=tmpY;e.blur()
 }
 else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent}
 return{x:x,y:y};
};



// Animation:
//
// Each menu object you create by default shows and hides its menus instantaneously.
// However you can override this behaviour with custom show/hide animation routines,
// as we have done in the "Menu Effects" section. Feel free to edit this, or delete
// this entire function if you're not using it. Basically, make functions to handle
// menuObj.showAnim() and .hideAnim(), both of which are passed menu names.
//
// Customisers: My lyr.clip() command gets passed the parameters (x1, y1, x2, y2)
// so you might want to adjust the direction etc. Oh, and I'm adding 2 to the dimensions
// to be safe due to different box models in some browsers.
// Another idea: add some if/thens to test for specific menu names...?

function menuAnim(menuObj, menuName, dir)
{
 // The array index of the named menu (e.g. 'mFile') in the menu object (e.g. 'pMenu').
 var mD = menuObj.menu[menuName][0];
 // Add timer and counter variables to the menu data structure, we'll need them.
 if (!mD.timer) mD.timer = 0;
 if (!mD.counter) mD.counter = 0;

 with (mD)
 {
  // Stop any existing animation.
  clearTimeout(timer);

  // If the litNow() array doesn't show this menu as lit, and we're still showing it,
  // force a quick hide (this stops miscellaneous timer errors).
  //if (dir>0 && !menuObj.litNow[menuObj.menu[menuName][0].parentMenu]) dir = -100;

  // If the layer doesn't exist (cross-frame navigation) quit.
  if (!lyr || !lyr.ref) return;
  // This next line is not strictly necessary, but it stops the one-in-a-hundred menu that
  // shows and doesn't hide on very quick mouseovers.
  if (!visNow && dir>0) dir = 0-dir;
  // Show the menu if that's what we're doing.
  if (dir>0) lyr.vis('visible');
  // Also raise showing layers above hiding ones.
  lyr.sty.zIndex = 1001 + dir;

  // Alpha fade in IE5.5+. Mozilla's opacity isn't well suited to this as it's an inheritable
  // property rather than a block-level filter, and it's slow, but uncomment and try it perhaps.
  // WARNING: This looks funny if you're mixing opaque and translucent items e.g. solid menus
  // with dropshadows. If you're going to use it, either disable dropshadows or set the opacity
  // values for your items to numbers instead of null.
  //if (isIE && window.createPopup) lyr.alpha(counter&&(counter<100) ? counter : null);

  // Clip the visible area. Tweak this if you want to change direction/acceleration etc.
  // As you can see, the visibile clipping region is from (0, 0) which is the top left corner,
  // to the right edge of the menu 'menuW+2', and a complicated formula that sets the bottom
  // edge of the clipping region based on the 'counter' variable so it accelerates.
  lyr.clip(0, 0, menuW+2, (menuH+2)*Math.pow(Math.sin(Math.PI*counter/200),0.75) );

  // Increment the counter and if it hasn't reached the end (counter is 0% or 100%),
  // set the timer to call the showMenu/hideMenu function again in 40ms to contine the animation.
  // Note that we hide the menu div on animation end in that direction.
  counter += dir;
  if (counter>100) counter = 100;
  else if (counter<0) { counter = 0; lyr.vis('hidden') }
  else timer = setTimeout(menuObj.myName+'.'+(dir>0?'show':'hide')+'Menu("'+menuName+'")', 40);
 }
};



// Here's the alternative IE5.5+ filter animation function, which is unused by default.
function menuFilterShow(menuObj, menuName, filterName)
{
 var mD = menuObj.menu[menuName][0];
 with (mD.lyr)
 {
  sty.filter = filterName;
  var f = ref.filters, doF = (f&&f.length&&f[0]);
  if (doF) f[0].Apply();
  vis('visible');
  if (doF) f[0].Play();
 }
};



// Borders and Dropshadows:
//
// Here's the menu border and dropshadow functions we call above. Edit ot delete if you're
// not using them. Basically, they assign a string to pMenu.menu.menuName[0].extraHTML, which
// is written to the document with the menus as they are created -- the string can contain
// anything you want, really. They also adjust the menu dimensions and item positions
// to suit. Dig out the Object Browser script and open up "pMenu" for more info.

function addMenuBorder(mObj, iS, alpha, bordCol, bordW, backCol, backW)
{
 // Loop through the menu array of that object, finding matching ItemStyles.
 for (var mN in mObj.menu)
 {
  var mR=mObj.menu[mN], dS='<div style="position:absolute; background:';
  if (mR[0].itemSty != iS) continue;
  // Loop through the items in that menu, move them down and to the right a bit.
  for (var mI=1; mI<mR.length; mI++)
  {
   mR[mI].iX += bordW+backW;
   mR[mI].iY += bordW+backW;
  }
  // Extend the total dimensions of menu accordingly.
  mW = mR[0].menuW += 2*(bordW+backW);
  mH = mR[0].menuH += 2*(bordW+backW);

  // Set the menu's extra content string with divs/layers underneath the items.
  if (isNS4) mR[0].extraHTML += '<layer bgcolor="'+bordCol+'" left="0" top="0" width="'+mW+
   '" height="'+mH+'" z-index="980"><layer bgcolor="'+backCol+'" left="'+bordW+'" top="'+
   bordW+'" width="'+(mW-2*bordW)+'" height="'+(mH-2*bordW)+'" z-index="990"></layer></layer>';
  else mR[0].extraHTML += dS+bordCol+'; left:0px; top:0px; width:'+mW+'px; height:'+mH+
   'px; z-index:980; '+(alpha!=null?'filter:alpha(opacity='+alpha+'); -moz-opacity:'+(alpha/100):'')+
   '">'+dS+backCol+'; left:'+bordW+'px; top:'+bordW+'px; width:'+(mW-2*bordW)+'px; height:'+
   (mH-2*bordW)+'px; z-index:990"></div></div>';
 }
};

function addDropShadow(mObj, iS)
{
 // Pretty similar to the one above, just loops through list of extra parameters making
 // dropshadow layers (from arrays) and extending the menu dimensions to suit.
 for (var mN in mObj.menu)
 {
  var a=arguments, mD=mObj.menu[mN][0], addW=addH=0;
  if (mD.itemSty != iS) continue;
  for (var shad=2; shad<a.length; shad++)
  {
   var s = a[shad];
   if (isNS4) mD.extraHTML += '<layer bgcolor="'+s[1]+'" left="'+s[2]+'" top="'+s[3]+'" width="'+
    (mD.menuW+s[4])+'" height="'+(mD.menuH+s[5])+'" z-index="'+(arguments.length-shad)+'"></layer>';
   else mD.extraHTML += '<div style="position:absolute; background:'+s[1]+'; left:'+s[2]+
    'px; top:'+s[3]+'px; width:'+(mD.menuW+s[4])+'px; height:'+(mD.menuH+s[5])+'px; z-index:'+
    (a.length-shad)+'; '+(s[0]!=null?'filter:alpha(opacity='+s[0]+'); -moz-opacity:'+(s[0]/100):'')+
    '"></div>';
   addW=Math.max(addW, s[2]+s[4]);
   addH=Math.max(addH, s[3]+s[5]);
  }
  mD.menuW+=addW; mD.menuH+=addH;
 }
};

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
};

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
};

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
};

function rowCols(ref, col, stat)
{
 var tds = ref.children?ref.children:(ref.childNodes?ref.childNodes:null);
 if (tds) for (var td = 0; td < tds.length; td++)
 if (tds[td].style && tds[td].tagName.toLowerCase()=='td') with (tds[td].style)
 {
  backgroundColor = col;
  cursor = document.all?'hand':'pointer';
 }
 return window.status = stat&&ref.getAttribute ? ref.getAttribute('title') : '';
};

function rowCols2(ref, col, stat)
{
 var tds = ref.children?ref.children:(ref.childNodes?ref.childNodes:null);
 if (tds) for (var td = 1; td < tds.length; td++)
 if (tds[td].style && tds[td].tagName.toLowerCase()=='td') with (tds[td].style)
 {
  backgroundColor = col;
  cursor = document.all?'hand':'pointer';
 }
 return window.status = stat&&ref.getAttribute ? ref.getAttribute('title') : '';
};

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
};

function displayMsg(form, x){
alert(document.all[form][x].checked);
};

function onOptions(formName,toFieldName,fromFieldName){
	var deptIndex = document[formName][fromFieldName].selectedIndex;
  	if (deptIndex>0){
  		selectedArea = document[formName][fromFieldName];
  	}
  	for (j=1;j<selectedArea.length;j++){
   		var noError = true;
   		if (selectedArea.options[j].selected){
    			selectedText = selectedArea.options[j].text;
    			selectedValue = selectedArea.options[j].value;
    			for (i=1;i<document[formName][toFieldName].length;i++){
    				if (document[formName][toFieldName].options[i].value ==selectedValue){ //duplication
      					alert("Duplication: " + selectedText);
      					noError = false;
     				}
    			}
    			if (noError){
     				var len = document[formName][toFieldName].length;
     				document[formName][toFieldName].options[len] = new Option(selectedText,selectedValue);
    			}
   		}
  	}
};

function offOptions(formName,fieldName){
  	for (i=1;i<document[formName][fieldName].length; i++){
   		if (document[formName][fieldName].options[i].selected){
   			document[formName][fieldName].options[i] = null;
    			i--;
   		}
   	}
};

var fieldNames = new Array();

function selectOptions(formName,fieldNames){
	var temp;
	for (k=0;k<fieldNames.length;k++){
   		document[formName][fieldNames[0]].options[0].selected = false;
   		for (i=1;i<document[formName][fieldNames[k]].length; i++){
    			if (document[formName][fieldNames[k]].options[i].value){
     				document[formName][fieldNames[k]].options[i].selected = true;
    				temp[k].value = document[formName][FieldNames[k]].options[i].value; 
    				temp[k].text = document[formName][FieldNames[k]].options[i].text;
    			}   
    		}
  	}
 	document.formName.tempvar.value = toString(temp);
 };
 