// Title: COOLjsMenu
// URL: http://javascript.cooldev.com/scripts/coolmenu/
// Version: 2.9.4g
// Last Modify: 11 Apr 2007
// Author: Alex Kunin <alx@cooldev.com>
// Notes: Registration needed to use this script on your web site.
// Copyright (c) 2001-2006 by CoolDev.Com
// Copyright (c) 2001-2006 by Sergey Nosenko

// Options: PROFESSIONAL, COMPRESSED

function _4T(_4){return typeof _4=='function'};function _J(_4){return typeof _4=='undefined'};function _2M(_4){return typeof _4=='number'};function _4R(_4){return typeof _4=='object'};function _42(_4,_43){return _4&&_4.constructor==_43};function _S(_4){return _42(_4,Array)};Array.prototype._u=Array.prototype.push||function(_4){this[this.length]=_4;return this.length};Array.prototype._3q=Array.prototype.splice||function(_r,_3C){_r=Math.max(0,Math.min(this.length,_r));var _1Y=[].concat(arguments);var _3P=[].concat(arguments).slice(2).concat(this.slice(_r+_3C));var _a=this.slice(_r,_3C);this.length=_r;for(var i=0;i<_3P.length;i++){this._u(_3P[i])};return _a};function _3R(_Q,_1n){var o=window.$instances||(window.$instances=[]);if(_1n){if(!o[_1n]){o[_1n]=[]};o[_1n]._u(_Q)};return'$instances['+(o._u(_Q)-1)+']'};function _44(_1n,_3i){var _a=[].concat(window.$instances&&window.$instances[_1n]||[]);if(_3i){for(var i=0;i<_a.length;i++){if(_a[i]==_3i){_a._3q(i,1);break}}};return _a};function _m(_Q,_9,_G){if(_Q.addEventListener){_Q.addEventListener(_9,_G,false)}else{var _3H=_Q['on'+_9];_Q['on'+_9]=function(_d){if(!_d){_d=window.event};_G(_d);return _3H?_3H(_d):true}}};function _q(_49){this._1U=[_49]};_q._18=function(_o,_2j){return new _q()._18(_o,_2j)};_q._Z=function(_6){var _a=[],_14=0;while((_14=_6.indexOf('{',_14))!=-1&&(_37=_6.indexOf('}',_14))){var _t=_6.slice(_14+1,_37);if(_t.match(/^\w+$/)){_a._u(_6.slice(0,_14));_a._u(_t);_6=_6.slice(_37+1);_14=0}else{_14++}};_a._u(_6);return _a};_q.prototype={_1_:function(_6){this._1U._u(_6);return this},_18:function(_o,_2j){for(var i=0;i<_o.length;i+=2){this._1U._u(_o[i]);this._1U._u(_2j[_o[i+1]])};return this},toString:function(){return this._1U.join('')}};function _30(_3M){this._3M=_3M;this._1u={focus:[],blur:[],keydown:[],mouseover:[],mouseout:[],click:[]};this._2u=_3R(this);this._3V=_q._Z('return '+this._2u+'.$dispatch(\'{type}\',window.event||arguments[0],{arg})');this._3X=_q._Z(' on{type}="'+this._45('{type}','{arg}')+'"')};_30.prototype={_4j:function(_F,_4){for(var i=0;i<_F.length;i++){if(_F[i]==_4){return i}};return-1},_2U:function(_9){if(!this._1u[_9]){this._1u[_9]=[];this._1u[_9]._4E=true};return this._1u[_9]},_2c:function(_9,_G){if(_S(_9)){for(var i=0;i<_9.length;i++){this._2c(_9[i],_G)}}else if(this._4j(this._2U(_9),_G)==-1){this._2U(_9)._u(_G)}},_3O:function(_9,_d,_h){},_T:function(_9,_d,_h){this._3O(_9,_d,_h);var _1W=this._2U(_9);for(var i=_1W.length-1;i>=0;i--){if((typeof _1W[i]=='function'?_1W[i](_d,_h):_1W[i]._3K(_d,_h))===false){return false}};return true},$dispatch:function(_9,_d,_h){return this._T(_9,_d,_h)},_45:function(_9,_h){return _q._18(this._3V,{type:_9,arg:_h||0})},_39:function(_h){var _a=new _q();for(var _9 in this._1u){if(!this._1u[_9]._4E){_a._18(this._3X,{type:_9,arg:_h||0})}};return _a}};function CMenuPopUp(_1,e,dx,dy,_2m){window._1c[_1]._4F(e,{x:dx||0,y:dy||0},_2m)};function CMenuPopUpXY(_1,x,y){window._1c[_1]._36({x:x,y:y})};function CMenuPopDown(_1){window._1c[_1]._4C()};function mEvent(_4B,_2$,_d){var o=_1c[_4B];switch(_d){case'o':o._y._T('mouseover',_d,_2$);break;case't':o._y._T('mouseout',_d,_2$);break}};CLoadNotify=function(){if(window.on$htmlload){window.on$htmlload()}};var _1e;window.CMenus=window.$CM=window._1c={};window.BLANK_IMAGE='http://pics.rubylane.com/0/blank.gif';var _={};_._1T=navigator.appVersion;_._1B=navigator.userAgent;_._1q=window.opera;_._3e=_._1B.match(/opera.[789]/i);_._2O=_._1q&&!_._3e;_._1a=document.getElementById;_._4z=_._1T.match(/MSIE 5.5/)&&_._1a&&!_._1q;_._4G=_._1T.match(/MSIE 5/)&&_._1a&&!_._4z&&!_._1q;_._4S=_._1T.match(/MSIE 6/)&&_._1a&&!_._1q;_._1Q=document.all&&!_._1a&&!_._1q;_._1E=_._1T.match(/MSIE/)&&_._1a&&!_._1q; 



