// Title: COOLjsMenuPRO
// URL: http://javascript.cooldev.com/scripts/coolmenupro/
// Version: 2.1.4
// Last Modify: 25 Mar 2004
// Author: Sergey Nosenko <darknos@cooldev.com>
// Notes: Registration needed to use this script on your web site.
// Copyright (c) 2001-2002 by CoolDev.Com
// Copyright (c) 2001-2002 by Sergey Nosenko
// BLANK_IMAGE altered by Magnus Karlsson on 2006-05-10. Default is img/b.gif
window.CMenus=[];var BLANK_IMAGE="images/menu_blank.gif";function _n(){this.ver=navigator.appVersion;this.agent=navigator.userAgent;this.dom=document.getElementById;this.opera=window.opera;this.ie55=this.ver.indexOf("MSIE 5.5")> -1&&this.dom&&!this.opera;this.ie5=this.ver.indexOf("MSIE 5")> -1&&this.dom&&!this.ie55&&!this.opera;this.ie6=this.ver.indexOf("MSIE 6")> -1&&this.dom&&!this.opera;this.ie4=document.all&&!this.dom&&!this.opera;this.ns6=this.dom&&parseInt(this.ver)>=5;this.hotjava=this.agent.toLowerCase().indexOf('hotjava')!=-1;this.ns4=document.layers&&!this.dom&&!this.hotjava;this.bw=this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera;this.opera7=this.agent.toLowerCase().indexOf('opera 7')> -1||this.agent.toLowerCase().indexOf('opera/7')> -1;this.operaOld=this.opera&&!this.opera7};function nn(val){return val!=null};function und(val){return typeof(val)=='undefined'};function COOLjsMenuPRO(_1,items){this.bi=new Image();this.bi.src=BLANK_IMAGE;if(this.bw.ns4)window.onresize=resizeHandler;window.CMenus[this.name=_1]=this;this._a='window.CMenus.'+_1;this._o=items[0].pos=='relative';this._z=items[0].popup;this.root={par:null,cd:[],pos:this._o?[0,0]:items[0].pos||[0,0],fmt:items[0],frameoff:items[0].pos?items[0].pos:[0,0],index:0};this.root.lvl=new _r(this,this.root);this.root.fmt.pos=this.root.pos;this.items=[];this._V(items,this.root);this._j=[];this._C=null;this._d=null};$=COOLjsMenuPRO.prototype;$.bw=new _n();$._V=function(_g,_9){var _W;for(var i=1;i<_g.length;i++)if(!und(_g[i]))_W=new _F(this,_9,_g[i],_g[i].format||_g[0],_W)};$.get_div=function(_1){return this.bw.ns4?document.layers[_1]:document.getElementById?document.getElementById(_1):document.all[_1]};if($.bw.ns4)$._3=function(_k,_l){if(_k)_k.visibility=_l?'show':'hide'};else $._3=function(_k,_l){if(_k)_k.style.visibility=_l?'visible':'hidden'};$.drawTop=function(){var s='';for(var i in this.root.cd)s+=this.root.cd[i]._$();if(this._o){var w=0,h=0;for(var i in this.root.cd)with(this.root.cd[i]){h=Math.max(h,pos[1]+size[0]);w=Math.max(w,pos[0]+size[1])};s='<div id="cm'+this.name+'_i" style="position:relative;left:0px;top:0px;width:'+w+'px;height:'+h+'px;">'+s+'</div>'};return s};$.drawOther=function(){var s='';for(var i in this.items){if(!this.items[i]._5)s+=this.items[i]._$();if(this.items[i].lvl)s+=this.items[i].lvl._Y};s+=this.root.lvl._Y;return s};$.initTop=function(){document.write('<div id="'+this.name+'dummy" style="left: 0; top: 0;"></div>'+this.drawTop()+this.drawOther())};$.init=function(){};$.hide=function(){this.showLevel(this.root.lvl);if(this._z||this.root.fmt.hidden_top)this.root.lvl.vis(0)};$.mpopup=function(ev,offX,offY){var x=ev.pageX?ev.pageX:(this.bw.opera?ev.clientX:this.bw.ie4?ev.clientX+document.body.scrollLeft:ev.x+document.body.scrollLeft);var y=ev.pageY?ev.pageY:(this.bw.opera?ev.clientY:this.bw.ie4?ev.clientY+document.body.scrollTop:ev.y+document.body.scrollTop);var po=this.root.fmt.popupoff;y+=offY?offY:po?po[0]:0;x+=offX?offX:po?po[1]:0;this.popup(x,y)};$.popup=function(_6,_8){this.root.loff=[0,0];this.root.ioff=[0,0];this._Z(_6,_8,true);this.showLevel(this.root.lvl);this.showLevel(null,2400)};$.show=function(){this.move();this.showLevel(this.root.lvl)};$.move=function(){if(this._o)this._Z(this._R('X'),this._R('Y'))};$._Z=function(_6,_8,_13){if(this.root.pos[0]!=_6||this.root.pos[1]!=_8){this.root.pos=[_6,_8];for(var i in this.items){this.items[i]._O();if(_13||!this.items[i]._5)this.items[i].move()}}};$._R=function(_J){this._q=this._q||this.get_div('cm'+this.name+'_i');if(this.bw.ns4)return this._q['page'+_J];var _E=0,_m=this._q;while(_m&&_m!=document.body){_E+=_m['offset'+(_J=='X'?'Left':'Top')];_m=_m.offsetParent};return _E};$._S=function(_0,_c){while(_0!=this.root&&_0){if(_0.par.lvl&&_0.par.lvl.v)_0.setVis(_c);_0=_0.par}};$.__=function(_14,_N,_f){this._j[this._j.length]=window.setTimeout(this._a+'.'+_14+'('+(_N?_N._a:'null')+')',_f)};$.cancelQueued=function(){for(var i in this._j)window.clearTimeout(this._j[i]);this._j=[]};$.setActiveItem=function(_0,_f){if(_f){this.__('setActiveItem',_0,_f);return};this._S(this._C,'n');this._C=_0;this._S(this._C,'o')};$.showLevel=function(_G,_f){if(_f){this.__('showLevel',_G,_f);return};var h=this._d?this._d.getPath(): [];this._d=_G;var s=this._d?this._d.getPath(): [];var i=0,j;while(i<s.length&&i<h.length&&s[i]==h[i])i++;for(j=i;j<h.length;j++)h[j].vis(0);if(!s.length&&!this._z&&!this.root.fmt.hidden_top){s[0]=this.root.lvl;this.setActiveItem(null)};for(j=i;j<s.length;j++)s[j].vis(1)};$.onmouseover=function(_0){this.cancelQueued();this.setActiveItem(_0);if(_0.lvl)this.showLevel(_0.lvl,400);return true};$.onclick=function(_0){this.cancelQueued();this.showLevel(_0.lvl&&_0.lvl.v?_0.lvl.par.par.lvl:_0.lvl);return true};$.onmouseout=function(_0){this.cancelQueued();this.showLevel(null,this.root.fmt.delay||600);return true};function _r(_2,_9){this.menu=_2;this.par=_9;this.v=0;this._5=_9==_2.root;this._v=!_2._z&&this._5;this._Y=(_2.bw.ie55||_2.bw.ie6)&&!this._v?"<iframe frameborder=0 id=ifr"+this.menu.name+"_i"+this.par.index+" src=\""+(location.protocol=="https:" ? this.menu.root.fmt.https_fix_blank_doc : '')+"\" scroll=none style=\"FILTER:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);visibility:hidden;height:1;position:absolute;width:1px;left:0px;top:0px;z-index:1\"></iframe>":'';this._a=this.par._a+'.lvl'};$=_r.prototype;$.getPath=function(){return(this.par.par?this.par.par.lvl.getPath(): []).concat([this])};$.menu_rect=function(){var r=[65535,65535,0,0];for(i in this.par.cd){var itm=this.par.cd[i];if(itm._5||itm.v){var s=itm._h;var slt=s<0?-s:0;var srt=s>0?s:0;r[0]=Math.min(r[0],itm.pos[0]-slt);r[1]=Math.min(r[1],itm.pos[1]-slt);r[2]=Math.max(r[2],itm.size[1]+itm.pos[0]+srt);r[3]=Math.max(r[3],itm.size[0]+itm.pos[1]+srt)}};return r};$._1a=function(_u){return this.menu.bw.ns4?document.layers[_u]:document.getElementById?document.getElementById(_u):document.all[_u]};$.vis=function(s){if(s&&!this._5)this.menu.move();var ss=this.v;this.v=s;if(this.menu.onlevelshow)this.menu.onlevelshow(this);for(var i in this.par.cd)this.par.cd[i].vis(s);if(s!=ss&&this.menu.onlevelshow)this.menu.onlevelshow(this);if((this.menu.bw.ie55||this.menu.bw.ie6)&&!this._v){this._x=this._x||this.menu.get_div("ifr"+this.menu.name+"_i"+this.par.index);if(s){var r=this.menu_rect();with(this._x.style){left=r[0];top=r[1];width=Math.abs(r[0]-r[2]);height=Math.abs(r[1]-r[3])}};this.menu._3(this._x,s)}else{var _s=this.menu.root.fmt.forms_to_hide;if(!this._v&&_s)for(var i in _s)this.menu._3(this._1a(_s[i]),!this.menu._d||this.menu._d==this.menu.root.lvl)}};function _F(_2,_9,_7,_17,_12){this.par=_9;this.code=_7.code;this.ocode=_7.ocode||_7.code;this.targ=und(_7.target)?'':'target="'+_7.target+'" ';this.url=_7.url||'javascript:void(0)';this.fmt=_17;this.menu=_2;this.index=_2.items.length;_2.items[this.index]=this;this._a=_2._a+'.items['+this.index+']';this._5=_2.root==_9;this.cd=[];this.divs=[];_9.cd[_9.cd.length]=this;this.id="cmi"+this.menu.name+"_i"+this.index;this.v=0;this.state='n';this.ioff=this.getf(this,"itemoff");this.loff=this.getf(this,"leveloff");this.imgsize=this.getf(this,"imgsize");this.arrsize=this.getf(this,"arrsize");this.image=this.getf(this,"image");this.oimage=this.getf(this,"oimage")||this.image;this.arrow=this.getf(this,"arrow");this.oarrow=this.getf(this,"oarrow")||this.arrow;this.style=this.getf(this,"style");this.size=this.getf(this,"size");if(this._5)this.fmt.pos=this.getf(this,"pos");this.prev=_12;this.z=this._5?10:this.par.z+1;var b=this.style.border;b=(b&&this.style.borders)||[b,b,b,b];this._H=b[0];this._I=b[1];this._X=b[0]+b[2];this._K=b[1]+b[3];this._h=this.style.shadow;this._O();if(_7.sub&&_7.sub.length){this.sub=_7.sub;this.lvl=new _r(_2,this);this.menu._V(_7.sub,this)}};$=_F.prototype;$.bw=new _n();$.div=function(n){return this.divs[n]||(this.divs[n]=this.get_div(this.id+n))};$._U=function(_T,_D,_15){return'<td'+(_T?' bgcolor="'+_T+'"':'')+' width="'+_D[1]+'"><img src="'+_15+'" width="'+_D[1]+'" height="'+_D[0]+'" /></td>'};$._Q=function(_c){return'<table cellpadding=0 cellspacing=0 width='+(this.size[1]-this._X)+'" height="'+(this.size[0]-this._K)+'" border=0><tr>'+(nn(this.image)?this._U(this.style.color[_c=='n'?'imagebg':'oimagebg'],this.imgsize,_c=='n'?this.image:this.oimage):'')+'<td width="100%"><div class="'+this.style.css[_c=='n'?'ON':'OVER']+'">'+(_c=='n'?this.code:this.ocode)+'</div></td>'+(nn(this.arrow)&&this.cd.length?this._U('',this.arrsize,_c=='n'?this.arrow:this.oarrow):'')+'</tr></table>'};$._$=function(){var s=this._h;return(s?this._w('s',s,s,0,0,'shadow',''):'')+ (this.style.border?this._w('b',0,0,0,0,'border',''):'')+this._B('n','bgON',this._Q('n'))+this._B('o','bgOVER',this._Q('o'))+this._B('e','','<a href="'+this.url+'" '+this.targ+this._y('onclick')+this._y('onmouseover')+this._y('onmouseout')+'><img src="'+this.menu.bi.src+'" width="'+this.size[1]+'" height="'+this.size[0]+'" border="0"></a>')};$._y=function(_L){return' '+_L+'="return '+this.menu._a+'.'+_L+'('+this._a+')"'};$._B=function(_t,_p,_A){return this._w(_t,this._H,this._I,this._X,this._K,_p,_A)};$._w=function(_t,_18,_10,_16,_19,_p,_A){var _M=this.size[1]-_16,_P=this.size[0]-_19;return'<div id="'+this.id+_t+'" style="position:absolute;clip:rect(0px '+_M+'px '+_P+'px 0px);z-index:'+this.z+';left:'+(this.pos[0]+_18)+'px;top:'+(this.pos[1]+_10)+'px;width:'+_M+'px;height:'+_P+'px;visibility:hidden'+(_p?';'+(this.menu.bw.ns4?'layer-':'')+'background-color:'+this.style.color[_p]:'')+'">'+_A+'</div>'};$.vis=function(s){if(!s)this.state="n";this._3("s",s);this._3("b",s);this._3("o",0);this._3("n",s);this._3("e",s);this.v=s};$.setVis=function(n){if(this.state!=n){this._3("n",n=="n");this._3("o",n=="o");this.state=n}};$._3=function(_11,_l){this.menu._3(this.div(_11),_l)};$.getf=function(_4,_1){if(!und(_4)&&nn(_4)&&!und(_4.fmt)){if(!und(_4.fmt[_1]))return _4.fmt[_1];if(!_4._5&&_4.par&&_4.par.sub&&_4.par.sub[0][_1])return _4.par.sub[0][_1];return this.getf(_4.par,_1)}};$._O=function(){if(this.prev)this.pos=[this.prev.pos[0]+this.ioff[1],this.prev.pos[1]+this.ioff[0]];else if(!this._5)this.pos=[this.par.pos[0]+this.loff[1],this.par.pos[1]+this.loff[0]];else this.pos=this.menu.root.pos};$.get_div=function(_1){if(this.bw.ns4)return(this.menu._o&&this._5)?document.layers["cm"+this.menu.name+"_i"].layers[_1]:document.layers[_1];else return document.getElementById?document.getElementById(_1):document.all[_1]};$.move=function(){var x=this.pos[0],y=this.pos[1];if(this._h)this._e(x+this._h,y+this._h,'s');if(this.style.border){this._e(x,y,'b');x+=this._H;y+=this._I};this._e(x,y,'o');this._e(x,y,'n');this._e(x,y,'e')};if($.bw.ns4)$._e=function(_6,_8,_f){this.div(_f).moveTo(_6,_8)};else if($.bw.operaOld)$._e=function(_6,_8,_f){with(this.div(_f).style){left=_6;top=_8}};else $._e=function(_6,_8,_f){with(this.div(_f).style){left=_6+'px';top=_8+'px'}};window.oldCMOnLoad=window.onload;function CMOnLoad(){var bw=new _n();if(bw.operaOld)window.operaResizeTimer=setTimeout('resizeHandler()',1000);if(typeof(window.oldCMOnLoad)=='function')window.oldCMOnLoad();if(bw.ns4)window.onresize=resizeHandler};window.onload=CMOnLoad;function resizeHandler(){if(window.reloading)return;if(!window.origWidth){window.origWidth=window.innerWidth;window.origHeight=window.innerHeight};var reload=window.innerWidth!=window.origWidth||window.innerHeight!=window.origHeight;window.origWidth=window.innerWidth;window.origHeight=window.innerHeight;if(window.operaResizeTimer)clearTimeout(window.operaResizeTimer);if(reload){window.reloading=1;document.location.reload();return};if(new _n().operaOld){window.operaResizeTimer=setTimeout('resizeHandler()',500)}};function CMenuPopUp(menu,evn,offX,offY){window.CMenus[menu].mpopup(evn,offX,offY)};function CMenuPopUpXY(menu,x,y){window.CMenus[menu].popup(x,y)};