_._2h=_._1B.match(/Mac/);_._4y=_._1B.match(/hotjava/i);_._j=document.layers&&!_._1a&&!_._4y;_._2i=_._1B.match(/gecko/i);_._z=_._1E&&!_._2h;_._4N=_._1B.match(/gecko\/200[012]/i);function _38(_1){this._1=_1;this._P=_1._P+'t_';this._4M=0;this._2e=_1._b._7.imagePrefix||'';this._4c=_1._b._7.urlPrefix||'';this._4H=_1._b._7.hideNormalOnRollover;_20(_1._b._7,{backgroundColor:'',backgroundStyle:'',textClass:'',borderColor:'',borderWidth:'',shadowColor:'',shadow:'',valign:'',backgroundClass:'',textStyle:'',itemFilters:'',levelFilters:'',levelBackground:null,itemBackground:null});var _c=this,_2y=_1._b._7.blankImage?this._2e+_1._b._7.blankImage:BLANK_IMAGE;function _2t(_3){return _c._2q(_3,'status')};function _4I(_3){if(_2t(_3)){window.status=_2t(_3)}};function _4L(_3){if(_2t(_3)){window.status=window.defaultStatus}};_1._m(['focus','mouseover'],_4I);_1._m(['blur','mouseout'],_4L);_1._m(['focus','mouseover'],function(_3){_1._1X(_3)});_1._m('blur',function(_3){if(!_3._7.hasControls){_1._1X(null)}});_1._m('innerhover',function(_3){if(!_3._7.clickToActivate){_1._3o()};if(_1._3I){_1._1t(_3._i())}});_1._m('click',function(_3){_1._3o();if(!_3._7.url){_1._1t(_3._i())}else if(!_3._7.sticky){_1._2s()}});_1._m('outerhover',function(_3){if((!_1._11||_1._3L)&&(!_3||!_3._7.hasControls)){_1._4A()}});_1._m('outerclick',function(_3){_1._2s()});function _2o(_2,_6,_o,_3G,_4d,_2z,_k,_1s,_1S,_3E,_1Z,_3F,_4l,_4i,_4h){return _6._18(_o,{icon:_1s&&_1S?'<td width="'+_1S[1]+'"><img src="'+_c._2e+_1s+'" width="'+_1S[1]+'" height="'+_1S[0]+'" /></td>':'',arrow:_3E&&_1Z?'<td width="'+_1Z[1]+'"><img src="'+_c._2e+_3E+'" width="'+_1Z[1]+'" height="'+_1Z[0]+'" /></td>':'',bgColor:_3G?'background-color:'+_3G+';':'',bgClass:_4l,bgStyle:_4d||'',textClass:_2z,textStyle:_4i,code:_k,valign:_3F?' valign="'+_3F+'"':'',wrap:_4h?'':' nowrap="nowrap"',id:_2._w,w:_1p(_2.w),h:_1p(_2.h),x:_2.x,y:_2.y,visibility:_2._1R()?'':(_._j?' visibility="hidden"':'visibility:hidden;')})};function _1p(_n){return _._j?(isNaN(_n)?1:_n):(isNaN(_n)?'1px':_n+'px')};this._l={_4f:new _M({_o:_._j?_q._Z('<layer id="{id}" {visibility} width="{w}" height="{h}" left="{x}" top="{y}" color="{color}" background="{image}"></layer>'):_q._Z('<div id="{id}" class="{cssClass}" style="overflow:hidden;{visibility}position:absolute;{bgImage}width:{w};height:{h};left:{x}px;top:{y}px;background-color:{color};{style}"></div>'),_k:function(_6){return _6._18(this._o,{id:this._w,w:_1p(this.w),h:_1p(this.h),x:this.x,y:this.y,visibility:this._1R()?'':(_._j?' visibility="hidden"':'visibility:hidden;'),cssClass:this._2z,color:this._4g,style:this._8,image:this._1s,bgImage:this._1s?'background-image:url('+this._1s+')':''})}}),_2a:new _M({_o:_._j?_q._Z('<layer id="{id}"{visibility} left="{x}" top="{y}" width="{w}" height="{h}"><table width="100%" height="100%" style="{bgColor}{bgStyle}" cellspacing="0" cellpadding="0" border="0"><tr{valign}>{icon}<td class="{bgClass}"{wrap}><div class="{textClass}" style="{textStyle}">{code}</div></td>{arrow}</tr></table></layer>'):_q._Z('<table id="{id}" style="{visibility}position:absolute;border-collapse:collapse;left:{x}px;top:{y}px;width:{w};height:{h};{bgColor}{bgStyle}" cellspacing="0" cellpadding="0" border="0"><tr{valign}>{icon}<td class="{bgClass}"{wrap}><div class="{textClass}" style="{textStyle}">{code}</div></td>{arrow}</tr></table>'),_4m:!_1._b._7.measureRollover,_N:this._4H?1:0,_f:['+borderTop','+borderLeft'],_I:['+item-borderTop-borderBottom','+item-borderLeft-borderRight'],_k:function(_6){var o=this._3._7;return _2o(this,_6,this._o,_A(o.backgroundColor)||o.color.bgON,_A(o.backgroundStyle),_A(o.textClass)||o.css.ON,o.code[0],o.image&&o.image[0],o.imgsize,this._3._1$&&o.arrow&&o.arrow[0],o.arrsize,_A(o.valign),_A(o.backgroundClass),_A(o.textStyle),!isNaN(this.w))}}),_4n:new _M({_o:_._j?_q._Z('<layer id="{id}"{visibility} width="{w}" height="{h}" left="{x}" top="{y}"><a class="{css}" title="{4}" accesskey="{key}" href="{href}" target="{target}"'+_1._y._39('{index}')+'><img src="'+_2y+'" width="{w}" height="{h}" title="{tip}" alt="{tip}" border="0" /></a></layer>'):_q._Z('<a id="{id}" style="display:block;{visibility}position:absolute;width:{w};height:{h};left:{x}px;top:{y}px;" class="{css}" title="{4}" accesskey="{key}" href="{href}" target="{target}"'+_1._y._39('{index}')+'><img src="'+_2y+'" width="100%" height="100%" title="{tip}" alt="{tip}" border="0" /></a>'),_4t:true,_k:function(_6){var o=this._3._7;return _6._18(this._o,{css:o.trigger,key:o.key,href:o.url&&((/^\w+:|^#/.test(o.url)?'':_c._4c)+o.url)||'#',target:o.target,tip:_c._2q(this._3,'tip')||_c._2q(this._3,'alt'),index:this._3._r,id:this._w,w:_1p(this.w),h:_1p(this.h),x:this.x,y:this.y,visibility:this._1R()?'':(_._j?' visibility="hidden"':'visibility:hidden;')})}})};this._l._2B=_1o(this._l._2a);this._l._2B._N=2;this._l._2B._k=function(_6){var o=this._3._7;return _2o(this,_6,this._o,_1l(o.backgroundColor)||o.color.bgOVER,_1l(o.backgroundStyle),_1l(o.textClass)||o.css.OVER,o.code[1],o.image&&o.image[1],o.imgsize,this._3._1$&&o.arrow&&o.arrow[1],o.arrsize,_1l(o.valign),_1l(o.backgroundClass),_1l(o.textStyle),!isNaN(this.w))};this._l._3p=_1o(this._l._2a);this._l._3p._k=function(_6){var o=this._3._7;return _2o(this,_6,this._o,_A(o.backgroundColor)||o.color.bgON,_A(o.backgroundStyle),_A(o.textClass)||o.css.ON,0,0,0,0,0,_A(o.valign),_A(o.backgroundClass),_A(o.textStyle),0)}};_38.prototype={_4u:['+item','+item'],_4v:['+shadow','+shadow'],_4w:['+level','+level'],_2Z:[['+item','+borderLeft'],['+borderTop','+item'],['+item','+borderRight'],['+borderBottom','+item']],_4s:[[0,0],[0,0],[0,'+item-borderRight'],['+item-borderBottom',0]],_2q:function(_3,_t){var _4=_3._7[_t];if(_J(_4)){return''};if(_J(_3._7[_4])){return _4};return _A(_3._7[_4])},_4r:function(_3){var _a=[],o=_3._7,_c=this,_3n=o.shadowColor||o.color.shadow,_2R=o.borderColor||o.color.border;function _1H(_2){_2._3=_3;_2._w=_c._P+_c._4M++;if(_2._4t&&o.hasControls){_2._N=1};_2._1k=_2._N===0||_2._N===1;_a._u(_2)};function _21(_16,_2P){_1H(_1y(_c._l._4f,{_I:_Y(_16.size||_2P||_M._I),_f:_Y(_16.offset||_M._f,'item'),_2z:_16.cssClass,_8:_16.style,_4g:_16.color,_1s:_16.image,_N:_16.state||0}))};function _3l(_2D,_2P){if(_2D){for(var i=0;i<_2D.length;i++){_21(_2D[i],_2P)}}};if(_3n){_21({color:_3n,offset:this._4v})};if(_3._2N){_3l(o.levelBackground,this._4w)};_3l(o.itemBackground);if(_2R){if(!o.transparentBorder){_21({color:_2R,size:this._4u})}else{for(var i=0;i<4;i++){if(_3._2Z[i]){_21({color:_2R,size:this._2Z[i],offset:this._4s[i]})}}}};if(_3._3r){_1H(_1o(this._l._3p))}else{_1H(_1o(this._l._2a));if(!o.hasControls){_1H(_1o(this._l._2B))}};_1H(_1o(this._l._4n));return _a},_4o:function(_E,_2){new _2G()._1i(_E,_2)},_4p:function(_3,_2){new _2K()._1i(_3,_2)}};function _2L(){};_2L.prototype={_z:'',_1i:function(_1V,_2){if(_2._2I){this._1V=_1V;this._2=_2;_2._2I(this)}},_3A:function(_2C){if(_2C&&_._z){var _z=this._3x(!this._2._3w());if(_z!=this._z){if(this._z){_D(this._2._2.filters,{stop:_1e})};this._2._8.filter=this._z=_z};if(_z){_D(this._2._2.filters,{apply:_1e})}}},_3t:function(_2C){if(_2C&&_._z&&this._z){_D(this._2._2.filters,{play:_1e})}}};function _2G(){};_2G.prototype=new _2L();_2G.prototype._3x=function(_2V){var o=this._1V._7.levelFilters;return _S(o)?o[_2V?0:1]:(o||'')};function _2K(){};_2K.prototype=new _2L();_2K.prototype._3x=function(_2V){var o=this._1V._7.itemFilters;return _S(o)?o[_2V?0:1]:(o||'')};function _19(_t,_e){_20(_e[0],{dynamic:true,zIndex:1000,exclusive:true,wrapoff:[0,0],delay:[0,800],pos:'relative'});window._1c[_t]=this;this._e=[];this.items=this._e;this._t=_t;this._1A=_e[0].dynamic&&((_._1a&&!_._2O&&!(_._1E&&_._2h))||_._j||_._1Q);this._2u=_3R(this,'COOLjsMenu');this._P=_t+'_'; 
this._34=_e[0].https_fix_blank_doc||'javascript:false'; 
this._11=_e[0].popup;this._3L=_e[0].dismissPopupOnRollout;this._1b=_e[0].frames;this._1j=this._1b&&_e[0].frames[0]==window.name;this._17=!this._11&&_e[0].pos=='relative'&&(!this._1b||this._1j);this._3v=_S(_e[0].delay)?_e[0].delay[0]:_e[0].delay;this._4q=_S(_e[0].delay)?_e[0].delay[1]:this._3v;this._25=[];this._3z=3;this._3y={x:0,y:0};this.__=false;this._b=new _3s(this,_e);this._y=new _30(this);var _c=this;if(this._1b){this._y._3O=function(_9,_d,_h){var _1G=_c._e[_h],_1z=_c._3k(),_2H=[],_2T=_1z&&_1z._b;if(_1G&&_1z&&!_c._2Y&&!_1z._2Y){_c._2Y=true;while(_1G._5){_2H._u(_1G._1w);_1G=_1G._5};for(var i=_2H.length-1;i>=0;i--){_2T=_2T._i()._3m(_2H[i])};_1z._y._T(_9,_d,_2T._r);_c._2Y=false}}};this._3B=null;function _1g(){window.clearTimeout(_c._3B)};this._1g=_1g;function _1F(_3,_3j){_1g();var _2l=_3j?_c._3v:_c._4q,_3N=_3j?'$oninnerhover':'$onouterhover';if(_2l>0){_c._3B=window.setTimeout(_c._2u+'.'+_3N+'('+(_3?_3._r:-1)+')',_2l)}else if(_2l===0){_c[_3N](_3?_3._r:-1)}};this._1F=_1F;this._m('mouseover',function(_3){_1F(_3,true)});this._m('mouseout',function(_3){_1F(_3,false)});this._m(['focus','click','keydown','outerclick'],_1g);_m(window,'load',function(){_c._2k(true)});_m(window,'$htmlload',function(){_c._2k()});_m(window,'scroll',function(){_c._2f()});if(this._1b&&!this._1j){_m(window,'resize',function(){_c._2f()})};if(_._2O){_v=_28}else if(_._j){_v=_1m}else if(_._1Q){_v=_1h}else{_v=_1d};_v._3Q={};this._2b=new _38(this)};_19.prototype={_2d:function(){this._1t(this._b._i())},hide:function(){this._1t(null)},_3U:function(){_D(_44('COOLjsMenu',this),{_2s:null})},moveXY:function(x,y){this._2g({x:x,y:y})},$oninnerhover:function(_h){this._y._T('innerhover',null,_h)},$onouterhover:function(_h){this._y._T('outerhover',null,_h)},_2s:function(){this._1t(null);this._1X(null);this._y._T('dismiss',null,null)},_m:function(_9,_G){this._y._2c(_9,{_1:this,_G:_G,_3K:function(_d,_h){return this._G(this._1._e[_h],_d)}})},_2k:function(__){this.__=this.__||__;if(!this._11){if(this.__&&_._j){_3S(document.layers);if(this._17){var o=document.anchors[this._P+'da'];this._b.x=o.x;this._b.y=o.y}};if(!(_._1Q||_._j)||__){this._2d()}}},_4e:function(_4k){for(var _t in this){if(_t.match(_4k)){this._y._2c(RegExp.$1,{_Q:this,_12:_t,_3K:function(_d,_h){return this._Q[this._12](this._Q._e[_h],_d)}})}}},_3D:function(_4x){this._4e(/^on(\w+)$/);this._b._i()._24();this.root=this._b;this.root.cd=this._b._i()._B;var w=this._b._i().w,h=this._b._i().h,s,i;this._22=!isNaN(w+h);if(!_._j){s='<div id="'+this._P+'r" style="z-index:'+this._b._x[0].zIndex+';position:';if(this._1b&&!this._1j&&_._2i){s+='fixed;top:0;left:0;'}else if(this._17){s+='relative;'+(this._22?'width:'+w+'px;height:'+h+'px;':'')}else{s+='absolute;left:'+this._b.x+'px;top:'+this._b.y+'px;'};s+='">'+(this._1A?'':this._b._i()._W(new _q())); 


s+='</div>';if(_._4N&&this._17&&this._22){s='<div style="width:'+w+';height:'+h+'px;"><div style="width:'+w+'px;height:'+h+'px;position:absolute;">'+s+'</div><div style="width:'+w+'px;height:'+h+'px;"></div></div>'};if(_4x){var o=document.createElement('div');o.innerHTML=s;document.body.appendChild(o)}else{document.write(s)};this._U=_v._X(this._P+'r'); 


}else{s=(this._1A?'':'<div style="color:red;"></div>'+this._b._i()._W(new _q()));if(this._17){s='<a name="'+this._P+'da" href="#"><img src="'+this._2y+'" '+(this._22?'width="'+w+'" height="'+h+'"':'width="1" height="1"')+' border="0" /></a>'+s};document.write(s)};var _c=this,_G=function(){var _d=window.event||arguments[0],o=_d.srcElement||_d.target,_9='outerclick';while(o){if(o==_c._U._2){_9='innerclick';break};o=o.parentNode||o.parentElement};_c._y._T(_9,_d,0)};_m(document,'click',_G)},_4F:function(e,_f,_2m){if(_2m&&this._1L){this._1g();return};var _4P=this._b._7.popupoff,_1K=_._1E?{x:0,y:0}:this._3J();_27({x:e.pageX||e.x,y:e.pageY||e.y},_1K);_27(_f,_1K);this._36(_1K)},_36:function(_1K){this._2g(_1K);this._2d()},_4C:function(){this._1g();this._1F(null,false)},_4K:function(){var _a={x:0,y:0},o=this._U._2;while(o){_27({x:o.offsetLeft,y:o.offsetTop},_a);o=o.offsetParent};return _a},_3J:function(){return{x:document.body.scrollLeft||document.body.parentElement&&document.body.parentElement.scrollLeft||0,y:document.body.scrollTop||document.body.parentElement&&document.body.parentElement.scrollTop||0}},_2f:function(){if(this._1b&&!this._1j){var _f={x:0,y:0},_p;if(_._1E||_._3e){_f=this._3J();_p=this._2p();if(_p){_f.y-=_p.document.body.parentElement.clientHeight||_p.document.body.clientHeight}}else if(_._2i){_p=this._2p();if(_p){_f.y-=_p.innerHeight}};var _1=this._3k();if(_1){_27(_1._4K(),_f)};this._2g(_f)}},_2p:function(){if(_J(this._3d)){var _$={};function _3f(_p){if(_p.frames&&(!_p.name||_J(_$[_p.name]))){for(var i=0;i<_p.frames.length;i++){_3f(_p.frames[i])}};if(_p.name&&_J(_$[_p.name])){_$[_p.name]=_p}};_3f(top);this._3d=_$[this._b._7.frames[this._1j?1:0]]||null};return this._3d},_3k:function(){var o=this._2p();return o&&o._1c&&o._1c[this._t]},_2g:function(_3h){if(_._j){_3g(_3h,_c._3y);this._b._i()._3b()}else{this._U._V(_3h)}},_1X:function(_3){if(!(_.ie4||_._j)||this.__){_3a(this._4J,_3,{_2J:1},{_2J:2});this._4J=_3;if(_3&&_3._7.exclusive){this._3U()}}},_1t:function(_E){if(!(_._1Q||_._j)||this.__){this._2f();if(_E&&_E._7.exclusive){this._3U()};if(!_E&&!this._11){_E=this._b._i()};_3a(this._1L,_E,{_C:false},{_C:true});this._1L=_E;if(_._2i&&this._17){var o=this._U._2.parentNode;if(o.tagName!='BODY'){o.style.width=this._U._2.offsetWidth+'px';o.style.height=this._U._2.offsetHeight+'px'}}}},_3o:function(){this._3I=true},_4A:function(){this._3I=false;this._1t(this._11&&this._1L&&!this._3L?this._b._i():null);this._1X(null);this._y._T('deactivate',null,null)}};_19.create=function(_t,_e){var _a=new COOLjsMenuPRO(_t,_e);_a._3D(true);_a._2k();return _a};function _A(_4){return _S(_4)?_4[0]:_4};function _1l(_4){return _S(_4)?_4[1]:_4};_20(_19.prototype,{addEventListener:_19.prototype._m,initTop:_19.prototype._3D,init:_H,show:_19.prototype._2d});function _2S(){};_2S.prototype={x:0,y:0,_1i:function(_5){this._7=_1y(_5._2E,_35(_5._x[0].style||_5._2E.style,_5._O+1),_5._x[0]);_2_(this._7);this._5=_5;this._1=_5._1;this._1C=!_5._5;this._33=!_5._1._11&&this._1C;this._2W=_5._1._P+'l_'+this._5._r;this._23={w:NaN,h:NaN};this._f=_Y(this._7.leveloff||[0,0],'parentItem')},_31:function(){this.w=this.h=0;for(var i=0;i<this._B.length;i++){var o=this._B[i];this.w=Math.max(this.w,o.x+o.w);this.h=Math.max(this.h,o.y+o.h)}},_1D:function(){return(this._5._5?this._5._5._i()._1D():[]).concat([this])},_24:function(){if(!this._B){var i,_e=this._5._x,_29=_e.length-1;if(_J(_e[_29])){_29--};this._B=[];for(i=0;i<_29;i++){this._B[i]=new _2r()};for(i=0;i<_29;i++){var _3=this._B[i];_3._1i(this._1,this._5,i,this._1._e._u(_3)-1,this._B[i-1],this._B[i+1])};this._31()};return this._B},_4Q:function(){return this._24().length},_3m:function(_r){return this._24()[_r]},_2w:function(){return this._3m(0)},_3b:function(){if(this._2){this._2._V(this._1._3y)}},_W:function(_6){if(!this._1._1A){if(_._j){_6._1_('<layer id="'+this._2W+'" left="-10000" top="-10000">')}else{_6._1_('<div id="'+this._2W+'" style="position:absolute;left:-10000px;top:-10000px;width:1000px;">')}};_D(this._24(),{_W:_6});if(!this._1._1A){if(_._j){_6._1_('</layer>')}else{_6._1_('</div>')};for(var i=0;i<this._B.length;i++){this._B[i]._i()._W(_6)}};return _6},_1r:function(){if(!this._2){this._2=this._1._1A?_v._2n(this._W(new _q()),this._1._U||1):_v._X(this._2W);this._1._2b._4o(this,this._2);if(isNaN(this.w+this.h)){this._23.w=0;this._23.h=0;for(var o=this._2w();o;o=o._1x){_4D(o._3W(),this._23)};_D(this._B,{_1v:_1e});this._31();_D(this._B,{_1v:true})};if(!this._1C){this.x=this._f.x(this._2w());this.y=this._f.y(this._2w())}else if(_._j){_3g(this._1._b,this)};this._2._V(this);if(!_._j){this._2._15(this)};if(!_._j&&!_._2O&&this._33&&this._1._17&&!this._1._22){this._1._U._15(this)};if(this._33){var _$=this._1._b._7.forms_to_hide;if(_$){for(var i=0;i<_$.length;i++){_v._X(_$[i])._C(!this._1._1L||this._1._1L==this._1._b._i())}}}};return this._2},_C:function(_4){if(this._1k!=_4){this._1k=_4;this._1r()._C(_4,true); 


}}};function _1N(){};_1N.prototype=new _2S();_1N.prototype._C=_H;_1N.prototype._W=function(_6){return _6};_1N.prototype._3b=_H;function _2r(){};_2r.prototype={_1i:function(_1,_5,_1w,_r,_1I,_1x){var _g=_5._x[_1w+1];_20(_g,_g.format||{});_2_(_g);this._1=_1;this.index=_r;this._r=_r;this._5=_5;this._O=_5._O+1;this._1w=_1w;this._2F=1;this._x=_g.sub&&_g.sub.length>0?_g.sub:[{}];this._1$=this._x.length>1;this._2N=!_1I;this._3Z=!_1x;this._47=!_1I&&!_1x;this._3r=_J(_g.code);this._1C=_5==_1._b;this._1I=_1I;this._1x=_1x;var p=_1y(_5._E._7,_35(_g.style,this._O),_g),o=_1y(p,this._2N&&p.ifFirst,this._3Z&&p.ifLast,this._47&&p.ifOnly,this._3r&&p.ifSeparator,p['ifN'+this._1w],_g);this._2E=p;this._7=o;this._I=_Y(o.size);this._f=this._2N?_46:_Y(o.wrapPoint?o.wrapoff:o.itemoff||[0,0],'previousItem');var b=o.borderWidth||o.borders||o.border||0,s=o.shadow||0;if(_2M(b)){b=[b,b,b,b]};this._2Z=b;if(_2M(s)){s=[s,s]};this._4O=s;this.borderLeft={w:b[0],h:b[0]};this.borderTop={w:b[1],h:b[1]};this.borderRight={w:b[2],h:b[2]};this.borderBottom={w:b[3],h:b[3]};this.shadow={w:s[0],h:s[1]};this.self=this;this.item=this;this.previousItem=_1I;this.level=_5._i();this.parentItem=_5;this.parentLevel=!this._1C&&_5._5._i();this.maxItem=_5._i()._23;this._l=_1._2b._4r(this);this._3c=[];for(var i=0;i<this._l.length;i++){if(this._l[i]._4m){this._48=this._l[i]};if(this._l[i]._N!==0){this._3c._u(this._l[i])}};this._1v()},getMenu:function(){return this._1},getLevel:function(){return this._i()},getParent:function(){return this._5},getData:function(){return this._7},_3W:function(){var o=this._48._1r()._32();this.w=o.w+this.borderLeft.w+this.borderRight.w;this.h=o.h+this.borderTop.h+this.borderBottom.h;return this},_1D:function(){return(this._5&&this._5._1D()||[]).concat([this])},_1v:function(_4b){this.w=this._I.w(this);this.h=this._I.h(this);if(_4b){_D(this._l,{_4a:_1e})};this.x=this._f.x(this);this.y=this._f.y(this)},_i:function(){if(!this._E){(this._E=this._1$?new _2S():new _1N())._1i(this)};return this._E},_W:function(_6){_D(this._l,{_W:_6});return _6},_2J:function(_4){if(_4!=this._2F){this._2F=_4;_D(this._3c,{_3Y:_1e})}}};function _3s(_1,_x){this._1=_1;this._5=null;this._7=_1y({shadow:0,color:{},css:{}},_x[0]);this._2E=this._7;this.frameoff=_x[0].pos?_x[0].pos:[0,0];this._2J=_H;this._r='R';this._1$=true;this._O=-1;this._x=_x;if(_1._1b&&!_1._1j){this.x=0;this.y=0}else if(!_1._17&&!_1._11){this.x=_x[0].pos[0];this.y=_x[0].pos[1]}};_3s.prototype=new _2r();function _M(_g){for(var i in _g){this[i]=_g[i]};_Y(this._I);_Y(this._f,'item')};_M._I=['+item','+item'];_M._f=[0,0];_M.prototype={_I:_M._I,_f:_M._f,_N:0,_1v:function(){this.w=this._I.w(this._3);this.h=this._I.h(this._3);this.x=this._f.x(this._3);this.y=this._f.y(this._3)},_4a:function(){this._1v();this._1r()._15(this);this._1r()._V(this)},_1r:function(){if(!this._2){this._2=_v._X(this._w);if(this._N===2){this._3._1._2b._4p(this._3,this._2)}};return this._2},_W:function(_6){this._1v();return this._k(_6)},_1R:function(_4){return this._N===0||this._N===this._3._2F},_3Y:function(){if(this._1k!=this._1R()){this._1k=!this._1k;this._1r()._C(this._1k,true)}}};_v=_H;function _3S(_2A){for(var i=0;i<_2A.length;i++){_v._3Q[_2A[i].id]=_2A[i]}};function _1d(_2){this._2=_2;this._8=_2.style;this._1M=_._2h?_2:(_2.childNodes&&_2.childNodes[0]||_2);this._L=null;this._z=''};_1d._X=function(_w){return new _1d(document.all&&document.all[_w]||document.getElementById(_w))};_1d._2n=function(_1O,_5){var _1f=document.createElement('DIV'),o=_1f.style;o.position='absolute';o.visibility='hidden';o.left=o.top=-10000;_1f.innerHTML=_1O;(_5&&_5._2||_5||document.body).appendChild(_1f);return new _1d(_1f)};_1d.prototype={_3w:function(){return this._8.visibility!='hidden'},_32:function(){return{w:Math.max(this._2.offsetWidth,this._1M.offsetWidth),h:Math.max(this._2.offsetHeight,this._1M.offsetHeight)}},_V:function(o){this._8.left=o.x+'px';this._8.top=o.y+'px'},_15:function(o){this._8.width=o.w+'px';this._8.height=o.h+'px'},_2I:function(_L){this._L=_L;this._C=this._2x},_C:function(_4){this._8.visibility=_4?'inherit':'hidden'},_2x:function(_4,_1J){this._L._3A(_1J);this._8.visibility=_4?'inherit':'hidden';this._L._3t(_1J)}};function _28(){};_28.prototype={_C:function(_4){this._8.visibility=_4?'visible':'hidden'},_V:function(o){this._8.left=o.x;this._8.top=o.y},_15:function(o){this._8.width=o.w;this._8.height=o.h},_3$:_H,_3_:_H};_28._X=function(_w){var _a=new _28();_a._2=document.getElementById(_w);_a._8=_a._2.style;return _a};function _1m(_2){this._2=_2;_3S(_2.document.layers)};_1m.prototype={_C:function(_4){this._2.visibility=_4?'inherit':'hide'},_V:function(o){this._2.moveTo(o.x,o.y)},_15:function(o){this._2.resize(o.w,o.h)},_3$:_H,_3_:_H};_1m._X=function(_w){return new _1m(_v._3Q[_w])};_1m._2n=function(_1O){var o=new Layer(1);o.visibility='hide';o.document.write(_1O);o.document.close();return new _1m(o)};function _1h(_2){this._2=_2;this._1M=_2.children[0]||_2;this._8=_2.style;this._L=null;this._z=''};_1h._X=function(_w){return new _1h(document.all&&document.all[_w]||document.getElementById(_w))};_1h._2n=function(_1O,_5){_5=_5&&_5._2||_5||document.body;_5.insertAdjacentHTML('beforeEnd','<div style="position:absolute;visibility:hidden;left:-10000px;top:-10000px;">'+_1O+'</div>');var _1f=_5.children[_5.children.length-1];return new _1h(_1f)};_1h.prototype={_3w:function(){return this._8.visibility!='hidden'},_32:function(){return{w:this._1M.offsetWidth,h:this._1M.offsetHeight}},_V:function(o){this._8.left=o.x+'px';this._8.top=o.y+'px'},_15:function(o){this._8.width=o.w+'px';this._8.height=o.h+'px'},_2I:function(_L){this._L=_L;this._C=this._2x},_C:function(_4){this._8.visibility=_4?'inherit':'hidden'},_2x:function(_4,_1J){this._L._3A(_1J);this._8.visibility=_4?'inherit':'hidden';this._L._3t(_1J)}};function _H(){return''};function _1o(_1P){_H.prototype=_1P;return new _H()};function _1y(_1P){var i,j,l,_a={};for(j=0,l=arguments.length;j<l;j++){if(arguments[j]){for(i in arguments[j]){_a[i]=arguments[j][i]}}};return _a};function _20(_1P,_o){for(var i in _o){if(_J(_1P[i])){_1P[i]=_o[i]}}};_Y=function(_F,_13){if(!_F._40){_F.w=_F.x=_3T(_F[1],_13,'.w','.x');_F.h=_F.y=_3T(_F[0],_13,'.h','.y');_F._40=true};return _F};_3T=function(_4,_13,_41,_2X){var _2Q=false,_k='';if(_2M(_4)){_k+=_4}else{var _K;while((_K=_4.match(/^([-+\.\d+]*)\*?(\w+)/))){if(_K[1]===''){_13=_K[2]}else{switch(_K[1]){case'-':case'+':_k+=_K[1]+1;break;default:_2Q=_2Q||_K[1].indexOf('.')!=-1;_k+=(_K[1]>=0?'+':'')+parseFloat(_K[1]);break};if(_K[2]!='px'){_k+='*i.'+_K[2]+_41}};_4=_4.slice(_K[0].length)}};if(_13){_k+='+i.'+_13+_2X;switch(_13){case'item':case'previousItem':break;case'parentItem':_k+='+i.parentLevel'+_2X;break;default:_k+='-i.level'+_2X;break}}else if(!_k){_k=0};if(_2Q){_k='Math.round('+_k+')'};return new Function('i','return '+_k)};function _3a(o1,o2,m1,m2){var p1=o1?o1._1D():[],p2=o2?o2._1D():[],i=0;while(i<p1.length&&i<p2.length&&p1[i]==p2[i]){i++};_D(p1.slice(i),m1);_D(p2.slice(i),m2)};function _D(_26,_1Y){var _12,i,l;for(_12 in _1Y){if(_J(_1Y[_12])){for(i=0,l=_26.length;i<l;i++){_26[i][_12]()}}else{for(i=0,l=_26.length;i<l;i++){_26[i][_12](_1Y[_12])}}}};function _35(_8,_O){if(_S(_8)){if(_J(_8._O)){_8._O=_O};_8=_8[Math.min(_O-_8._O,_8.length-1)]};return _8};function _2_(_g){var _3u={code:'ocode',image:'oimage',arrow:'oarrow'};for(var i in _3u){if(!_J(_g[i])&&!_S(_g[i])){_g[i]=[_g[i],_g[_3u[i]]||_g[i]]}}};_4D=function(_10,_R){_R.w=Math.max(_10.w,_R.w);_R.h=Math.max(_10.h,_R.h)};_3g=function(_10,_R){_R.x=_10.x;_R.y=_10.y};_27=function(_10,_R){_R.x+=_10.x;_R.y+=_10.y};var _46=_Y([0,0]);window.COOLjsMenuPRO=_19

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
// -------------------------------------------------------------------
// Switch Content Script- By Dynamic Drive, available at: http://www.dynamicdrive.com
// Created: Jan 5th, 2007
// April 5th: Added ability to persist content states by x days versus just session only
// -------------------------------------------------------------------

function switchcontent(className, filtertag){
	this.className=className
	this.collapsePrev=false //Default: Collapse previous content each time
	this.persistType="none" //Default: Disable persistence
	//Limit type of element to scan for on page for switch contents if 2nd function parameter is defined, for efficiency sake (ie: "div")
	this.filter_content_tag=(typeof filtertag!="undefined")? filtertag.toLowerCase() : ""
}

switchcontent.prototype.setStatus=function(openHTML, closeHTML){ //PUBLIC: Set open/ closing HTML indicator. Optional
	this.statusOpen=openHTML
	this.statusClosed=closeHTML
}

switchcontent.prototype.setColor=function(openColor, closeColor){ //PUBLIC: Set open/ closing color of switch header. Optional
	this.colorOpen=openColor
	this.colorClosed=closeColor
}

switchcontent.prototype.setPersist=function(bool, days){ //PUBLIC: Enable/ disable persistence. Default is false.
	if (bool==true){ //if enable persistence
		if (typeof days=="undefined") //if session only
			this.persistType="session"
		else{ //else if non session persistent
			this.persistType="days"
			this.persistDays=parseInt(days)
		}
	}
	else
		this.persistType="none"
}

switchcontent.prototype.collapsePrevious=function(bool){ //PUBLIC: Enable/ disable collapse previous content. Default is false.
	this.collapsePrev=bool
}


switchcontent.prototype.sweepToggle=function(setting){ //PUBLIC: Expand/ contract all contents method. (Values: "contract"|"expand")
	if (typeof this.headers!="undefined" && this.headers.length>0){ //if there are switch contents defined on the page
		for (var i=0; i<this.headers.length; i++){
			if (setting=="expand")
				this.expandcontent(this.headers[i]) //expand each content
			else if (setting=="contract")
				this.contractcontent(this.headers[i]) //contract each content
		}
	}
}


// -------------------------------------------------------------------
// PUBLIC: defaultExpanded(indices_of_contents)- Set contents that should be expanded by default when the page loads.
// Note that the persistence feature (if enabled) overrides this setting.
// Pass in the position of the contents relative to the rest of the contents ie: defaultExpanded(0,2,3) would expand the 1st, 3rd, and 4th contents by default
// -------------------------------------------------------------------

switchcontent.prototype.defaultExpanded=function(){
	var expandedindices=[] //Array to hold indices (position) of content to be expanded by default
	//Loop through function arguments, and store each one within array
	//Two test conditions: 1) End of Arguments array, or 2) If "collapsePrev" is enabled, only the first entered index (as only 1 content can be expanded at any time)
	for (var i=0; (!this.collapsePrev && i<arguments.length) || (this.collapsePrev && i==0); i++)
		expandedindices[expandedindices.length]=arguments[i]
	this.expandedindices=expandedindices.join(",") //convert array into a string of the format: "0,2,3" for later parsing by script
}


//PRIVATE: Sets color of switch header.

switchcontent.prototype.togglecolor=function(header, status){
	if (typeof this.colorOpen!="undefined")
		header.style.color=status
}


//PRIVATE: Sets status indicator HTML of switch header.

switchcontent.prototype.togglestatus=function(header, status){
	if (typeof this.statusOpen!="undefined")
		header.firstChild.innerHTML=status
}


//PRIVATE: Contracts a content based on its corresponding header entered

switchcontent.prototype.contractcontent=function(header){
	var innercontent=document.getElementById(header.id.replace("-title", "")) //Reference content for this header
	innercontent.style.display="none"
	this.togglestatus(header, this.statusClosed)
	this.togglecolor(header, this.colorClosed)
}


//PRIVATE: Expands a content based on its corresponding header entered

switchcontent.prototype.expandcontent=function(header){
	var innercontent=document.getElementById(header.id.replace("-title", ""))
	innercontent.style.display="block"
	this.togglestatus(header, this.statusOpen)
	this.togglecolor(header, this.colorOpen)
}

// -------------------------------------------------------------------
// PRIVATE: toggledisplay(header)- Toggles between a content being expanded or contracted
// If "Collapse Previous" is enabled, contracts previous open content before expanding current
// -------------------------------------------------------------------

switchcontent.prototype.toggledisplay=function(header){
	var innercontent=document.getElementById(header.id.replace("-title", "")) //Reference content for this header
	if (innercontent.style.display=="block")
		this.contractcontent(header)
	else{
		this.expandcontent(header)
		if (this.collapsePrev && typeof this.prevHeader!="undefined" && this.prevHeader.id!=header.id) // If "Collapse Previous" is enabled and there's a previous open content
			this.contractcontent(this.prevHeader) //Contract that content first
	}
	if (this.collapsePrev)
		this.prevHeader=header //Set current expanded content as the next "Previous Content"
}


// -------------------------------------------------------------------
// PRIVATE: collectElementbyClass()- Searches and stores all switch contents (based on shared class name) and their headers in two arrays
// Each content should carry an unique ID, and for its header, an ID equal to "CONTENTID-TITLE"
// -------------------------------------------------------------------

switchcontent.prototype.collectElementbyClass=function(classname){ //Returns an array containing DIVs with specified classname
	var classnameRE=new RegExp("(^|\\s+)"+classname+"($|\\s+)", "i") //regular expression to screen for classname within element
	this.headers=[], this.innercontents=[]
	if (this.filter_content_tag!="") //If user defined limit type of element to scan for to a certain element (ie: "div" only)
		var allelements=document.getElementsByTagName(this.filter_content_tag)
	else //else, scan all elements on the page!
		var allelements=document.all? document.all : document.getElementsByTagName("*")
	for (var i=0; i<allelements.length; i++){
		if (typeof allelements[i].className=="string" && allelements[i].className.search(classnameRE)!=-1){
			if (document.getElementById(allelements[i].id+"-title")!=null){ //if header exists for this inner content
				this.headers[this.headers.length]=document.getElementById(allelements[i].id+"-title") //store reference to header intended for this inner content
				this.innercontents[this.innercontents.length]=allelements[i] //store reference to this inner content
			}
		}
	}
}


//PRIVATE: init()- Initializes Switch Content function (collapse contents by default unless exception is found)

switchcontent.prototype.init=function(){
	var instanceOf=this
	this.collectElementbyClass(this.className) //Get all headers and its corresponding content based on shared class name of contents
	if (this.headers.length==0) //If no headers are present (no contents to switch), just exit
		return
	//If admin has changed number of days to persist from current cookie records, reset persistence by deleting cookie
	// don't do this when using one cookie - it deletes all the cookies.  Need new delete class
	//if (this.persistType=="days" && (parseInt(switchcontent.getCookie(this.className+"_dtrack"))!=this.persistDays))
	//	switchcontent.setCookie(this.className+"_d", "", -1) //delete cookie
	// Get ids of open contents below. Four possible scenerios:
	// 1) Session only persistence is enabled AND corresponding cookie contains a non blank ("") string
	// 2) Regular (in days) persistence is enabled AND corresponding cookie contains a non blank ("") string
	// 3) If there are contents that should be enabled by default (even if persistence is enabled and this IS the first page load)
	// 4) Default to no contents should be expanded on page load ("" value)
	var opencontents_ids=(this.persistType=="session" && switchcontent.getCookie(this.className)!="")? ','+switchcontent.getCookie(this.className)+',' : (this.persistType=="days" && switchcontent.getCookie(this.className+"_d")!="")? ','+switchcontent.getCookie(this.className+"_d")+',' : (this.expandedindices)? ','+this.expandedindices+',' : ""
	for (var i=0; i<this.headers.length; i++){ //BEGIN FOR LOOP
		if (typeof this.statusOpen!="undefined") //If open/ closing HTML indicator is enabled/ set
			this.headers[i].innerHTML='<span class="status"></span>'+this.headers[i].innerHTML //Add a span element to original HTML to store indicator
		if (opencontents_ids.indexOf(','+i+',')!=-1){ //if index "i" exists within cookie string or default-enabled string (i=position of the content to expand)
			this.expandcontent(this.headers[i]) //Expand each content per stored indices (if ""Collapse Previous" is set, only one content)
			if (this.collapsePrev) //If "Collapse Previous" set
			this.prevHeader=this.headers[i]  //Indicate the expanded content's corresponding header as the last clicked on header (for logic purpose)
		}
		else //else if no indices found in stored string
			this.contractcontent(this.headers[i]) //Contract each content by default
		this.headers[i].onclick=function(){instanceOf.toggledisplay(this)}
	} //END FOR LOOP
	switchcontent.dotask(window, function(){instanceOf.rememberpluscleanup()}, "unload") //Call persistence method onunload
}


// -------------------------------------------------------------------
// PRIVATE: rememberpluscleanup()- Stores the indices of content that are expanded inside session only cookie
// If "Collapse Previous" is enabled, only 1st expanded content index is stored
// -------------------------------------------------------------------

//Function to store index of opened ULs relative to other ULs in Tree into cookie:
switchcontent.prototype.rememberpluscleanup=function(){
	//Define array to hold ids of open content that should be persisted
	//Default to just "none" to account for the case where no contents are open when user leaves the page (and persist that):
	var opencontents=new Array("none")
	for (var i=0; i<this.innercontents.length; i++){
		//If persistence enabled, content in question is expanded, and either "Collapse Previous" is disabled, or if enabled, this is the first expanded content
		if (this.persistType!="none" && this.innercontents[i].style.display=="block" && (!this.collapsePrev || (this.collapsePrev && opencontents.length<2)))
			opencontents[opencontents.length]=i //save the index of the opened UL (relative to the entire list of ULs) as an array element
		this.headers[i].onclick=null //Cleanup code
	}
	if (opencontents.length>1) //If there exists open content to be persisted
		opencontents.shift() //Boot the "none" value from the array, so all it contains are the ids of the open contents
	if (typeof this.statusOpen!="undefined")
		this.statusOpen=this.statusClosed=null //Cleanup code
	if (this.persistType=="session") //if session only cookie set
		switchcontent.setCookie(this.className, opencontents.join(",")) //populate cookie with indices of open contents: classname=1,2,3,etc
	else if (this.persistType=="days" && typeof this.persistDays=="number"){ //if persistent cookie set instead
		switchcontent.setCookie(this.className+"_d", opencontents.join(","), this.persistDays) //populate cookie with indices of open contents
		//switchcontent.setCookie(this.className+"_dtrack", this.persistDays, this.persistDays) //also remember number of days to persist (int)
	}
}


// -------------------------------------------------------------------
// A few utility functions below:
// -------------------------------------------------------------------


switchcontent.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
	var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false)
	else if (target.attachEvent)
		target.attachEvent(tasktype, functionref)
}

switchcontent.getCookie2=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
//alert("get cookie match for "+Name+" match="+document.cookie.match(re))
	if (document.cookie.match(re)) //if cookie found
		return unescape(document.cookie.match(re)[0].split("=")[1]) //return its value
	return ""
}

switchcontent.setCookie2=function(name, value, days, path){
//alert("set cookie is "+name+"="+value+"; days="+days)
	if (typeof days!="undefined"){ //if set persistent cookie
		var expireDate = new Date()
		var expstring=expireDate.setDate(expireDate.getDate()+days)
//alert("set cookie:"+name+"="+value+"; expires="+expireDate.toGMTString()+"; domain=.rubylane.com; path=/")
		document.cookie = name+"="+escape(value)+"; expires="+expireDate.toGMTString()+"; domain=.rubylane.com; path=/"
	}
	else //else if this is a session only cookie
		document.cookie = name+"="+escape(value)+"; expires=; domain=.rubylane.com; path=/"
}

switchcontent.getCookie=function(Name){
	var sgcookie = switchcontent.getCookie2('sg');
//alert("cookie is "+sgcookie)
        // cookie sg=class1_d:0&class2_d:1&,...
        var re=new RegExp(Name+"-[^&]+", "i"); //construct RE to search for target name/value pair
        if (sgcookie.match(re)) //if cookie found
		return sgcookie.match(re)[0].split("-")[1] //return its value
        return ""
}

switchcontent.setCookie=function(name, value, days, path){
	var sgcookie = switchcontent.getCookie2("sg");
//alert("orig cookie is "+sgcookie)
        // cookie class1_d:0&class1_d:1&,...

	var each_sgcookie = sgcookie.split("&") //get each sg name:value pair

	var newsgcookie = name+"-"+value+"&"
        var re=new RegExp(name+"-", "i"); //construct RE to search for target name/value pair
	for (i = 0; i < each_sgcookie.length; i++){
		if (!each_sgcookie[i].match(re) && each_sgcookie[i] != "" && newsgcookie.length < 2000)
			newsgcookie += each_sgcookie[i]+"&";
	}//ends FOR

	return switchcontent.setCookie2('sg',newsgcookie,days,path)
}
function trap() {
  if(document.images) {
    for(i=0;i<document.images.length;i++) {
      document.images[i].onmousedown = right;
      document.images[i].onmouseup = right;
    }
  }
}

function open_window(url,name,options) {
  window.open(url,name,options);
}

$(document).ready( function(){

        $('.dropdiv_border').fadeTo('fast', 0.4);

        function addMega(){
                 $(this).addClass('hovering');
                 var suffix = $(this).attr('id');
                 h =  ($('#dropdiv_' + suffix).height()+12) ;
                 w =  ($('#dropdiv_' + suffix).width()+12) ;
                 $('#dropdiv_border_' + suffix).height(h);
                 $('#dropdiv_border_' + suffix).width(w);
                 $('#dropdiv_border_' + suffix).show();

        }

        function removeMega(){
                        $('span._mega_rlm').removeClass('hovering');
                        $('.dropdiv_border').hide();
        }

	var hoverConfig = {
         	interval: 200,
         	sensitivity: 4,
         	over: addMega,
         	timeout: 200,
         	out: removeMega
	 };

        //$('span._mega_rlm').hover(addMega, removeMega);
        $('span._mega_rlm').hoverIntent(hoverConfig);

        $('span._mega_rlm').click( function() {
                        var elemid = $(this).attr('id');
                        var selector = '#' +'m_hdn_toplink' + elemid + ' a';
                        var href = $(selector).attr('href');
                        document.location = href;
                });

        $('.dropdiv').click( function(event) {
                        event.stopPropagation();
                });

        $('.closeX').click( function (event)  {
                        event.stopPropagation();
                        removeMega();
                });
});

$(function(){
	//all hover and click logic for buttons
	$(".fg-button:not(.ui-state-disabled)")
	.hover(
		function(){ 
			$(this).addClass("ui-state-hover"); 
		},
		function(){ 
			$(this).removeClass("ui-state-hover"); 
		}
	)
	.mousedown(function(){
		$(this).parents('.fg-buttonset-single:first').find(".fg-button.ui-state-active").removeClass("ui-state-active");
		if( $(this).is('.ui-state-active.fg-button-toggleable, .fg-buttonset-multi .ui-state-active') ){ $(this).removeClass("ui-state-active"); }
			else { $(this).addClass("ui-state-active"); }	
	})
	.mouseup(function(){
		if(! $(this).is('.fg-button-toggleable, .fg-buttonset-single .fg-button,  .fg-buttonset-multi .fg-button') ){
			$(this).removeClass("ui-state-active");
		}
	});
});
