//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2008 Valerio Proietti, <http://mad4milk.net>, MIT Style License.

Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(B,A){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);
if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);}},true);this.element=this.subject=$(B);this.parent(A);var C=this.element.retrieve("wrapper");
this.wrapper=C||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);
this.now=[];this.open=true;},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left";
this.layout="width";this.offset=this.element.offsetWidth;},set:function(A){this.element.setStyle(this.margin,A[0]);this.wrapper.setStyle(this.layout,A[1]);
return this;},compute:function(E,D,C){var B=[];var A=2;A.times(function(F){B[F]=Fx.compute(E[F],D[F],C);});return B;},start:function(B,E){if(!this.check(arguments.callee,B,E)){return this;
}this[E||this.options.mode]();var D=this.element.getStyle(this.margin).toInt();var C=this.wrapper.getStyle(this.layout).toInt();var A=[[D,C],[0,this.offset]];
var G=[[D,C],[-this.offset,0]];var F;switch(B){case"in":F=A;break;case"out":F=G;break;case"toggle":F=(this.wrapper["offset"+this.layout.capitalize()]==0)?A:G;
}return this.parent(F[0],F[1]);},slideIn:function(A){return this.start("in",A);},slideOut:function(A){return this.start("out",A);},hide:function(A){this[A||this.options.mode]();
this.open=false;return this.set([-this.offset,0]);},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset]);},toggle:function(A){return this.start("toggle",A);
}});Element.Properties.slide={set:function(B){var A=this.retrieve("slide");if(A){A.cancel();}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},B));
},get:function(A){if(A||!this.retrieve("slide")){if(A||!this.retrieve("slide:options")){this.set("slide",A);}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));
}return this.retrieve("slide");}};Element.implement({slide:function(D,E){D=D||"toggle";var B=this.get("slide"),A;switch(D){case"hide":B.hide(E);break;case"show":B.show(E);
break;case"toggle":var C=this.retrieve("slide:flag",B.open);B[(C)?"slideOut":"slideIn"](E);this.store("slide:flag",!C);A=true;break;default:B.start(D,E);
}if(!A){this.eliminate("slide:flag");}return this;}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(B,A){this.element=this.subject=$(B);
this.parent(A);var D=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=$(this.element.getDocument().body);}var C=this.element;
if(this.options.wheelStops){this.addEvent("start",function(){C.addEvent("mousewheel",D);},true);this.addEvent("complete",function(){C.removeEvent("mousewheel",D);
},true);}},set:function(){var A=Array.flatten(arguments);this.element.scrollTo(A[0],A[1]);},compute:function(E,D,C){var B=[];var A=2;A.times(function(F){B.push(Fx.compute(E[F],D[F],C));
});return B;},start:function(C,H){if(!this.check(arguments.callee,C,H)){return this;}var E=this.element.getSize(),F=this.element.getScrollSize();var B=this.element.getScroll(),D={x:C,y:H};
for(var G in D){var A=F[G]-E[G];if($chk(D[G])){D[G]=($type(D[G])=="number")?D[G].limit(0,A):A;}else{D[G]=B[G];}D[G]+=this.options.offset[G];}return this.parent([B.x,B.y],[D.x,D.y]);
},toTop:function(){return this.start(false,0);},toLeft:function(){return this.start(0,false);},toRight:function(){return this.start("right",false);},toBottom:function(){return this.start(false,"bottom");
},toElement:function(B){var A=$(B).getPosition(this.element);return this.start(A.x,A.y);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(B,A){this.elements=this.subject=$$(B);
this.parent(A);},compute:function(G,H,I){var C={};for(var D in G){var A=G[D],E=H[D],F=C[D]={};for(var B in A){F[B]=this.parent(A[B],E[B],I);}}return C;
},set:function(B){for(var C in B){var A=B[C];for(var D in A){this.render(this.elements[C],D,A[D],this.options.unit);}}return this;},start:function(C){if(!this.check(arguments.callee,C)){return this;
}var H={},I={};for(var D in C){var F=C[D],A=H[D]={},G=I[D]={};for(var B in F){var E=this.prepare(this.elements[D],B,F[B]);A[B]=E.from;G[B]=E.to;}}return this.parent(H,I);
}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,modifiers:{x:"left",y:"top"}},initialize:function(){var B=Array.link(arguments,{options:Object.type,element:$defined});
this.element=$(B.element);this.document=this.element.getDocument();this.setOptions(B.options||{});var A=$type(this.options.handle);this.handles=(A=="array"||A=="collection")?$$(this.options.handle):$(this.options.handle)||this.element;
this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};
this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);
return this;},start:function(C){if(this.options.preventDefault){C.preventDefault();}this.fireEvent("beforeStart",this.element);this.mouse.start=C.page;
var A=this.options.limit;this.limit={x:[],y:[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue;}if(this.options.style){this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt();
}else{this.value.now[D]=this.element[this.options.modifiers[D]];}if(this.options.invert){this.value.now[D]*=-1;}this.mouse.pos[D]=C.page[D]-this.value.now[D];
if(A&&A[D]){for(var B=2;B--;B){if($chk(A[D][B])){this.limit[D][B]=$lambda(A[D][B])();}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid};
}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop);},check:function(A){if(this.options.preventDefault){A.preventDefault();
}var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});
this.fireEvent("start",this.element).fireEvent("snap",this.element);}},drag:function(A){if(this.options.preventDefault){A.preventDefault();}this.mouse.now=A.page;
for(var B in this.options.modifiers){if(!this.options.modifiers[B]){continue;}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];if(this.options.invert){this.value.now[B]*=-1;
}if(this.options.limit&&this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1];}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0];
}}}if(this.options.grid[B]){this.value.now[B]-=(this.value.now[B]%this.options.grid[B]);}if(this.options.style){this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit);
}else{this.element[this.options.modifiers[B]]=this.value.now[B];}}this.fireEvent("drag",this.element);},cancel:function(A){this.document.removeEvent("mousemove",this.bound.check);
this.document.removeEvent("mouseup",this.bound.cancel);if(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element);
}},stop:function(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);
if(A){this.fireEvent("complete",this.element);}}});Element.implement({makeResizable:function(A){return new Drag(this,$merge({modifiers:{x:"width",y:"height"}},A));
}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false},initialize:function(C,B){this.parent(C,B);this.droppables=$$(this.options.droppables);
this.container=$(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=$(this.container.getDocument().body);}C=this.element;
var D=C.getStyle("position");var A=(D!="static")?D:"absolute";if(C.getStyle("left")=="auto"||C.getStyle("top")=="auto"){C.position(C.getPosition(C.offsetParent));
}C.setStyle("position",A);this.addEvent("start",function(){this.checkDroppables();},true);},start:function(B){if(this.container){var D=this.element,J=this.container,E=J.getCoordinates(D.offsetParent),F={},A={};
["top","right","bottom","left"].each(function(K){F[K]=J.getStyle("padding-"+K).toInt();A[K]=D.getStyle("margin-"+K).toInt();},this);var C=D.offsetWidth+A.left+A.right,I=D.offsetHeight+A.top+A.bottom;
var H=[E.left+F.left,E.right-F.right-C];var G=[E.top+F.top,E.bottom-F.bottom-I];this.options.limit={x:H,y:G};}this.parent(B);},checkAgainst:function(B){B=B.getCoordinates();
var A=this.mouse.now;return(A.x>B.left&&A.x<B.right&&A.y<B.bottom&&A.y>B.top);},checkDroppables:function(){var A=this.droppables.filter(this.checkAgainst,this).getLast();
if(this.overed!=A){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);}if(A){this.overed=A;this.fireEvent("enter",[this.element,A]);}else{this.overed=null;
}}},drag:function(A){this.parent(A);if(this.droppables.length){this.checkDroppables();}},stop:function(A){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed]);
this.overed=null;return this.parent(A);}});Element.implement({makeDraggable:function(A){return new Drag.Move(this,A);}});Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(B,A){this.parent(B,A);
this.load();},save:function(){var A=JSON.encode(this.hash);if(!A||A.length>4096){return false;}if(A=="{}"){this.dispose();}else{this.write(A);}return true;
},load:function(){this.hash=new Hash(JSON.decode(this.read(),true));return this;}});Hash.Cookie.implement((function(){var A={};Hash.each(Hash.prototype,function(C,B){A[B]=function(){var D=C.apply(this.hash,arguments);
if(this.options.autoSave){this.save();}return D;};});return A;})());var Color=new Native({initialize:function(B,C){if(arguments.length>=3){C="rgb";B=Array.slice(arguments,0,3);
}else{if(typeof B=="string"){if(B.match(/rgb/)){B=B.rgbToHex().hexToRgb(true);}else{if(B.match(/hsb/)){B=B.hsbToRgb();}else{B=B.hexToRgb(true);}}}}C=C||"rgb";
switch(C){case"hsb":var A=B;B=B.hsbToRgb();B.hsb=A;break;case"hex":B=B.hexToRgb(true);break;}B.rgb=B.slice(0,3);B.hsb=B.hsb||B.rgbToHsb();B.hex=B.rgbToHex();
return $extend(B,this);}});Color.implement({mix:function(){var A=Array.slice(arguments);var C=($type(A.getLast())=="number")?A.pop():50;var B=this.slice();
A.each(function(D){D=new Color(D);for(var E=0;E<3;E++){B[E]=Math.round((B[E]/100*(100-C))+(D[E]/100*C));}});return new Color(B,"rgb");},invert:function(){return new Color(this.map(function(A){return 255-A;
}));},setHue:function(A){return new Color([A,this.hsb[1],this.hsb[2]],"hsb");},setSaturation:function(A){return new Color([this.hsb[0],A,this.hsb[2]],"hsb");
},setBrightness:function(A){return new Color([this.hsb[0],this.hsb[1],A],"hsb");}});function $RGB(C,B,A){return new Color([C,B,A],"rgb");}function $HSB(C,B,A){return new Color([C,B,A],"hsb");
}function $HEX(A){return new Color(A,"hex");}Array.implement({rgbToHsb:function(){var B=this[0],C=this[1],J=this[2];var G,F,H;var I=Math.max(B,C,J),E=Math.min(B,C,J);
var K=I-E;H=I/255;F=(I!=0)?K/I:0;if(F==0){G=0;}else{var D=(I-B)/K;var A=(I-C)/K;var L=(I-J)/K;if(B==I){G=L-A;}else{if(C==I){G=2+D-L;}else{G=4+A-D;}}G/=6;
if(G<0){G++;}}return[Math.round(G*360),Math.round(F*100),Math.round(H*100)];},hsbToRgb:function(){var C=Math.round(this[2]/100*255);if(this[1]==0){return[C,C,C];
}else{var A=this[0]%360;var E=A%60;var F=Math.round((this[2]*(100-this[1]))/10000*255);var D=Math.round((this[2]*(6000-this[1]*E))/600000*255);var B=Math.round((this[2]*(6000-this[1]*(60-E)))/600000*255);
switch(Math.floor(A/60)){case 0:return[C,B,F];case 1:return[D,C,F];case 2:return[F,C,B];case 3:return[F,D,C];case 4:return[B,F,C];case 5:return[C,F,D];
}}return false;}});String.implement({rgbToHsb:function(){var A=this.match(/\d{1,3}/g);return(A)?hsb.rgbToHsb():null;},hsbToRgb:function(){var A=this.match(/\d{1,3}/g);
return(A)?A.hsbToRgb():null;}});var Group=new Class({initialize:function(){this.instances=Array.flatten(arguments);this.events={};this.checker={};},addEvent:function(B,A){this.checker[B]=this.checker[B]||{};
this.events[B]=this.events[B]||[];if(this.events[B].contains(A)){return false;}else{this.events[B].push(A);}this.instances.each(function(C,D){C.addEvent(B,this.check.bind(this,[B,C,D]));
},this);return this;},check:function(C,A,B){this.checker[C][B]=true;var D=this.instances.every(function(F,E){return this.checker[C][E]||false;},this);if(!D){return ;
}this.checker[C]={};this.events[C].each(function(E){E.call(this,this.instances,A);},this);}});var Asset=new Hash({javascript:function(F,D){D=$extend({onload:$empty,document:document,check:$lambda(true)},D);
var B=new Element("script",{src:F,type:"text/javascript"});var E=D.onload.bind(B),A=D.check,G=D.document;delete D.onload;delete D.check;delete D.document;
B.addEvents({load:E,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){E();}}}).setProperties(D);if(Browser.Engine.webkit419){var C=(function(){if(!$try(A)){return ;
}$clear(C);E();}).periodical(50);}return B.inject(G.head);},css:function(B,A){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:B},A)).inject(document.head);
},image:function(C,B){B=$merge({onload:$empty,onabort:$empty,onerror:$empty},B);var D=new Image();var A=$(D)||new Element("img");["load","abort","error"].each(function(E){var F="on"+E;
var G=B[F];delete B[F];D[F]=function(){if(!D){return ;}if(!A.parentNode){A.width=D.width;A.height=D.height;}D=D.onload=D.onabort=D.onerror=null;G.delay(1,A,A);
A.fireEvent(E,A,1);};});D.src=A.src=C;if(D&&D.complete){D.onload.delay(1);}return A.setProperties(B);},images:function(D,C){C=$merge({onComplete:$empty,onProgress:$empty},C);
if(!D.push){D=[D];}var A=[];var B=0;D.each(function(F){var E=new Asset.image(F,{onload:function(){C.onProgress.call(this,B,D.indexOf(F));B++;if(B==D.length){C.onComplete();
}}});A.push(E);});return new Elements(A);}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(A,B){this.setOptions(B);
this.elements=[];this.lists=[];this.idle=true;this.addLists($$($(A)||A));if(!this.options.clone){this.options.revert=false;}if(this.options.revert){this.effect=new Fx.Morph(null,$merge({duration:250,link:"cancel"},this.options.revert));
}},attach:function(){this.addLists(this.lists);return this;},detach:function(){this.lists=this.removeLists(this.lists);return this;},addItems:function(){Array.flatten(arguments).each(function(A){this.elements.push(A);
var B=A.retrieve("sortables:start",this.start.bindWithEvent(this,A));(this.options.handle?A.getElement(this.options.handle)||A:A).addEvent("mousedown",B);
},this);return this;},addLists:function(){Array.flatten(arguments).each(function(A){this.lists.push(A);this.addItems(A.getChildren());},this);return this;
},removeItems:function(){var A=[];Array.flatten(arguments).each(function(B){A.push(B);this.elements.erase(B);var C=B.retrieve("sortables:start");(this.options.handle?B.getElement(this.options.handle)||B:B).removeEvent("mousedown",C);
},this);return $$(A);},removeLists:function(){var A=[];Array.flatten(arguments).each(function(B){A.push(B);this.lists.erase(B);this.removeItems(B.getChildren());
},this);return $$(A);},getClone:function(B,A){if(!this.options.clone){return new Element("div").inject(document.body);}if($type(this.options.clone)=="function"){return this.options.clone.call(this,B,A,this.list);
}return A.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:A.getStyle("width")}).inject(this.list).position(A.getPosition(A.getOffsetParent()));
},getDroppables:function(){var A=this.list.getChildren();if(!this.options.constrain){A=this.lists.concat(A).erase(this.list);}return A.erase(this.clone).erase(this.element);
},insert:function(C,B){var A="inside";if(this.lists.contains(B)){this.list=B;this.drag.droppables=this.getDroppables();}else{A=this.element.getAllPrevious().contains(B)?"before":"after";
}this.element.inject(B,A);this.fireEvent("sort",[this.element,this.clone]);},start:function(B,A){if(!this.idle){return ;}this.idle=false;this.element=A;
this.opacity=A.get("opacity");this.list=A.getParent();this.clone=this.getClone(B,A);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){B.stop();
this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone]);}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});
this.clone.inject(this.element,"before");this.drag.start(B);},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var A=this.element.getStyles("width","height");
var B=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:B.top,left:B.left,width:A.width,height:A.height,opacity:0.25}).chain(this.reset.bind(this));
}else{this.reset();}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent("complete",this.element);},serialize:function(){var C=Array.link(arguments,{modifier:Function.type,index:$defined});
var B=this.lists.map(function(D){return D.getChildren().map(C.modifier||function(E){return E.get("id");},this);},this);var A=C.index;if(this.lists.length==1){A=0;
}return $chk(A)&&A>=0&&A<this.lists.length?B[A]:B;}});var Tips=new Class({Implements:[Events,Options],options:{onShow:function(A){A.setStyle("visibility","visible");
},onHide:function(A){A.setStyle("visibility","hidden");},showDelay:100,hideDelay:100,className:null,offsets:{x:16,y:16},fixed:false},initialize:function(){var C=Array.link(arguments,{options:Object.type,elements:$defined});
this.setOptions(C.options||null);this.tip=new Element("div").inject(document.body);if(this.options.className){this.tip.addClass(this.options.className);
}var B=new Element("div",{"class":"tip-top"}).inject(this.tip);this.container=new Element("div",{"class":"tip"}).inject(this.tip);var A=new Element("div",{"class":"tip-bottom"}).inject(this.tip);
this.tip.setStyles({position:"absolute",top:0,left:0,visibility:"hidden"});if(C.elements){this.attach(C.elements);}},attach:function(A){$$(A).each(function(D){var G=D.retrieve("tip:title",D.get("title"));
var F=D.retrieve("tip:text",D.get("rel")||D.get("href"));var E=D.retrieve("tip:enter",this.elementEnter.bindWithEvent(this,D));var C=D.retrieve("tip:leave",this.elementLeave.bindWithEvent(this,D));
D.addEvents({mouseenter:E,mouseleave:C});if(!this.options.fixed){var B=D.retrieve("tip:move",this.elementMove.bindWithEvent(this,D));D.addEvent("mousemove",B);
}D.store("tip:native",D.get("title"));D.erase("title");},this);return this;},detach:function(A){$$(A).each(function(C){C.removeEvent("mouseenter",C.retrieve("tip:enter")||$empty);
C.removeEvent("mouseleave",C.retrieve("tip:leave")||$empty);C.removeEvent("mousemove",C.retrieve("tip:move")||$empty);C.eliminate("tip:enter").eliminate("tip:leave").eliminate("tip:move");
var B=C.retrieve("tip:native");if(B){C.set("title",B);}});return this;},elementEnter:function(B,A){$A(this.container.childNodes).each(Element.dispose);
var D=A.retrieve("tip:title");if(D){this.titleElement=new Element("div",{"class":"tip-title"}).inject(this.container);this.fill(this.titleElement,D);}var C=A.retrieve("tip:text");
if(C){this.textElement=new Element("div",{"class":"tip-text"}).inject(this.container);this.fill(this.textElement,C);}this.timer=$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this);
this.position((!this.options.fixed)?B:{page:A.getPosition()});},elementLeave:function(A){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this);
},elementMove:function(A){this.position(A);},position:function(D){var B=window.getSize(),A=window.getScroll();var E={x:this.tip.offsetWidth,y:this.tip.offsetHeight};
var C={x:"left",y:"top"};for(var F in C){var G=D.page[F]+this.options.offsets[F];if((G+E[F]-A[F])>B[F]){G=D.page[F]-this.options.offsets[F]-E[F];}this.tip.setStyle(C[F],G);
}},fill:function(A,B){(typeof B=="string")?A.set("html",B):A.adopt(B);},show:function(){this.fireEvent("show",this.tip);},hide:function(){this.fireEvent("hide",this.tip);
}});var SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(B,C){C=C||document;var E=C.getDocument(),D=C.getWindow();this.parent(E,B);this.links=(this.options.links)?$$(this.options.links):$$(E.links);
var A=D.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(G){if(G.href.indexOf(A)!=0){return ;}var F=G.href.substr(A.length);if(F&&$(F)){this.useLink(G,F);
}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){D.location.hash=this.anchor;},true);}},useLink:function(B,A){B.addEvent("click",function(C){this.anchor=A;
this.toElement(A);C.stop();}.bind(this));}});var Slider=new Class({Implements:[Events,Options],options:{onTick:function(A){if(this.options.snap){A=this.toPosition(this.step);
}this.knob.setStyle(this.property,A);},snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(E,A,D){this.setOptions(D);
this.element=$(E);this.knob=$(A);this.previousChange=this.previousEnd=this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bind(this));if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement.bindWithEvent(this));
}var F,B={},C={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";F="offsetHeight";break;case"horizontal":this.axis="x";
this.property="left";F="offsetWidth";}this.half=this.knob[F]/2;this.full=this.element[F]-this.knob[F]+(this.options.offset*2);this.min=$chk(this.options.range[0])?this.options.range[0]:0;
this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;
this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,-this.options.offset);C[this.axis]=this.property;
B[this.axis]=[-this.options.offset,this.full-this.options.offset];this.drag=new Drag(this.knob,{snap:0,limit:B,modifiers:C,onDrag:this.draggedKnob.bind(this),onStart:this.draggedKnob.bind(this),onComplete:function(){this.draggedKnob();
this.end();}.bind(this)});if(this.options.snap){this.drag.options.grid=Math.ceil(this.stepWidth);this.drag.options.limit[this.axis][1]=this.full;}},set:function(A){if(!((this.range>0)^(A<this.min))){A=this.min;
}if(!((this.range>0)^(A>this.max))){A=this.max;}this.step=Math.round(A);this.checkStep();this.end();this.fireEvent("tick",this.toPosition(this.step));return this;
},clickedElement:function(C){var B=this.range<0?-1:1;var A=C.page[this.axis]-this.element.getPosition()[this.axis]-this.half;A=A.limit(-this.options.offset,this.full-this.options.offset);
this.step=Math.round(this.min+B*this.toStep(A));this.checkStep();this.end();this.fireEvent("tick",A);},scrolledElement:function(A){var B=(this.options.mode=="horizontal")?(A.wheel<0):(A.wheel>0);
this.set(B?this.step-this.stepSize:this.step+this.stepSize);A.stop();},draggedKnob:function(){var B=this.range<0?-1:1;var A=this.drag.value.now[this.axis];
A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep();},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;
this.fireEvent("change",this.step);}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"");
}},toStep:function(A){var B=(A+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(B-=B%this.stepSize):B;},toPosition:function(A){return(this.full*Math.abs(this.min-A))/(this.steps*this.stepSize)-this.options.offset;
}});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(A,B){this.element.scrollTo(A,B);}},initialize:function(B,A){this.setOptions(A);
this.element=$(B);this.listener=($type(this.element)!="element")?$(this.element.getDocument().body):this.element;this.timer=null;this.coord=this.getCoords.bind(this);
},start:function(){this.listener.addEvent("mousemove",this.coord);},stop:function(){this.listener.removeEvent("mousemove",this.coord);this.timer=$clear(this.timer);
},getCoords:function(A){this.page=(this.listener.get("tag")=="body")?A.client:A.page;if(!this.timer){this.timer=this.scroll.periodical(50,this);}},scroll:function(){var B=this.element.getSize(),A=this.element.getScroll(),E=this.element.getPosition(),D={x:0,y:0};
for(var C in this.page){if(this.page[C]<(this.options.area+E[C])&&A[C]!=0){D[C]=(this.page[C]-this.options.area-E[C])*this.options.velocity;}else{if(this.page[C]+this.options.area>(B[C]+E[C])&&B[C]+B[C]!=A[C]){D[C]=(this.page[C]-B[C]+this.options.area-E[C])*this.options.velocity;
}}}if(D.y||D.x){this.fireEvent("change",[A.x+D.x,A.y+D.y]);}}});var Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var C=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});
this.parent(C.elements,C.options);this.togglers=$$(C.togglers);this.container=$(C.container);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true;
}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show;}if(this.options.start){this.options.display=false;this.options.show=false;
}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity";}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth";
}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight";}for(var B=0,A=this.togglers.length;B<A;B++){this.addSection(this.togglers[B],this.elements[B]);
}this.elements.each(function(E,D){if(this.options.show===D){this.fireEvent("active",[this.togglers[D],E]);}else{for(var F in this.effects){E.setStyle(F,0);
}}},this);if($chk(this.options.display)){this.display(this.options.display);}},addSection:function(E,C,G){E=$(E);C=$(C);var F=this.togglers.contains(E);
var B=this.togglers.length;this.togglers.include(E);this.elements.include(C);if(B&&(!F||G)){G=$pick(G,B-1);E.inject(this.togglers[G],"before");C.inject(E,"after");
}else{if(this.container&&!F){E.inject(this.container);C.inject(this.container);}}var A=this.togglers.indexOf(E);E.addEvent("click",this.display.bind(this,A));
if(this.options.height){C.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"});}if(this.options.width){C.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"});
}C.fullOpacity=1;if(this.options.fixedWidth){C.fullWidth=this.options.fixedWidth;}if(this.options.fixedHeight){C.fullHeight=this.options.fixedHeight;}C.setStyle("overflow","hidden");
if(!F){for(var D in this.effects){C.setStyle(D,0);}}return this;},display:function(A){A=($type(A)=="element")?this.elements.indexOf(A):A;if((this.timer&&this.options.wait)||(A===this.previous&&!this.options.alwaysHide)){return this;
}this.previous=A;var B={};this.elements.each(function(E,D){B[D]={};var C=(D!=A)||(this.options.alwaysHide&&(E.offsetHeight>0));this.fireEvent(C?"background":"active",[this.togglers[D],E]);
for(var F in this.effects){B[D][F]=C?0:E[this.effects[F]];}},this);return this.start(B);}});var toolTips={
	current: null,
	init:function(){
		$$('.toolTip').each(function(item,index){
			if(item.title != ""){
				item.set("rel",item.title);
				item.title="";
				item.addEvent('mouseenter',function(event){
					if(toolTips.current != this){
						toolTips.current = this;
						if($('tip')){
							$('tip').destroy();	
						}
						var type 	= this.get("rel").split(":");
						var pos  	= this.getPosition();
						var size 	= this.getSize();
						if(type[2]){
							pos  	= $(type[2]).getPosition();
							size 	= $(type[2]).getSize();
						}
						var message = type[1] || type[0];
						type 		= type[0] || "tip";
						var HTML = "<div class='tipTop'></div><div class='tipText'>" + message + "</div><div class='tipBottom'></div>";
						var elm  = new Element("div",{
											  'id': 'tip',
											  'class': type,
											  'html' : HTML, 
											  'opacity' : 0,
											  'styles' : 
												{
												  'position': 'absolute',
												  'z-index': 9999,
												  'left' : pos.x + size.x - 5,
												  'top' : (pos.y + 5)
												  }
											  });
						$(elm).injectInside(document.body);
						switch(type){
							case "lb":
								$(elm).style.top = (pos.y -  $(elm).getSize().y) + "px";
							break;
						}
						if(!Browser.Engine.trident){
							$(elm).fade("in");
						}else{
							$(elm).set("opacity",1); //Opacity(1);	
						}
					}
				});
				item.addEvent('mouseleave',function(){
					try{
						if(!Browser.Engine.trident){
							$('tip').fade("out");
						}else{
							$('tip').destroy();	
						}
					}catch(e){}
					toolTips.current = null;
				});
			}
		});
	}
};
window.addEvent('domready',toolTips.init);

var staffTips={
	current: null,
	descriptions: Array(),
	init:function(){
		$$('td').each(function(item,index){
				var staff = $(item).getElement('img');				  
				var description = $(item).getElement('.description');
				if(staff && description){
					staffTips.descriptions[index] = $(description).get("html");
					item.set("rel",index);
					$(description).addClass("hide");
					item.addEvent('mouseenter',function(){
						if(staffTips.descriptions[this.get("rel")]){
							if($('stafftip')){
								$('stafftip').destroy();	
							}
							var pos  	= this.getPosition();
							var size 	= this.getSize();
							var HTML = "<div class='tipTop'></div><div class='tipText'>" + staffTips.descriptions[this.get("rel")] + "</div><div class='tipBottom'></div>";
							var elm  = new Element("div",{
												  'id': 'stafftip',
												  'class': 'stafftip',
												  'html' : HTML, 
												  'opacity' : 0,
												  'styles' : 
													{
													  'position': 'absolute',
													  'z-index': 9999,
													  'left' : pos.x + (size.x/2),
													  'top' : (pos.y)
													  }
												  });
							$(elm).injectInside(document.body);
							$(elm).style.top = ((pos.y - $(elm).getSize().y) + 10)+ "px";
							if(!Browser.Engine.trident){
								$(elm).fade("in");
							}else{
								$(elm).set("opacity",1); //Opacity(1);	
							}
						}
					});
					item.addEvent('mouseleave',function(){
						if(!Browser.Engine.trident){
							$('stafftip').fade("out");
						}else{
							$('stafftip').destroy();	
						}
						staffTips.current = null;
					});
				}
		});
	}
};
window.addEvent('domready',staffTips.init);var accord = new Class({
	initialize: function(){
		this.curr 		= null;
		this.showElm 	= 0;
		$$('.accordian').each(function(item,index){
			if(accord.curr==null || accord.curr != item){
				accord.curr = item;
				accord.showElm = 0;
			}
			var headings = $(item).getElements('.accord_title');
			var bodys	 = $(item).getElements('.accord_body');
			headings.each(function(head,i){
				if(head.hasClass('show')){
					accord.showElm = i;
				}
			});
			var setAccordian = new Accordion(headings,bodys,{
				display: 0,
				opacity: false,
				show: accord.showElm,
				alwaysHide: true
			},$(item));
			headings.each(function(heading,index){
				heading.removeEvents('mouseenter');
				heading.removeEvents('mouseleave');
				heading.addEvent('mouseenter',function(){
					heading.removeClass("accord_title");
					heading.addClass("accord_titleOvr");
				});
				heading.addEvent('mouseleave',function(){
					heading.removeClass("accord_titleOvr");
					heading.addClass("accord_title");
				});
			});
		});
	}
});
var pageAccord;								// Global accordian object
window.addEvent('domready', function(){
		pageAccord = new accord();
});var validate={
	allforms:Array(),
	ajax:Array(),
	hider:Array(),
	titles: Array(),
	unloading: false,
	decimal:function(objText){
		var cleanedInt='';
		var decimalPlaces = 2;
		var options = objText.alt.split(',');
		if(options[2] != "" && !isNaN(options[2])){
			decimalPlaces = parseInt(options[2]);
		}
		objText.value=objText.value.replace(/ /g,'');
		for(var i=0;i<objText.value.length;i++){
			if((!isNaN(objText.value.charAt(i))||objText.value.charAt(i)==".") && objText.value.charAt(i) !=0){
				cleanedInt+=objText.value.charAt(i);
			}
		}
		if(cleanedInt.indexOf('.')!=-1){
			cleanedInt=cleanedInt.substring(0,cleanedInt.indexOf('.')+1+parseInt(decimalPlaces));
		}
		objText.value=cleanedInt;
	},
	phone:function(objText){
		// No checking for this yet
	},
	integer:function(objText){
		var cleanedInt='';
		objText.value=objText.value.replace(/ /g,'');
		for(var i=0;i<objText.value.length;i++){
			if(!isNaN(objText.value.charAt(i))){
				cleanedInt+=objText.value.charAt(i);
			}
		}
		objText.value=cleanedInt;
	},
	changeStyles: function(obj){
		obj.removeClass("error");
		obj.removeClass("input");
		obj.addClass("focus");
		if(DisplayDate.calender){
			DisplayDate.removeCalender();	
		}
	},
	init:function(){
		$$('input.required').each(function(item,index){
			item.removeEvents();
			item.addEvent('blur',function(){this.removeClass("focus"); this.addClass("input");});
			item.addEvent('focus',function(){validate.changeStyles(this);});
		});
		$$('textarea.required').each(function(item,index){
			item.removeEvents();
			item.addEvent('blur',function(){this.removeClass("focus"); this.addClass("input");});
			item.addEvent('focus',function(){validate.changeStyles(this);});							   
		});
		$$('select.required').each(function(item,index){
			item.removeEvents();
			item.addEvent('blur',function(){this.removeClass("focus"); this.addClass("input");});
			item.addEvent('focus',function(){validate.changeStyles(this);});							   
		});
		$$('input.integer').each(function(item,index){
			item.removeEvents('keyup');
			item.removeEvents('keydown');
			item.addEvent('keyup',function(event){validate.integer(this);});
			item.addEvent('blur',function(){validate.integer(this);});
			item.addEvent('keydown',function(event){
				var ev = new Event(event); 
				if((ev.code < 48 || ev.code > 57)
				&& (ev.code < 96 || ev.code > 105)
				&& (ev.code < 37 || ev.code > 40)
				&& ev.code != 46
				&& ev.code != 8
				&& ev.code != 9
				&& ev.code != 13){ 
						ev.stop();
					}
			});
		});
		$$('input.decimal').each(function(item,index){
			item.removeEvents('keyup');
			item.removeEvents('keydown');
			item.addEvent('keyup',function(){validate.decimal(this);});
			item.addEvent('blur',function(){validate.decimal(this);});
			item.addEvent('keydown',function(event){
				var ev = new Event(event); 
				if((ev.code < 48 || ev.code > 57)
				&& (ev.code < 96 || ev.code > 105)
				&& (ev.code < 37 || ev.code > 40)
				&& ev.code != 46
				&& ev.code != 8
				&& ev.code != 9
				&& ev.code != 90
				&& ev.code != 13){ 
						ev.stop();
					}
			});
		});
		$$('input.credit').each(function(item,index){
			item.removeEvents('keyup');
			item.removeEvents('keydown');
			item.addEvent('keyup',function(){validate.integer(this);});
			item.addEvent('keydown',function(event){var ev = new Event(event); if(ev.code=="32"){ ev.stop();}});
		});
		$$('input.email').each(function(item,index){
			item.removeEvents('keydown');
			item.addEvent('keydown',function(event){var ev = new Event(event); if(ev.code=="32"){ ev.stop();}});
		});
		$$('textarea.required').each(function(item,index){
			item.removeEvents('keydown');
			var option=item.title.split(',');
			if($defined(option[2])){
				item.addEvent('keydown',function(event){							 
					var ev = new Event(event);
					if(this.value.length>=option[2] && (ev.code!=37 && ev.code!=38 && ev.code!=39 && ev.code!=40 && ev.code!=8)){
						ev.stop();
						if($defined($(this.name))){
							return false;
						}
						var elem=new Element('span',{'class':'validateError','id':this.name});
						$(elem).setOpacity(0);
						if($defined(option[1])){
							switch(option[1]){
								case"after":
									$(elem).innerHTML="You cannot enter more than "+option[2]+" characters";
									$(elem).injectAfter($(this));
									var myFx=new Fx.Tween($(elem)).start('opacity',1);
									break;
								case"before":
									$(elem).innerHTML="You cannot enter more than "+option[2]+" characters";
									$(elem).injectBefore($(this));
									$(elem).style.position="relative";
									var myFx=new Fx.Tween($(elem)).start('opacity',1);
									break;
							}
						}else{
							alert("You cannot enter more than "+option[2]+" characters");
						}
					}
				});
			}
		});

		$$('form.required').each(function(item,index){
			item.removeEvents('submit');
			item.removeEvents('reset');
			item.addEvent('submit',function(event){if(!validate.forms(this)){event=new Event(event).stop();}});
			item.addEvent('reset',function(){
				var displayError=$(this).getElement('input[name=errorout]');
				if($defined($(displayError))){
					$(displayError.value).set("html","");
					$(displayError.value).set('class','hide');	
				}
				$(this).getElements('.error').each(function(item,index){
					$(item).removeClass("error");
					$(item).addClass("input");
				});
				$(this).getElements('.validateError').each(function(item,index){
					$(item).destroy();
				});
			});
		});
			$$('.button').each(function(item,index){
				item.removeEvents();
				item.addEvent('mouseenter',function(){
					this.removeClass("button");
					this.removeClass("buttonDwn");
					this.addClass("buttonOvr");
				});
				item.addEvent('mousedown',function(){
					this.removeClass("button");
					this.removeClass("buttonOvr");
					this.addClass("buttonDwn");
				});
				item.addEvent('mouseup',function(){
					this.removeClass("buttonDwn");
					this.removeClass("buttonOvr");
					this.addClass("button");
				});
				item.addEvent('mouseleave',function(){
					this.removeClass("buttonDwn");
					this.removeClass("buttonOvr");
					this.addClass("button");
				});
			});
		},
		checkEmailAddr:function(objText){
			var emailAddress=escape(objText.value);
			if(emailAddress.indexOf('%20')!=-1||emailAddress.indexOf('@')==-1||emailAddress.indexOf('.')==-1){
				return false;
			}
			return true;
		},
		checkCreditNumber:function(objText){
			var checksum=0;
			var validVisa=new RegExp(/^(4\d{3}\d{4}\d{4}\d{4})|(4\d{3}\d{4}\d{4}\d{1})$/);
			var validDinersMaster=new RegExp(/^(5[1-5]\d{2}\d{4}\d{4}\d{4})|(3[0,6,8]\d{2}\d{4}\d{4}\d{2})$/);
			var validAmexDiscover=new RegExp(/^(3[4,7]\d{2}\d{4}\d{4}\d{1})|(6011\d{4}\d{4}\d{4})$/);
			if(validVisa.test(objText.value)==false){
				if(validDinersMaster.test(objText.value)==false){
					if(validAmexDiscover.test(objText.value)==false){
						return false;
					}
				}
			}
			for(var i=(2-(objText.value.length%2));i<=objText.value.length;i+=2){
				checksum+=parseInt(objText.value.charAt(i-1));
			}
			for(var i=(objText.value.length%2)+1;i<objText.value.length;i+=2){
				var digit=parseInt(objText.value.charAt(i-1))*2;
				if(digit<10){
					checksum+=digit;
				}else{
					checksum+=(digit-9);
				}
			}
			if((checksum%10)==0){
				return true;
			}else{
				return false;
			}
		},
		showMessage:function(obj,noError){
			var options;
			if(obj.alt){
				options=obj.alt.split(",");
			}else{
				options=obj.title.split(",");
			}
			var elem=new Element('span',{'class':'validateError','id':obj.name});
			$(elem).setOpacity(0);
			if(noError!="no"){
				$(obj).addClass('error');
				$(obj).removeClass('input');
			}
			if($defined(options[1])){
				switch(options[1]){
					case"after":
						$(elem).innerHTML=options[0];
						$(elem).injectAfter($(obj));
						var myFx=new Fx.Tween($(elem)).start('opacity',1);
						break;
					case"before":
						$(elem).innerHTML=options[0];
						$(elem).injectBefore($(obj));
						$(elem).style.position="relative";
						var myFx=new Fx.Tween($(elem)).start('opacity',1);
						break;
					default:
						if($defined(options[0])){
							return options[0]+"<br />";
						}
				}
				return "";
			}else{
				return options[0]+"<br />";
			}
		},
		forms:function(objForm){
			var self=validate;
			var displayError,requestType,outputResult,formElements;
			var errorMessage="";
			var isFormValid=true;
			requestType=$(objForm).getElement('input[name=ajax]');
			displayError=$(objForm).getElement('input[name=errorout]');
			outputResult=$(objForm).getElement('input[name=output]');
			formElements=$(objForm).getElements('input.required');
			requestType=(requestType)?requestType.value:null;
			displayError=(displayError)?displayError.value:null;
			outputResult=(outputResult)?outputResult.value:null;
			if(displayError != "" && displayError != null && $defined($(displayError))){
				$(displayError).addClass("hide");
			}
			$(objForm).getElements('.validateError').each(function(item,index){item.destroy();});
			var radioGroup=Array();var isTrue=Array();
			$(objForm).getElements("select.required").each(function(item,index){
				$(item).removeClass("error");
				$(item).addClass("select");
				if(item.value==""){
					if(item.title!=""){
						errorMessage+=validate.showMessage(item);
					}else{
						errorMessage+="Please Select an Option From: "+item.name+"<br />";
					}
					$(item).addClass("error");
					$(item).removeClass("select");
					isFormValid=false;
				}
			});
			$(objForm).getElements("textarea.required").each(function(item,index){
				$(item).addClass("select");
				$(item).removeClass("error");
				if($defined(item.value)){
					if(item.value.length<3){
						if($defined(item.title)&&item.title!=""){
							errorMessage+=validate.showMessage(item);
						}else{
							errorMessage+="Please Fill in: "+item.name+"<br />";
							$(item).addClass("error");$(item).removeClass("select");
						}
						isFormValid=false;
					}
				}
			});
			$(objForm).getElements("input.required").each(function(item,index){
				$(item).removeClass("error");
				$(item).addClass("input");
				var option = item.alt.split(',');
				if(item.hasClass('minlen') && !isNaN(option[2]) && item.value != ""){
					var itemname = item.name.split('_');
					var cleanName = "";
					itemname.each(function(item,index){
						if(cleanName != ""){
							cleanName += " ";
						}
						cleanName += item;				   
					});
					if(item.value.length < parseInt(option[2])){
						isFormValid=false;
						$(item).addClass("error");
						$(item).removeClass("input");
						var elem=new Element('span',{'class':'validateError','id':item.name});
						$(elem).setOpacity(0);
						if($defined(option[1])){
							switch(option[1]){
								case"after":
									$(elem).innerHTML="Too few letters for: " + cleanName + ", it must be "+ option[2] +" letters or more";
									$(elem).injectAfter($(item));
									var myFx=new Fx.Tween($(elem)).start('opacity',1);
									break;
								case"before":
									$(elem).innerHTML="Too few letters for: " + cleanName + ", it must be "+ option[2] +" letters or more";
									$(elem).injectBefore($(item));
									$(elem).style.position="relative";
									var myFx=new Fx.Tween($(elem)).start('opacity',1);
									break;
								default:
									errorMessage+= "Too few letters for: " + cleanName + ", it must be "+ option[2] +" letters or more<br />";
							}
						}else{
							errorMessage+= "Too few letters for: " + cleanName + ", it must be "+ option[2] +" letters or more<br />";
						}
					}
				}
				if(item.value.trim()==""		&&
				   !$(item).hasClass("email")	&&
				   !$(item).hasClass("credit")	&&
				   !$(item).hasClass("search")	&&
				   $(item).type!="checkbox"		&&
				   !$(item).hasClass("group")){
					if($defined(item.alt)&&item.alt!=""){
						errorMessage+=validate.showMessage(item);
					}else{
						errorMessage+="Please Fill in: "+item.name+"<br />";
						$(item).addClass("error");
						$(item).removeClass("input");
					}
					isFormValid=false;
				}
				if($(item).hasClass("search")){
					if(item.value.length<2){
						if($defined(item.alt)&&item.alt!=""){
							errorMessage+=validate.showMessage(item);
						}else{
							errorMessage+="Search Critera Needed For: "+item.name+"<br />";
							$(item).addClass("error");
							$(item).removeClass("input");
						}
					}
					isFormValid=false;
				}
				if($(item).type=="checkbox"){
					if(!item.checked){
						if($defined(item.alt)&&item.alt!=""){
							errorMessage+=validate.showMessage(item);
						}else{
							errorMessage+="You must Accept the Option of: "+item.name+"<br />";
							$(item).addClass("error");
							$(item).removeClass("input");
						}
						isFormValid=false;
					}
				}
				if($(item).hasClass("email")){
					if(!validate.checkEmailAddr(item)){
						if($defined(item.alt)&&item.alt!=""){
							errorMessage+=validate.showMessage(item);
						}else{
							errorMessage+="Please check the Email address in: "+item.name+"<br />";
							$(item).addClass("error");
							$(item).removeClass("input");
						}
						isFormValid=false;
					}
				}
				if($(item).hasClass("credit")){
					if(!validate.checkCreditNumber(item)){
						if($defined(item.alt)&&item.alt!=""){
							errorMessage+=validate.showMessage(item);
						}else{
							errorMessage+="Please check the Card Number for: "+item.name+"<br />";
							$(item).addClass("error");
							$(item).removeClass("input");
						}
						isFormValid=false;
					}
				}
			});
			var allRadioGroups=$(objForm).getElements("input[type=radio]");
			var tmp=Array();
			var currentRadio="";
			allRadioGroups.each(function(item,index){
				$(objForm).getElements('input[name='+item.name+']').each(function(singleGroup){
					if(singleGroup.getProperty('checked')){
						tmp[item.name]=true;
					}
				});
				if(tmp[item.name]!=true&&item.name!=currentRadio){
					if(item.alt!=""){
						errorMessage+=validate.showMessage(item,"no");
					}else{
						errorMessage+="Please select an option for: "+item.name+"<br />";
					}
					isFormValid=false;
					currentRadio=item.name;
				}
			});
			if(isFormValid&&(requestType=="ajax"||requestType=="json"||requestType=='extra')){
				if(requestType=='extra'){
					try{
						var tmp=$(objForm).getElement('input[name=extra]');
						tmp=tmp.value;tmp=eval(tmp);tmp(objForm);
					}catch(e){}
					$(objForm).reset();
					return false;
				}
				if($defined(validate.ajax[objForm])){
					validate.ajax[objForm].cancel();
					validate.ajax[objForm]=null;
				}
				if(requestType=="json"){
					var tempForm=objForm;
					validate.greyForm(tempForm);
					var useAjax=$(tempForm).getElement('input[name=ajax]');
					useAjax.value="usingJson";
					validate.ajax[objForm] = new Request.JSON({
						url:objForm.action,
						method:(objForm.method)?objForm.method:"post",
						onSuccess:function(res){
							validate.restoreForm(tempForm.id);
							useAjax.value="json";
							var tmp=$(tempForm).getElement('input[name=extra]');
							tmp=tmp.value;
							tmp=eval(tmp);
							tmp(res);
							validate.updateFormHiders();
						},
						onFailure:function(){
							if(validate.unloading==false){
								useAjax.value="json";
								validate.restoreForm(tempForm.id);
								alert("Im Sorry, I could not send The Information");
							}
						},
						onException:function(){
							if(validate.unloading==false){
								useAjax.value="json";
								validate.restoreForm(tempForm.id);
								alert("Im Sorry, I could not send The Information");
							}
						}
					}).post(objForm);
					return false;
				}
				if(requestType=="ajax"){
					var tempForm=objForm;
					var showResult=outputResult;
					var useAjax=$(tempForm).getElement('input[name=ajax]');
					var noAlert=$(tempForm).getElement('input[name=noalert]');
					var noHide=$(tempForm).getElement('input[name=nohide]');
					if(!$defined(noHide)){
						noHide=true;validate.greyForm(tempForm);
					}else{
						noHide=false;
					}
					if(!$defined(noAlert)){
						noAlert=true;
					}else{
						noAlert=false;
					}
					useAjax.value="usingAjax";
					validate.ajax[objForm] = new Request.HTML({
						url:objForm.action,
						method:(objForm.method)?objForm.method:"post",
						onSuccess:function(response,elements,html,scripts){
							if(noHide){
								validate.restoreForm(tempForm.id);
							}
							useAjax.value="ajax";
							if($type($(showResult))=='element'){
								$(showResult).set("html",html);
								try{validate.init();}catch(e){}
								try{editInPlace.init();}catch(e){}
								try{displayPopUp.init();}catch(e){}
								try{DisplayDate.init();}catch(e){}
								try{
									$(showResult).getElements('input[type=file]').each(function(item,index){
										var newup = new uploader(item);
										uploaders.push(newup);				// Add uploader to the upload array								  
									});
								}catch(e){}
							}else{
								if(noAlert){
									alert(html);
								}
							}
							validate.updateFormHiders();
						},
						onFailure:function(){
							useAjax.value="ajax";
							if(validate.unloading==false){
								validate.restoreForm(tempForm.id);
								alert("Im sorry, I could not complete your request");
							}
						},
						onException:function(){
							if(validate.unloading==false){
								useAjax.value="ajax";
								validate.restoreForm(tempForm.id);
								alert("Im Sorry, I could not send The Information");
							}
						}
					}).post($(objForm));
					return false;
				}
			}
			if (!isFormValid && errorMessage != '') {
				if($defined($(displayError))) {
					$(displayError).removeClass("hide");
					$(displayError).addClass("error");
					$(displayError).set("html", errorMessage);
					validate.updateFormHiders();
				}
				else {
					var trimmed = errorMessage.replace(/<br \/>/g, '');
					trimmed = trimmed.replace(/ /g, '');
					errorMessage = errorMessage.replace(/<br \/>/g, '\r\n');
					if (trimmed.trim() != "") {
						alert(errorMessage);
					}
				}
			}
			return isFormValid;
		},
		greyForm:function(objFormName){
			if(Browser.Engine.trident && Browser.Engine.version < 5){
				$(document.body).getElements('select').each(function(item,index){
					item.fade('out');
				});
			}
			var pos=$(objFormName).getPosition();
			var size=$(objFormName).getSize();
			var formHider=new Element('div',{
				'styles':{
					'top':pos.y+"px",
					'left':pos.x+"px",
					'height':size.y+"px",
					'width':size.x+"px"
				},
				'class':'formHider',
				'id':'formHider'+objFormName.id
			});
			$(formHider).setOpacity(0);
			$(formHider).injectInside($(document.body));
			var FX=new Fx.Tween($(formHider)).start('opacity',0.7);
		},
		restoreForm:function(objID){
			$("formHider"+objID).destroy();
			if(Browser.Engine.trident && Browser.Engine.version < 5){
				$(document.body).getElements('select').each(function(item,index){
					item.fade('in');
				});
			}
		},
		updateFormHiders:function(){
			var pos,size;
			$$('form.required').each(function(item,index){
				if($type($('formHider'+item.id))=='element'){
					pos=$(item).getPosition();
					size=$(item).getSize();
					$('formHider'+item.id).style.left=pos.x+'px';
					$('formHider'+item.id).style.top=pos.y+'px';
					$('formHider'+item.id).style.height=size.y+'px';
					$('formHider'+item.id).style.width=size.x+'px';
				}
			});
		},
		unloader: function(){
			validate.unloading = true;										// Let the AJAX objects check the unload valued
			$$('forms.required').each(function(item,index){
				if(validate.ajax[item]){
					validate.ajax[item].cancel();							// Cancel any open Ajax requests
				}
			});
		}
	};
window.addEvent('domready',validate.init);
window.addEvent('beforeunload',validate.unloader);/* Created by Kevin Dibble 
 * Uses Mootools
 * Add a class of "calender" to input feilds - thats all!!
 * <input name="date" type="text" class="required calender" size="12" />
 */
var DisplayDate={
	textObj:null,
	calender:null,
	format:"d-m-y",
	offset:50,
	calenderLeft:0,
	calenderTop:0,
	fx: null,
	allMonths:Array('January','February','March','April','May','June','July','August','September','October','November','December'),
	theDate:new Date(),
	selectedDate:this.theDate,
	displayCalender:function(ev,callingElement){
		DisplayDate.removeCalender();
		DisplayDate.textObj=callingElement;
		if(DisplayDate.textObj.value!=""){			// If the date feild has a date - set the calender to it
			var initialDate=DisplayDate.textObj.value.split('-');
			if (!isNaN(initialDate[1]) && !isNaN(initialDate[1])) {
				DisplayDate.setInitialDate(initialDate[1], initialDate[2]);
			}
		}
		var pos = callingElement.getPosition();
		var size = callingElement.getSize();
		DisplayDate.calenderLeft = pos.x;
		DisplayDate.calenderTop  = pos.y;
		if(DisplayDate.calender==null){
			DisplayDate.calender=new Element("div",{
				'styles': {
					'position': "absolute",
					'z-index': 999999,
					'top': (DisplayDate.calenderTop+size.y) + "px",
					'left': DisplayDate.calenderLeft + "px"
				}
			});
			DisplayDate.buildCalender();
		}
	},
	setInitialDate:function(theMonth,theYear){			/* Set the Date for the calender */
		DisplayDate.theDate.setMonth(theMonth-1);
		this.theDate.setYear(theYear);
	},
	buildCalender:function(visible){					/* Build and create the calender for the page */			
		if(Browser.Engine.trident && Browser.Engine.version < 5) {
			$(document.body).getElements('select').each(function(item,index){
				item.fade('out');
			});
		}										
		var DisplayMonth="<table cellpadding='0' cellspacing='0' border='0' class='dateTable'><tr>";
		DisplayMonth+="<td colspan='2' id='calenderPreviousYear'>&lt;&lt;&lt;</td>";
		DisplayMonth+="<td colspan='3'><select id='calenderSelect' class='calSelect'>";
		for(var i=this.theDate.getFullYear()-70;i<this.theDate.getFullYear()+20;i++){
			if(i==this.theDate.getFullYear()){
				DisplayMonth+="<option selected='selected' value='"+i+"'>"+i+"</option>";
			}else{
				DisplayMonth+="<option value='"+i+"'>"+i+"</option>";
			}
		}
		DisplayMonth+="</select></td>";
		DisplayMonth+="<td colspan='2' id='calenderYearAdvance'>&gt;&gt;&gt;</td></tr>";
		DisplayMonth+="<td colspan='2' id='monthPrevious'>&lt;&lt;&lt;</td>";
		DisplayMonth+="<td colspan='3'>"+this.allMonths[this.theDate.getMonth()]+"</td>";
		DisplayMonth+="<td colspan='2' id='monthAdvance'>&gt;&gt;&gt;</td></tr>";
		DisplayMonth+="<tr class='light'><td>S</td><td>S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</td></tr><tr>";
		this.theDate.setDate(1);
		var DaysInMonth=32-new Date(this.theDate.getYear(),this.theDate.getMonth(),32).getDate();
		var startfrom=this.theDate.getDay();
		var goTo=DaysInMonth+startfrom+1;DaysInMonth+=startfrom;
		if(DaysInMonth<35)DaysInMonth=34;
		if(DaysInMonth>34)DaysInMonth=41;
		for(var i=0;i<=DaysInMonth;i++){
			if(i%7==0){
				DisplayMonth+="</tr><tr>";
			}
			if(i>startfrom&&i<goTo){
				DisplayMonth+="<td align='center' title='"+(i-startfrom)+"' class='day'>"+(i-startfrom)+"</td>";
			}else{
				DisplayMonth+="<td></td>";
			}
		}
		DisplayMonth+="</tr><tr><td colspan='6'></td><td title='0' id='calenderCloser' class='day'>X</td>";
		DisplayMonth+="</tr></table>";
		$(this.calender).set("html",DisplayMonth);
		if (!visible) {
			$(this.calender).setOpacity(0);
		}
		$(this.calender).injectInside($(document.body));
		var allTDElems = $(this.calender).getElements('.day');
		allTDElems.each(function(item,index){
			item.addEvent('click',function(event){DisplayDate.returnDate(item.title)})
		});
		if (!visible) {
				var fx = new Fx.Tween(this.calender);
				fx.start('opacity',0.8);
		}
		$('calenderSelect').removeEvents();
		$('calenderSelect').addEvent('change',function(event){DisplayDate.setDateYear($('calenderSelect').value);});
		$('calenderYearAdvance').addEvent('click',function(){DisplayDate.setDateYear(DisplayDate.theDate.getFullYear()+1);});
		$('calenderPreviousYear').addEvent('click',function(){DisplayDate.setDateYear(DisplayDate.theDate.getFullYear()-1);});
		$('monthAdvance').addEvent('click',  function(){DisplayDate.setDateMonth((DisplayDate.theDate.getMonth()+1));});
		$('monthPrevious').addEvent('click', function(){DisplayDate.setDateMonth((DisplayDate.theDate.getMonth()-1));});
	},
	removeCalender:function(){				/* Remove the Calender from the page */
		var self = DisplayDate;
		if($defined($('calenderSelect'))){
			$$('td.day',self.calender).each(function(item,index){
				item.removeEvents();
			});
			$('calenderSelect').removeEvents();
			$(self.calender).destroy();
			self.textObj=null;
			self.calender=null;
			if (Browser.Engine.trident && Browser.Engine.version < 5) {
				$(document.body).getElements('select').each(function(item,index){
					item.fade('in');
				});
			}
		}
		if(DisplayDate.fx){
			DisplayDate.fx.cancel();			// Stop hiding animation
		}
	},
	hideCalender:function(){				/* Hide the calender */
		if(DisplayDate.calender!=null){
			DisplayDate.fx = new Fx.Tween(DisplayDate.calender,{onComplete: DisplayDate.removeCalender});
			DisplayDate.fx.start('opacity',0);
		}
	},
	setDateMonth:function(theMonth){		/* Set the Month */
		this.theDate.setMonth(theMonth);
		this.buildCalender(true);			/* Build the Calender to show the new month */
	},
	setDateYear:function(theYear){			/* Set the year */
		this.theDate.setYear(theYear);
		this.buildCalender(true);			/* Build the Calender to show the new year */
	},
	returnDate:function(theDay){			/* Return the Day clicked on */
		if (theDay != 0) {
			this.theDate.setDate(theDay);
			this.textObj.value = this.theDate.getDate() + "-" + (this.theDate.getMonth() + 1) + "-" + this.theDate.getFullYear();
		}	
		this.hideCalender(); 				/* hide the calender */
	},										
	init:function(){
		$$("input.calender").each(function(item,index){
			item.addEvent('click',function(event){
				if(DisplayDate.calender==null){
					DisplayDate.displayCalender(event,item);
				}
			});
			item.addEvent('keydown',function(event){		// Dont allow manual input
				var ev = new Event(event).stop();								 
			});
			item.addEvent('keypress',function(event){
				var ev = new Event(event);
				if(ev.code!=9){
					ev.stop();
				}else{
					if(DisplayDate.calender){
						DisplayDate.removeCalender();
					}
				}
			});
		});
	}
};
window.addEvent('domready', DisplayDate.init);/* Created by Kevin Dibble 
 * Uses Mootools 1.2
 * Expects page elements to be:
 * class "popInPage" must be entered (Supports multiple classes. e.g: class="linkStyle popInPage anotherStyle")
 * href = path to file (absolute or Relative)
 * rel Option 1	= "Caption"   		Enter the text to appear
 * rel Option 2 = "call type"		ajax, json, image, id
 * rel option 3 = "image Libray"    the name to group images by or null
 * rel option 4 = "width"			the desired width
 * rel option 5 = "height"			the desired height
 * 
 * SAMPLE IMAGE LIBRARY CALL
 * <a href="http://localhost/javascript/images/m1.jpg"  rel="Adventure in Paint,image,lib1,400,300" class="popInPage"><img src="../lib/thumbs/m1.jpg" /></a>
 * <a href="../lib/images/m2.jpg" 								rel="Horsey Ride! Horsey Ride,image,lib1,400,300" class="popInPage"><img src="../lib/thumbs/m2.jpg" /></a>
 * 
 * SIMPLE (STANDARD) popup
 * <a href="../lib/page1.php"  								rel="Window Name,ajax,null,400,300" class="simplePop">A simple Link</a>
 * Option 2 can be ajax, json or left empty
 * if it is ajax or json - then it will open inside the page if the user has popup windows blocked
 * if it is nothing - then the popup will not open if the person has popups blocked
 * 
 * SAMPLE PAGE ELEMENT CALL - displays text inside the element to appear
 * <a href="../lib/intent1" rel="Page call,intent1,null,400,300" class="popInPage">PAGE ID CALL</a>
 * 
 * SAMPLE AJAX CALL
 * <a href="../lib/page1.php" rel="Whole Self Journey,ajax,null,500,400" class="popInPage">Page One</a>
 * 
 * AJAX WITH SCRIPT EVALULATED
 * <a href="../lib/json.php" rel="Ajax Call,ajax,eval" class="popInPage">ajax Request - with script eval</a>
 * 
 * SAMPLE JSON CALL
 * <a href="http://localhost/javascript/json.php" title="json" class="popInPage">JSON Request - No JSON Object</a>
 * Script must be in the page between <script> </script> tags
 * 
 * JSON CALL WITH CUSTOM FUNCTION TO HANDLE JSON RESULT
 * <a href="../lib/getChat.php" rel="Json Call,json,<function name>" class="popInPage">JSON Request - Returns a JSON object</a>
 * function must accept a single obj function(obj){}
 */
var displayPopUp={
	imagePreloader: null,
	imageLibrary:	"",
	caption: 		null,
	URL: 			null,
	callType:		null,
	scripts : 		null,			// the scripts called back from the ajax page to eval
	width:			300,			// The default width
	height:			200,			// The Default height
	contentTop:		0,				// The default location for the top
	contentLeft:	0,				// The default location for the left
	hideBG:			null,			// The background hider
	bodyWidth:		null,
	bodyHeight:		null,
	content: 		null,
	popTop: 		null,
	popTopClose: 	null,
	theWindow:		null,
	popImageNav:	null,
	popImage:		null,
	imageNum:		null,
	direction:		"next",
	fxMoveTop:		null,
	fxMoveLeft: 	null,
	ajax:			null,
	jsonResult:		null,
	jsonFunction:	null,
	canMove: 		true,
	iFrame:			false,
	admin:			false,
	reset: function(){
		$$('a.popInPage').each(function(item,index){
			$(item).removeEvents('click');
		});
		$$("a.simplePop").each(function(item,index){
			$(item).removeEvents('click');
		});
	},
	init: function(){
		var self = displayPopUp;
		self.reset();
		self.imagePreloader = Array();						// Create the preloader Array
		$$('a.popInPage').each(function(item,index){		// GET ALL ANCHOR TAGS
			item.addEvent('click',function(event){
				event = new Event(event).stop();			// CANCEL ON CLICK EVENT
				displayPopUp.showPopUp(item);
			});
			var tmp = item.rel.split(",");					// Split the REL Tag
			if(tmp[1]=="image"){							// Create the image preloader
				var details = Array();
				details['image'] 	 = new Asset.image(item.href,{id:'thePopImage'}); // Pre-Load Image
				details['obj'] 		 = item.rel;			// Save image options
				if(!$defined(displayPopUp.imagePreloader[tmp[2]])){
					displayPopUp.imagePreloader[tmp[2]] = Array();
				}
				displayPopUp.imagePreloader[tmp[2]].push(details); // Save image library
			}
		});
		$$("a.simplePop").each(function(item,index){
			item.addEvent('click',function(event){
				event = new Event(event).stop();			// CANCEL ON CLICK EVENT
				displayPopUp.simplePop(item);
			});
		});
	},
	showPopUp: function(obj){								// Show POP Function
		var self 			= displayPopUp;
		var objValues 		= obj.rel.split(",");
		self.iFrame			= $(obj).hasClass("iframe");
		self.URL			= obj.href;
		self.caption		= objValues[0] 	|| "Window";
		self.callType		= objValues[1]	|| "ajax";
		self.imageLibrary 	= objValues[2]	|| null;
		self.width			= (objValues[3])?	objValues[3] : self.width;  
		self.height 		= (objValues[4])?	objValues[4] : self.height; // Height = 300;
		self.admin			= (objValues[5])?	true		 : false; 
		self.hideBackground(); 	
	},
	simplePop: function(obj){								// DO Simple Popup Function
		var self		= displayPopUp;
		var options 	= obj.rel.split(",");
		self.url 		= obj.href;
		var thisName 	= options[1]	|| "popup";
		var thisWidth	= options[3]	|| self.width;
		var thisHeight 	= options[4] 	|| self.height;
		var windowSize 	= window.getSize();
		var left		= (windowSize.x/2)-(thisWidth/2);
		var top 		= (windowSize.y/2)-(thisHeight/2);
		if($defined(self.theWindow)){
			try{self.theWindow.close();}catch(e){}
			self.theWindow = null;
		}
		try{
			self.theWindow = window.open(self.url, thisName, "left = "+left+", top = "+top +", status = 0, height = "+parseInt(thisHeight)+", width = "+ parseInt(thisWidth) +", resizable = 0, scrollbars = 1");
			self.theWindow.focus();
		}catch(e){
			if (options[2] == "ajax" || options[2] == "json") {
				self.showPopUp(obj);
			}else{
				alert("Please Enable popups in your browser");
			}
		}	
	},
	getSize: function(){
		var self 			= displayPopUp;
		var windowSize 		= window.getSize();
		var scrollSize		= window.getScroll();
		var bodySize 		= $(document.body).getSize();
		var bodyScroll		= $(document.body).getScrollSize();
		self.contentLeft 	= ((windowSize.x)/2) - (self.width/2) + scrollSize.x;
		self.contentTop 	= (windowSize.y/2)-(self.height/2) + scrollSize.y;
		self.bodyWidth 		= (bodyScroll.x);
		self.bodyHeight 	= (bodyScroll.y);
	},
	hideBackground: function(){
		var self 			= displayPopUp;
		self.getSize();
		if (self.hideBG == null) {
			self.hideBG = new Element('div', {
				'styles': {	'top'	: "0px", 
							'left'	: "0px",
							'height': self.bodyHeight 	+ "px",
							'width'	: self.bodyWidth 	+ "px"},
				'class': 'hideBG',
				'id': 'hideBG'
			});
			self.hideBG.setOpacity(0.9);
			$(self.hideBG).injectInside($(document.body));
			window.addEvent('resize', displayPopUp.resize);
			window.addEvent('scroll', displayPopUp.resize);
			$$('select').each(function(item,index){
				item.setOpacity(0);
			});
			var myFx = new Fx.Tween('hideBG',{onComplete: function(){
				displayPopUp.displayContent();
			}}).start('opacity',0.9);
		}else{
			if(self.callType =="ajax" || self.callType=="json"){
				self.closeContent();
				self.displayContent();
			}
		}
	},
	resize: function(fx){									// resize function - to control the moving functions
		var self=displayPopUp;							// It is possible to add a delay to this call here
		if (self.hideBG != null){
			if (self.canMove == true) {
				self.moveit();
			}
		}
	},
	moveit: function(){									// Function to move the popup to the middle of the page
		var self 	= displayPopUp;
		if(self.admin==false){
			self.getSize();								// Get the new size of the document
			displayPopUp.canMove = false;
			if(self.contentTop < 0){
				self.contentTop = 0;
			}
			if(self.contentLeft < 0){
				self.contentLeft = 0;
			}
			self.hideBG.style.height=self.bodyHeight + "px";
			self.hideBG.style.width=self.bodyWidth + "px";
			var top =0;
			var left = 0;
			if(self.height < self.bodyHeight){
				top = self.contentTop;
			}
			if(self.width < self.bodyWidth){
				left = self.contentLeft;
			}
			if(self.fxMoveLeft){
				self.fxMoveLeft.cancel();	
			}
			self.fxMoveLeft = new Fx.Morph(self.content,{duration: 'long',onComplete: function(){
				displayPopUp.canMove = true;
				displayPopUp.resize();
			}});
			self.fxMoveLeft.start({
				'left': left,
				'top' : top
			});
		}
	},
	closeContent: function(){
		var self = displayPopUp;
			if (self.callType == "image") {
				$(self.popImage).destroy();
				$(self.popImageNav).destroy();
			}else {
				$(self.popText).destroy();
			}
			$(self.popTopClose).removeEvent('click', displayPopUp.popupClose);
			$(self.popTopClose).removeEvent('mouseover', function(){
				this.className = "popOver";
			});
			$(self.popTopClose).removeEvent('mousedown', function(){
				this.className = "popDown";
			});
			$(self.popTopClose).removeEvent('mouseout', function(){
				this.className = "popClose";
			});
			$(self.popTopClose).destroy();
			$(self.popTop).destroy();
			$(self.content).destroy();
			self.content 	= null;
			self.popImage 	= null;
			self.popText 	= null;
			self.popTop 	= null;
			self.popBtm 	= null;
			self.popTopClose= null;
	},
	displayContent: function(){							// Function to display the popup content for the page
		var self = displayPopUp;
		var temp = "";
		self.content = new Element('div', {
				'id': "popContent",
				'class': "popContent",
				'styles': {
					'position': "absolute",
					'top': self.contentTop + "px",
					'left': self.contentLeft + "px",
					'height': "0px",
					'width': "0px"
				}
			});
			self.popTop = new Element('div', {
				'id': "popTop",
				'class': "popTop"
			});
			var popInner = new Element('div', {
				'id': "popCaption",
				'class': "popCaption",
				'html' : self.caption
			});
			self.popTopClose = new Element('div', {
				'id': "popClose",
				'class': "popClose",
				'html' : "close"
			});
			$(popInner).injectInside(self.popTop);
			$(self.popTopClose).addEvent('click', displayPopUp.popupClose);
			$(self.popTopClose).addEvent('mouseover', function(){
				this.className = "popOver";
			});
			$(self.popTopClose).addEvent('mousedown', function(){
				this.className = "popDown";
			});
			$(self.popTopClose).addEvent('mouseout', function(){
				this.className = "popClose";
			});
			$(self.content).setOpacity(0);
			$(self.content).injectInside($(document.body));
			$(self.popTop).injectInside(self.content);
			$(self.popTopClose).injectInside(self.popTop);
			if (self.callType == "image") {
				if ($defined(self.imagePreloader[self.imageLibrary])) {
					var tempArray = self.imagePreloader[self.imageLibrary];
					tempArray.each(function(item, index){
						if (item.image.src == self.URL) {
							self.imageNum = index;
						}
					});
				}
				self.popImageNav = new Element('div', {
					'class': "popImageNavContainer",
					'id': "popImageNavContainer",
					'html' : "<div id='popImageNum' class='popImageNum'>Image " +(self.imageNum + 1) +" of " +
							self.imagePreloader[self.imageLibrary].length +
							"</div><div class='popImageNav' id='popImageNav'>" +
							"<a href='javascript: void(0)' id='popImageBack' class='popImageBack'" +
							" title='" + self.imageArrayName + "'>Back</a>" +
							" | <a href='javascript: void(0);' id='popImageNext' class='popImageNext' title='" +
							self.imageLibrary + "'>Next</a></div>"
				});
				self.popImage = new Element('div', {
					'class': "popImage",
					'id': "popImage",
					'styles': {
						'height': parseInt(self.height) + "px",
						'width':  parseInt(self.width)  + "px",
						'text-align': 'center'
					}
				});
				var imageCenterTrick = "<table border='0' cellpadding='0' cellspacing='0' height='" + self.popImage.style.height + "' width='100%'>" +
				"<tr><td align='center' valign='top' id='popImageContainer'><img src='" +
				self.imagePreloader[self.imageLibrary][self.imageNum]['image'].src +
				"' alt='" +
				self.caption +
				"' border='0' class='thePopImage' id='thePopImage'/></td></tr>" +
				"</table>";
				$(self.popImage).innerHTML = imageCenterTrick;
				$(self.popImageNav).injectInside(self.content);
				$(self.popImage).injectInside(self.content);
				$('popImageBack').addEvent('click', function(){
					displayPopUp.swapImage("back");
				});
				$('popImageNext').addEvent('click', function(){
					displayPopUp.swapImage("next");
				});
				var height = parseInt(self.height) + $(self.popTop).getSize().y;
				if(Browser.Engine.trident){				 // If Is IE
					height =  parseInt(self.height) + 20;
				}
				self.width = parseInt(self.width) + 14;
				self.height = parseInt(height) + 36;
			}else {
				var height = $(self.popTop).getSize().y;
				if(Browser.Engine.trident){				 // If Is IE
					height =  20;
				}
				self.popText = new Element('div', {
					'id': "popText",
					'class': "popText popAnimation",
					'styles': {
						'width': (self.width - 14),
						'height': (self.height - height - 14)
					}
				});
				if (self.callType != "ajax" && self.callType != "json") {
					if ($defined($(self.callType))){						
						var clone = $(self.callType).clone();   // Get all the elements
						$(clone).injectInside(self.popText);
						$(clone).removeClass("hide");
					}
					$(self.popText).className="popText"; 
				}else {
					if (self.callType == "json") {
						if (self.imageLibrary != null) {
							try{
								self.jsonFunction = eval(self.imageLibrary);
							}catch(e){}
						}
						self.Ajax = new Request.JSON({
							onSuccess: function(response){
								displayPopUp.showJsonResult(response);
								$(displayPopUp.popText).className = "popText"; // Remove Animation Effect
							},
							onFailure: function(){
								$(displayPopUp.popText).className = "popText"; // Remove Animation Effect
								$(displayPopUp.popText).removeEvents();
								var ElmResponse = new Element("div",{
										"id": "ajaxResponseHTML",
										"html" : "Json Call Failed",
										"class" : "error"
									});
								$(ElmResponse).injectInside($(displayPopUp.popText));
							},
							onException : function(){
								$(displayPopUp.popText).className = "popText"; // Remove Animation Effect
								var ElmResponse = new Element("div",{
										"id": "ajaxResponseHTML",
										"html" : "Sorry - An Exception has occured",
										"class" : "error"
									});
								$(ElmResponse).injectInside($(displayPopUp.popText));
							}
						}).get(self.URL);
					}
					if (self.callType == 'ajax') {
						if(self.iFrame){
							var iFrame = new Element("iframe",{"src":self.URL,"class":"iframe","height":0,"width":0});
							$(displayPopUp.popText).empty();
							$(iFrame).inject($(displayPopUp.popText));
							self.updateIFrame.delay(1000);
						}else{
							self.Ajax = new Request.HTML({
								onSuccess: function(response,elements,html,scripts){
									displayPopUp.showAjaxResult(response,elements,html,scripts);
								},
								onFailure: function(){
									$(displayPopUp.popText).className = "popText"; // Remove Animation Effect
									var ElmResponse = new Element("div",{
											"id": "ajaxResponseHTML",
											"html" : "Sorry, The Request has failed. Please Try Again Later",
											"class" : "error"
										});
									$(ElmResponse).injectInside($(displayPopUp.popText));
								},
								onException : function(){
									$(displayPopUp.popText).className = "popText"; // Remove Animation Effect
									var ElmResponse = new Element("div",{
											"id": "ajaxResponseHTML",
											"html" : "Sorry, An Exception has occured for the request",
											"class" : "error"
										});
									$(ElmResponse).injectInside($(displayPopUp.popText));
								},
								evalScripts: false
							}).get(self.URL);
						}
					}
				}
			}
			self.getSize();
			self.moveit();
			var fxOpen = new Fx.Morph('popContent',{onComplete: function(){
				if($defined(self.popText)){
					$(self.popText).injectInside(self.content);
				}
			}});
			fxOpen.start({
				'opacity':1,
				'height': displayPopUp.height + "px",
				'width':  displayPopUp.width + "px"});	
	},
	updateIFrame: function(){
		var self = displayPopUp;
		$('popText').getElement(".iframe").setStyles({"width":"666px","height":"576px","border":"none","display":"block"});
		$('popText').getElement(".iframe").set({"width":"666","height":"576"});
		$('popText').setStyles({"overflow":"visible","border":"none"});
	},
	showJsonResult: function(response){
		var self = displayPopUp;
		$(self.popText).className = "popText";
		if (self.jsonFunction != null) {
			self.jsonFunction(response);
		}
	},
	showAjaxResult: function(response,elements,html,scripts){
		var self = displayPopUp;
		if($(self.popText)){
			$(self.popText).removeEvents();
			var ElmResponse = new Element("div",{
						"id": "ajaxResponseHTML",
						"html" : html
					});
			$(ElmResponse).setOpacity(0);
			$(ElmResponse).injectInside($(self.popText));
		}
		displayPopUp.scripts = scripts;
		displayPopUp.evalScripts.delay(1000); 
	},
	evalScripts: function(){
		try{
			eval(displayPopUp.scripts);
		}catch(e){}
		try{validate.init();}catch(e){}
		try{editInPlace.init();}catch(e){}
		try{displayPopUp.init();}catch(e){}
		try{DisplayDate.init();}catch(e){}
		if(displayPopUp.popText){
			$(displayPopUp.popText).removeClass("popAnimation");
			var myFx= new Fx.Tween($('ajaxResponseHTML'));
			myFx.start('opacity',1);
		}
		try{
			$(displayPopUp.popText).getElements('input[type=file]').each(function(item,index){
				var newup = new uploader(item);
				uploaders.push(newup);								// Add uploader to the upload array								  
			});
		}catch(e){}
	},
	swapImage: function(direction){
		var self 		= displayPopUp;
		var nextImage 	= (direction=="next")? self.imageNum+1 : self.imageNum-1;
		if(!$defined(self.imagePreloader[self.imageLibrary][nextImage])){
			if(nextImage > 0){
				nextImage = 0;
			}else{
				nextImage = self.imagePreloader[self.imageLibrary].length -1;
			}
		}
		self.imageNum 	= nextImage;
		var values		= self.imagePreloader[self.imageLibrary][self.imageNum]['obj'].split(",");
		self.width		= (parseInt(values[3])>0)?parseInt(values[3]): self.width;
		self.height 	= (parseInt(values[4])>0)?parseInt(values[4]): self.height;
		self.width		= self.width + 14;
		self.height 	= self.height + $(self.popTop).getSize().y + 14 + 22;
		$('popCaption').innerHTML=(values[0]);
		self.fadeout();
	},
	fadeout: function(){
		var fx = new Fx.Tween('popImage',{onComplete: function(){
				if($(displayPopUp.content)){
					var self 	  = displayPopUp;
					$('popImageNum').innerHTML = "Image " + ((self.imageNum+1)+" of "+self.imagePreloader[self.imageLibrary].length);
					$('thePopImage').destroy();
					$(self.imagePreloader[self.imageLibrary][self.imageNum]['image']).injectInside($('popImageContainer'));
					displayPopUp.fadein();
				}
			}
		}).start('opacity',0);
	},
	fadein: function(){
		var self 	  = displayPopUp;
		if($(self.content)){
			var sizeFx = new Fx.Morph($(self.content),{duration: 1500,onComplete: function(){
					if($(displayPopUp.content)){
						var fx = new Fx.Tween('popImage').start('opacity',1);
					}
				}}).start({
					'width'  : (self.width) + "px",
					'height' : (self.height)+ "px"
			});
			self.popImage.style.width = (self.width - 14) + "px";
			self.popImage.style.height= (self.height - $(self.popTop).getSize().y - 14 - 22)+ "px";
			self.getSize();
			self.resize();
		}
	},
	popupClose: function(){
		var self = displayPopUp;
		var fxContent = new Fx.Tween($('popContent')).start('opacity',0);
		var fxBG = new Fx.Tween($('hideBG'),{onComplete: displayPopUp.popupRemove}).start('opacity',0);
		if(self.Ajax){
			self.Ajax.cancel();
		}
	},
	popupRemove: function(){
		var self 	= displayPopUp;
		$(self.hideBG).destroy();
		$$('select').each(function(item,index){
			item.setOpacity(1);
		});
		self.closeContent();
		self.hideBG		= null;
	},
	unloader: function(){
		if(displayPopUp.Ajax){
			displayPopUp.Ajax.cancel();			// Stop loading requests.	
		}
	}
};
window.addEvent('domready', displayPopUp.init);
window.addEvent('beforeunload',displayPopUp.unloader);window.addEvent("domready",function(){
		if($('lic')){
			$('lic').setOpacity(0.9);
		}
		$('left').getElements("input").each(function(item,index){
			if(item.type=="password"){
				try{
					item.type="text";
				}catch(e){}
			}
			item.addEvent("focus",function(){
				if($(this).value.contains(this.title)){
					try{
						this.select();
					}catch(e){}
				}
				if(this.name=="password"){
					try{
						$(this).type="password";
					}catch(e){}
					this.select();
				}
			});
			item.addEvent("click",function(){
				if($(this).value.contains(this.title)){
					if(!Browser.Engine.trident){
						this.select();
					}else{
						this.value = "";	
					}
				}
				if(this.name=="password"){
					try{
						$(this).type="password";
					}catch(e){}
					this.select();
				}
			});
			item.addEvent("blur",function(){
				if(this.value.trim()==""){
					this.value = this.title;
				}
				if(this.name=="password" && this.value == this.title){
					this.type="text";
				}
			});
		});	
		$$('.poplink').each(function(item,index){
			item.set("opacity",0.9);
		});
		$('mainNav').getElements('a').each(function(item,index){
			item.addEvent("click",function(){this.blur()});							
		});
		if(Browser.Engine.trident && Browser.Engine.version <=4){						// Fix li:hover states for ie
			$$('.dopop').each(function(item,index){
				item.addEvent("mouseenter",function(){
					this.addClass("showing");
					this.getElement("ul").style.marginLeft = "-65px";
				});
				item.addEvent("mouseleave",function(){
					this.removeClass("showing");
				});
			});  
		}
	});
var bid = false;
function dolightsearch(){
	$('quickfind').addClass('loading');
	if($('category').value.contains('Activity')){
		$('segtran').addClass('hide');
		$('segment_transport').value = "";
		$('segser').addClass('hide');
		$('segment_service').value = "";
		$('segact').removeClass('hide');
		$('starrating').value = "";
		$('starrat').addClass("hide");
	}else{
		if($('category').value.contains('Transport')){
			$('segtran').removeClass('hide');
			$('segser').addClass('hide');
			$('segment_service').value = "";
			$('segact').addClass('hide');
			$('segment_activity').value = "";
			$('starrating').value = "";
			$('starrat').addClass("hide");
		}else{
			if($('category').value.contains('Visitor Service')){
				$('segtran').addClass('hide');
				$('segment_transport').value = "";
				$('segser').removeClass('hide');
				$('segact').addClass('hide');
				$('segment_activity').value = "";
				$('starrating').value = "";
				$('starrat').addClass("hide");
			}else{
				$('starrat').removeClass('hide'); 
				$('segtran').addClass('hide');
				$('segment_transport').value = "";
				$('segser').addClass('hide');
				$('segment_service').value = "";
				$('segact').addClass('hide');
				$('segment_activity').value = "";
			}
		}
	}
	$('quickfind').set('load',{
		evalScripts: true,
		method: 'post', 
		"data": {
			'category' : 		$('category').value,
			'region' : 			$('region').value,
			'starrating' : 		$('starrating').value,
			'bussinessname' : 	(this.id =='businessname') ? $('businessname').value : '',
			'envirorating' : 	$('envirorating').value,
			'segment_activity' : $('segment_activity').value,
			'segment_service'  : $('segment_service').value,
			'segment_transport': $('segment_transport').value
		},
		onComplete: function(){
				$('quickfind').removeClass('loading');
		},
		autoCancel:true
	});
	$('quickfind').load('quickfind/index.php');	
}
function setupSearch(){
	$('businessname').addEvent('focus',function(){
		$('quickfind').fade(0.9);
		if(Browser.Engine.trident && Browser.Engine.version <=4){						// Fix li:hover states for ie
			$('starrating').addClass('hide');
			$('envirorating').addClass('hide');
		}
		bid = true;
	});
	$('businessname').addEvent('focus',dolightsearch);
	$('businessname').addEvent('blur',function(){
		$('quickfind').fade("out");
		if(Browser.Engine.trident && Browser.Engine.version <=4){
			$('starrating').removeClass('hide');
			$('envirorating').removeClass('hide');
		}
		bid = false;
	});
	$('quickfind').fade("out");
	$('quickfind').removeClass("hide");
	$('searchform').getElements('select').each(function(item,index){
		item.addEvent('change',dolightsearch);
	});
	$('businessname').addEvent('keyup',dolightsearch);
	setSearchDivs();
}
function setSearchDivs(){
	var inside = false;
	var count = 0;
	$('quickfind').getElements("div").each(function(item,index){
		item.removeEvents();
		count++;
		if(item.get("html").test($('businessname').value)){
			inside = true;
		}
		item.addEvent('mousedown',function(event){
			new Event(event).stop();
			$('businessname').value = this.get("html");
			if($('accountname')){
				$('accountname').value = this.get("html");	
			}
			$('businessname').blur();
		});	
		item.addEvent('mouseenter',function(){this.addClass('over');});
		item.addEvent('mouseleave',function(){this.removeClass('over');});
	});
	if(!inside && count > 0 && bid==false){
		$('businessname').value = "[Business Name]";
	}
}
window.addEvent("domready",setupSearch);

var logoCount = 1;
function changeLogo(){	
	if(logoCount==5){
		logoCount=1;	
	}else{
		logoCount++;	
	}
	var obj = $('center').getElement('.qualmark');
	var current = obj.style.backgroundImage;
	current = current.substring(0,(current.lastIndexOf('logo_'))) + "logo_" + logoCount + current.substring(current.lastIndexOf('logo_')+6,current.length);
	new Fx.Tween($(obj),{onComplete: function(){
		obj.style.backgroundImage = current;	
		obj.fade("in");								  
	}}).start("opacity",0);							  						  
}
window.addEvent("domready",function(){
	var obj = $('center').getElement('.qualmark');
	if($(obj) && !obj.style.backgroundImage.contains("exclusive") && !obj.style.backgroundImage.contains("enviro") && !obj.style.backgroundImage.contains("3")){
		try{
			if(noLogoAni==true){
				
			}else{
				changeLogo.periodical(10000);
			}
		}catch(e){
			changeLogo.periodical(10000);
		}
	}
});

window.addEvent("domready",function(){
	if(Browser.Engine.webkit){
		$('businessname').style.paddingLeft = "1px";
	}
	var documentScroll = new Fx.Scroll($(document.body), {
   		duration: 1000,
    	wait: false,
		wheelStops: false,
		offset: {'x': 0, 'y' : -100}
	});
	try{
		if(media){
			$("centerContent").getElements('span').each(function(item,index){
				if(index > 0){
					item.set("opacity",0);
					item.style.display = "none";
				}
			});
			var count = 1;
			if(Browser.Engine.trident && Browser.Engine.version < 5){
				count = 0;	
			}
			$("centerContent").getElements('a').each(function(item,index){
				if(item.href.contains("#")){
					item.set("rel",count);
					count++;
					item.addEvent("click",function(event){
						new Event(event).stop();
						var rel = $(this).get("rel");
						$("centerContent").getElements('span').each(function(item,index){
							if(index==rel){
								$(item).style.display = "block";
								$(item).fade("in");
							}else{
								item.set("opacity",0);
								$(item).style.display= "none";
							}
						});
					});
				}
			});
		}else{
			$("centerContent").getElements('a').each(function(item,index){
				if(item.name != ""){
						item.id = item.name; // give it the same name
				}
				if(item.href.contains("#")){
					item.addEvent("click",function(event){
						new Event(event).stop();
						var tmpclick = this.href.substring(this.href.indexOf("#")+1,this.href.length);   // Get Date section
						documentScroll.toElement($(tmpclick));
					});
				}
			});	
		}
	}catch(e){
		$("centerContent").getElements('a').each(function(item,index){
				if(item.name != ""){
						item.id = item.name; // give it the same name
				}
				if(item.href.contains("#")){
					item.addEvent("click",function(event){
						new Event(event).stop();
						var tmpclick = this.href.substring(this.href.indexOf("#")+1,this.href.length);   // Get Date section
						documentScroll.toElement($(tmpclick));
					});
				}
			});	
		}
});
window.addEvent("domready",function(){
	$('left').getElements("select").each(function(item,index){
		item.addEvent("change",function(){this.blur();});							  
	});								
});
window.addEvent("unload",function(){
	if(Browser.Engine.trident && Browser.Engine.version < 5){
		$('left').getElements("select").each(function(item,index){
			item.style.paddingTop 	= "1px";									  
		});	
	}
});/*=:project
  scalable Inman Flash Replacement (sIFR) version 3, revision 413

  =:file
    Copyright: 2006 Mark Wubben.
    Author: Mark Wubben, <http://novemberborn.net/>

  =:history
    * IFR: Shaun Inman
    * sIFR 1: Mike Davidson, Shaun Inman and Tomas Jogin
    * sIFR 2: Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben

  =:license
    This software is licensed and provided under the CC-GNU LGPL.
    See <http://creativecommons.org/licenses/LGPL/2.1/>    
*/

var sIFR=new function(){var O=this;var E={ACTIVE:"sIFR-active",REPLACED:"sIFR-replaced",IGNORE:"sIFR-ignore",ALTERNATE:"sIFR-alternate",CLASS:"sIFR-class",LAYOUT:"sIFR-layout",FLASH:"sIFR-flash",FIX_FOCUS:"sIFR-fixfocus",DUMMY:"sIFR-dummy"};E.IGNORE_CLASSES=[E.REPLACED,E.IGNORE,E.ALTERNATE];this.MIN_FONT_SIZE=6;this.MAX_FONT_SIZE=126;this.FLASH_PADDING_BOTTOM=5;this.VERSION="413";this.isActive=false;this.isEnabled=true;this.fixHover=true;this.autoInitialize=true;this.setPrefetchCookie=true;this.cookiePath="/";this.domains=[];this.forceWidth=true;this.fitExactly=false;this.forceTextTransform=true;this.useDomLoaded=true;this.useStyleCheck=false;this.hasFlashClassSet=false;this.repaintOnResize=true;this.replacements=[];var L=0;var R=false;function Y(){}function D(c){function d(e){return e.toLocaleUpperCase()}this.normalize=function(e){return e.replace(/\n|\r|\xA0/g,D.SINGLE_WHITESPACE).replace(/\s+/g,D.SINGLE_WHITESPACE)};this.textTransform=function(e,f){switch(e){case"uppercase":return f.toLocaleUpperCase();case"lowercase":return f.toLocaleLowerCase();case"capitalize":return f.replace(/^\w|\s\w/g,d)}return f};this.toHexString=function(e){if(e.charAt(0)!="#"||e.length!=4&&e.length!=7){return e}e=e.substring(1);return"0x"+(e.length==3?e.replace(/(.)(.)(.)/,"$1$1$2$2$3$3"):e)};this.toJson=function(g,f){var e="";switch(typeof (g)){case"string":e='"'+f(g)+'"';break;case"number":case"boolean":e=g.toString();break;case"object":e=[];for(var h in g){if(g[h]==Object.prototype[h]){continue}e.push('"'+h+'":'+this.toJson(g[h]))}e="{"+e.join(",")+"}";break}return e};this.convertCssArg=function(e){if(!e){return{}}if(typeof (e)=="object"){if(e.constructor==Array){e=e.join("")}else{return e}}var l={};var m=e.split("}");for(var h=0;h<m.length;h++){var k=m[h].match(/([^\s{]+)\s*\{(.+)\s*;?\s*/);if(!k||k.length!=3){continue}if(!l[k[1]]){l[k[1]]={}}var g=k[2].split(";");for(var f=0;f<g.length;f++){var n=g[f].match(/\s*([^:\s]+)\s*\:\s*([^;]+)/);if(!n||n.length!=3){continue}l[k[1]][n[1]]=n[2].replace(/\s+$/,"")}}return l};this.extractFromCss=function(g,f,i,e){var h=null;if(g&&g[f]&&g[f][i]){h=g[f][i];if(e){delete g[f][i]}}return h};this.cssToString=function(f){var g=[];for(var e in f){var j=f[e];if(j==Object.prototype[e]){continue}g.push(e,"{");for(var i in j){if(j[i]==Object.prototype[i]){continue}var h=j[i];if(D.UNIT_REMOVAL_PROPERTIES[i]){h=parseInt(h,10)}g.push(i,":",h,";")}g.push("}")}return g.join("")};this.escape=function(e){return escape(e).replace(/\+/g,"%2B")};this.encodeVars=function(e){return e.join("&").replace(/%/g,"%25")};this.copyProperties=function(g,f){for(var e in g){if(f[e]===undefined){f[e]=g[e]}}return f};this.domain=function(){var f="";try{f=document.domain}catch(g){}return f};this.domainMatches=function(h,g){if(g=="*"||g==h){return true}var f=g.lastIndexOf("*");if(f>-1){g=g.substr(f+1);var e=h.lastIndexOf(g);if(e>-1&&(e+g.length)==h.length){return true}}return false};this.uriEncode=function(e){return encodeURI(decodeURIComponent(e))};this.delay=function(f,h,g){var e=Array.prototype.slice.call(arguments,3);setTimeout(function(){h.apply(g,e)},f)}}D.UNIT_REMOVAL_PROPERTIES={leading:true,"margin-left":true,"margin-right":true,"text-indent":true};D.SINGLE_WHITESPACE=" ";function U(e){var d=this;function c(g,j,h){var k=d.getStyleAsInt(g,j,e.ua.ie);if(k==0){k=g[h];for(var f=3;f<arguments.length;f++){k-=d.getStyleAsInt(g,arguments[f],true)}}return k}this.getBody=function(){return document.getElementsByTagName("body")[0]||null};this.querySelectorAll=function(f){return window.parseSelector(f)};this.addClass=function(f,g){if(g){g.className=((g.className||"")==""?"":g.className+" ")+f}};this.removeClass=function(f,g){if(g){g.className=g.className.replace(new RegExp("(^|\\s)"+f+"(\\s|$)"),"").replace(/^\s+|(\s)\s+/g,"$1")}};this.hasClass=function(f,g){return new RegExp("(^|\\s)"+f+"(\\s|$)").test(g.className)};this.hasOneOfClassses=function(h,g){for(var f=0;f<h.length;f++){if(this.hasClass(h[f],g)){return true}}return false};this.ancestorHasClass=function(g,f){g=g.parentNode;while(g&&g.nodeType==1){if(this.hasClass(f,g)){return true}g=g.parentNode}return false};this.create=function(f,g){var h=document.createElementNS?document.createElementNS(U.XHTML_NS,f):document.createElement(f);if(g){h.className=g}return h};this.getComputedStyle=function(h,i){var f;if(document.defaultView&&document.defaultView.getComputedStyle){var g=document.defaultView.getComputedStyle(h,null);f=g?g[i]:null}else{if(h.currentStyle){f=h.currentStyle[i]}}return f||""};this.getStyleAsInt=function(g,i,f){var h=this.getComputedStyle(g,i);if(f&&!/px$/.test(h)){return 0}return parseInt(h)||0};this.getWidthFromStyle=function(f){return c(f,"width","offsetWidth","paddingRight","paddingLeft","borderRightWidth","borderLeftWidth")};this.getHeightFromStyle=function(f){return c(f,"height","offsetHeight","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth")};this.getDimensions=function(j){var h=j.offsetWidth;var f=j.offsetHeight;if(h==0||f==0){for(var g=0;g<j.childNodes.length;g++){var k=j.childNodes[g];if(k.nodeType!=1){continue}h=Math.max(h,k.offsetWidth);f=Math.max(f,k.offsetHeight)}}return{width:h,height:f}};this.getViewport=function(){return{width:window.innerWidth||document.documentElement.clientWidth||this.getBody().clientWidth,height:window.innerHeight||document.documentElement.clientHeight||this.getBody().clientHeight}};this.blurElement=function(g){try{g.blur();return }catch(h){}var f=this.create("input");f.style.width="0px";f.style.height="0px";g.parentNode.appendChild(f);f.focus();f.blur();f.parentNode.removeChild(f)}}U.XHTML_NS="http://www.w3.org/1999/xhtml";function H(m){var d=navigator.userAgent.toLowerCase();var l=(navigator.product||"").toLowerCase();var f=navigator.platform.toLowerCase();this.parseVersion=H.parseVersion;this.macintosh=/^mac/.test(f);this.windows=/^win/.test(f);this.quicktime=false;this.opera=/opera/.test(d);this.konqueror=/konqueror/.test(l);this.ie=false/*@cc_on||true@*/;this.ieSupported=this.ie&&!/ppc|smartphone|iemobile|msie\s5\.5/.test(d)/*@cc_on&&@_jscript_version>=5.5@*/;this.ieWin=this.ie&&this.windows/*@cc_on&&@_jscript_version>=5.1@*/;this.windows=this.windows&&(!this.ie||this.ieWin);this.ieMac=this.ie&&this.macintosh/*@cc_on&&@_jscript_version<5.1@*/;this.macintosh=this.macintosh&&(!this.ie||this.ieMac);this.safari=/safari/.test(d);this.webkit=!this.konqueror&&/applewebkit/.test(d);this.khtml=this.webkit||this.konqueror;this.gecko=!this.webkit&&l=="gecko";this.ieVersion=this.ie&&/.*msie\s(\d\.\d)/.exec(d)?this.parseVersion(RegExp.$1):"0";this.operaVersion=this.opera&&/.*opera(\s|\/)(\d+\.\d+)/.exec(d)?this.parseVersion(RegExp.$2):"0";this.webkitVersion=this.webkit&&/.*applewebkit\/(\d+).*/.exec(d)?this.parseVersion(RegExp.$1):"0";this.geckoVersion=this.gecko&&/.*rv:\s*([^\)]+)\)\s+gecko/.exec(d)?this.parseVersion(RegExp.$1):"0";this.konquerorVersion=this.konqueror&&/.*konqueror\/([\d\.]+).*/.exec(d)?this.parseVersion(RegExp.$1):"0";this.flashVersion=0;if(this.ieWin){var h;var k=false;try{h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(j){try{h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");this.flashVersion=this.parseVersion("6");h.AllowScriptAccess="always"}catch(j){k=this.flashVersion==this.parseVersion("6")}if(!k){try{h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(j){}}}if(!k&&h){this.flashVersion=this.parseVersion(/([\d,?]+)/.exec(h.GetVariable("$version"))[1].replace(/,/g,"."))}}else{if(navigator.plugins&&navigator.plugins["Shockwave Flash"]){this.flashVersion=this.parseVersion(navigator.plugins["Shockwave Flash"].description.replace(/\D*(\d+\.?\d*)\s*r(\d+)/,"$1$2"));var g=0;while(this.flashVersion>=H.MIN_FLASH_VERSION&&g<navigator.mimeTypes.length){var c=navigator.mimeTypes[g];if(c.type=="application/x-shockwave-flash"&&c.enabledPlugin.description.toLowerCase().indexOf("quicktime")>-1){this.flashVersion=this.parseVersion("0");this.quicktime=true}g++}}}this.flash=this.flashVersion>=H.MIN_FLASH_VERSION;this.transparencySupport=this.macintosh||this.windows;this.computedStyleSupport=this.ie||!!document.defaultView.getComputedStyle;this.fixFocus=this.gecko&&this.windows;this.nativeDomLoaded=this.gecko||this.webkit&&this.webkitVersion>=this.parseVersion("525")||this.konqueror&&this.konquerorMajor>this.parseVersion("03")||this.opera;this.mustCheckStyle=this.khtml||this.opera;this.forcePageLoad=this.webkit&&this.webkitVersion<this.parseVersion("523");this.properDocument=typeof (document.location)=="object";this.supported=this.flash&&this.properDocument&&(!this.ie||this.ieSupported)&&this.computedStyleSupport&&(!this.opera||this.operaVersion>=this.parseVersion("9.50"))&&(!this.webkit||this.webkitVersion>=this.parseVersion("412"))&&(!this.gecko||this.geckoVersion>=this.parseVersion("1.8.0.12"))&&(!this.konqueror)}H.parseVersion=function(c){return c.replace(/(^|\D)(\d)(?=\D|$)/g,"$10000$2")};H.MIN_FLASH_VERSION=H.parseVersion("8");function F(c){this.fix=c.ua.ieWin&&window.location.hash!="";var d;this.cache=function(){d=document.title};function e(){document.title=d}this.restore=function(){if(this.fix){setTimeout(e,0)}}}function S(l){var e=null;function c(){try{if(l.ua.ie||document.readyState!="loaded"&&document.readyState!="complete"){document.documentElement.doScroll("left")}}catch(n){return setTimeout(c,10)}i()}function i(){if(l.useStyleCheck){h()}else{if(!l.ua.mustCheckStyle){d(null,true)}}}function h(){e=l.dom.create("div",E.DUMMY);l.dom.getBody().appendChild(e);m()}function m(){if(l.dom.getComputedStyle(e,"marginLeft")=="42px"){g()}else{setTimeout(m,10)}}function g(){if(e&&e.parentNode){e.parentNode.removeChild(e)}e=null;d(null,true)}function d(n,o){l.initialize(o);if(n&&n.type=="load"){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",d,false)}if(window.removeEventListener){window.removeEventListener("load",d,false)}}}function j(){if(document.readyState=="interactive"){document.attachEvent("onstop",f);setTimeout(function(){document.detachEvent("onstop",f)},0)}}function f(){document.detachEvent("onstop",f);k()}function k(){l.clearReferences()}this.attach=function(){if(window.addEventListener){window.addEventListener("load",d,false)}else{window.attachEvent("onload",d)}if(!l.useDomLoaded||l.ua.forcePageLoad||l.ua.ie&&window.top!=window){return }if(l.ua.nativeDomLoaded){document.addEventListener("DOMContentLoaded",i,false)}else{if(l.ua.ie||l.ua.khtml){c()}}};this.attachUnload=function(){if(!l.ua.ie){return }window.attachEvent("onbeforeunload",j);window.attachEvent("onunload",k)}}var Q="sifrFetch";function N(c){var e=false;this.fetchMovies=function(f){if(c.setPrefetchCookie&&new RegExp(";?"+Q+"=true;?").test(document.cookie)){return }try{e=true;d(f)}catch(g){if(c.debug){throw g}}if(c.setPrefetchCookie){document.cookie=Q+"=true;path="+c.cookiePath}};this.clear=function(){if(!e){return }try{var f=document.getElementsByTagName("script");for(var g=f.length-1;g>=0;g--){var h=f[g];if(h.type=="sifr/prefetch"){h.parentNode.removeChild(h)}}}catch(j){}};function d(f){for(var g=0;g<f.length;g++){document.write('<script defer type="sifr/prefetch" src="'+f[g].src+'"><\/script>')}}}function b(e){var g=e.ua.ie;var f=g&&e.ua.flashVersion<e.ua.parseVersion("9.0.115");var d={};var c={};this.register=function(h){if(!g){return }var i=h.getAttribute("id");this.cleanup(i,false);c[i]=h;delete d[i];if(f){window[i]=h}};this.reset=function(){if(!g){return false}for(var j=0;j<e.replacements.length;j++){var h=e.replacements[j];var k=c[h.id];if(!d[h.id]&&(!k.parentNode||k.parentNode.nodeType==11)){h.resetMovie();d[h.id]=true}}return true};this.cleanup=function(l,h){var i=c[l];if(!i){return }for(var k in i){if(typeof (i[k])=="function"){i[k]=null}}c[l]=null;if(f){window[l]=null}if(i.parentNode){if(h&&i.parentNode.nodeType==1){var j=document.createElement("div");j.style.width=i.getAttribute("width")+"px";j.style.height=i.getAttribute("height")+"px";i.parentNode.replaceChild(j,i)}else{i.parentNode.removeChild(i)}}};this.clearReferences=function(){for(var h in c){if(Object.prototype[h]!=c[h]){this.cleanup(h,true)}}}}function K(d,g,f,c,e){this.sIFR=d;this.id=g;this.vars=f;this.movie=null;this.__forceWidth=c;this.__events=e;this.__resizing=0}K.prototype={getFlashElement:function(){return document.getElementById(this.id)},getAlternate:function(){return document.getElementById(this.id+"_alternate")},getAncestor:function(){var c=this.getFlashElement().parentNode;return !this.sIFR.dom.hasClass(E.FIX_FOCUS,c)?c:c.parentNode},available:function(){var c=this.getFlashElement();return c&&c.parentNode},call:function(c){var d=this.getFlashElement();return Function.prototype.apply.call(d[c],d,Array.prototype.slice.call(arguments,1))},attempt:function(){if(!this.available()){return false}try{this.call.apply(this,arguments)}catch(c){if(this.sIFR.debug){throw c}return false}return true},updateVars:function(c,e){for(var d=0;d<this.vars.length;d++){if(this.vars[d].split("=")[0]==c){this.vars[d]=c+"="+e;break}}var f=this.sIFR.util.encodeVars(this.vars);this.movie.injectVars(this.getFlashElement(),f);this.movie.injectVars(this.movie.html,f)},storeSize:function(c,d){this.movie.setSize(c,d);this.updateVars(c,d)},fireEvent:function(c){if(this.available()&&this.__events[c]){this.sIFR.util.delay(0,this.__events[c],this,this)}},resizeFlashElement:function(c,d,e){if(!this.available()){return }this.__resizing++;var f=this.getFlashElement();f.setAttribute("height",c);this.updateVars("renderheight",c);this.storeSize("height",c);if(d!==null){f.setAttribute("width",d);this.movie.setSize("width",d)}if(this.__events.onReplacement){this.sIFR.util.delay(0,this.__events.onReplacement,this,this);delete this.__events.onReplacement}if(e){this.sIFR.util.delay(0,function(){this.attempt("scaleMovie");this.__resizing--},this)}else{this.__resizing--}},blurFlashElement:function(){if(this.available()){this.sIFR.dom.blurElement(this.getFlashElement())}},resetMovie:function(){this.sIFR.util.delay(0,this.movie.reset,this.movie,this.getFlashElement(),this.getAlternate())},resizeAfterScale:function(){if(this.available()&&this.__resizing==0){this.sIFR.util.delay(0,this.resize,this)}},resize:function(){if(!this.available()){return }this.__resizing++;var g=this.getFlashElement();var f=g.offsetWidth;if(f==0){return }var e=g.getAttribute("width");var l=g.getAttribute("height");var m=this.getAncestor();var o=this.sIFR.dom.getHeightFromStyle(m);g.style.width="1px";g.style.height="1px";m.style.minHeight=o+"px";var c=this.getAlternate().childNodes;var n=[];for(var k=0;k<c.length;k++){var h=c[k].cloneNode(true);n.push(h);m.appendChild(h)}var d=this.sIFR.dom.getWidthFromStyle(m);for(var k=0;k<n.length;k++){m.removeChild(n[k])}g.style.width=g.style.height=m.style.minHeight="";g.setAttribute("width",this.__forceWidth?d:e);g.setAttribute("height",l);if(sIFR.ua.ie){g.style.display="none";var j=g.offsetHeight;g.style.display=""}if(d!=f){if(this.__forceWidth){this.storeSize("width",d)}this.attempt("resize",d)}this.__resizing--},replaceText:function(g,j){var d=this.sIFR.util.escape(g);if(!this.attempt("replaceText",d)){return false}this.updateVars("content",d);var f=this.getAlternate();if(j){while(f.firstChild){f.removeChild(f.firstChild)}for(var c=0;c<j.length;c++){f.appendChild(j[c])}}else{try{f.innerHTML=g}catch(h){}}return true},changeCSS:function(c){c=this.sIFR.util.escape(this.sIFR.util.cssToString(this.sIFR.util.convertCssArg(c)));this.updateVars("css",c);return this.attempt("changeCSS",c)},remove:function(){if(this.movie&&this.available()){this.movie.remove(this.getFlashElement(),this.id)}}};var X=new function(){this.create=function(p,n,j,i,f,e,g,o,l,h,m){var k=p.ua.ie?d:c;return new k(p,n,j,i,f,e,g,o,["flashvars",l,"wmode",h,"bgcolor",m,"allowScriptAccess","always","quality","best"])};function c(s,q,l,h,f,e,g,r,n){var m=s.dom.create("object",E.FLASH);var p=["type","application/x-shockwave-flash","id",f,"name",f,"data",e,"width",g,"height",r];for(var o=0;o<p.length;o+=2){m.setAttribute(p[o],p[o+1])}var j=m;if(h){j=W.create("div",E.FIX_FOCUS);j.appendChild(m)}for(var o=0;o<n.length;o+=2){if(n[o]=="name"){continue}var k=W.create("param");k.setAttribute("name",n[o]);k.setAttribute("value",n[o+1]);m.appendChild(k)}while(l.firstChild){l.removeChild(l.firstChild)}l.appendChild(j);this.html=j.cloneNode(true)}c.prototype={reset:function(e,f){e.parentNode.replaceChild(this.html.cloneNode(true),e)},remove:function(e,f){e.parentNode.removeChild(e)},setSize:function(e,f){this.html.setAttribute(e,f)},injectVars:function(e,g){var h=e.getElementsByTagName("param");for(var f=0;f<h.length;f++){if(h[f].getAttribute("name")=="flashvars"){h[f].setAttribute("value",g);break}}}};function d(p,n,j,h,f,e,g,o,k){this.dom=p.dom;this.broken=n;this.html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="'+f+'" width="'+g+'" height="'+o+'" class="'+E.FLASH+'"><param name="movie" value="'+e+'"></param></object>';var m="";for(var l=0;l<k.length;l+=2){m+='<param name="'+k[l]+'" value="'+k[l+1]+'"></param>'}this.html=this.html.replace(/(<\/object>)/,m+"$1");j.innerHTML=this.html;this.broken.register(j.firstChild)}d.prototype={reset:function(f,g){g=g.cloneNode(true);var e=f.parentNode;e.innerHTML=this.html;this.broken.register(e.firstChild);e.appendChild(g)},remove:function(e,f){this.broken.cleanup(f)},setSize:function(e,f){this.html=this.html.replace(e=="height"?/(height)="\d+"/:/(width)="\d+"/,'$1="'+f+'"')},injectVars:function(e,f){if(e!=this.html){return }this.html=this.html.replace(/(flashvars(=|\"\svalue=)\")[^\"]+/,"$1"+f)}}};this.errors=new Y(O);var A=this.util=new D(O);var W=this.dom=new U(O);var T=this.ua=new H(O);var G={fragmentIdentifier:new F(O),pageLoad:new S(O),prefetch:new N(O),brokenFlashIE:new b(O)};this.__resetBrokenMovies=G.brokenFlashIE.reset;var J={kwargs:[],replaceAll:function(d){for(var c=0;c<this.kwargs.length;c++){O.replace(this.kwargs[c])}if(!d){this.kwargs=[]}}};this.activate=function(){if(!T.supported||!this.isEnabled||this.isActive||!C()||a()){return }G.prefetch.fetchMovies(arguments);this.isActive=true;this.setFlashClass();G.fragmentIdentifier.cache();G.pageLoad.attachUnload();if(!this.autoInitialize){return }G.pageLoad.attach()};this.setFlashClass=function(){if(this.hasFlashClassSet){return }W.addClass(E.ACTIVE,W.getBody()||document.documentElement);this.hasFlashClassSet=true};this.removeFlashClass=function(){if(!this.hasFlashClassSet){return }W.removeClass(E.ACTIVE,W.getBody());W.removeClass(E.ACTIVE,document.documentElement);this.hasFlashClassSet=false};this.initialize=function(c){if(!this.isActive||!this.isEnabled){return }if(R){if(!c){J.replaceAll(false)}return }R=true;J.replaceAll(c);if(O.repaintOnResize){if(window.addEventListener){window.addEventListener("resize",Z,false)}else{window.attachEvent("onresize",Z)}}G.prefetch.clear()};this.replace=function(w,t){if(!T.supported){return }if(t){w=A.copyProperties(w,t)}if(!R){return J.kwargs.push(w)}if(this.onReplacementStart){this.onReplacementStart(w)}var AL=w.elements||W.querySelectorAll(w.selector);if(AL.length==0){return }var v=M(w.src);var AQ=A.convertCssArg(w.css);var u=B(w.filters);var AM=w.forceSingleLine===true;var AR=w.preventWrap===true&&!AM;var p=AM||(w.fitExactly==null?this.fitExactly:w.fitExactly)===true;var AC=p||(w.forceWidth==null?this.forceWidth:w.forceWidth)===true;var r=w.ratios||[];var AD=w.pixelFont===true;var q=parseInt(w.tuneHeight)||0;var y=!!w.onRelease||!!w.onRollOver||!!w.onRollOut;if(p){A.extractFromCss(AQ,".sIFR-root","text-align",true)}var s=A.extractFromCss(AQ,".sIFR-root","font-size",true)||"0";var e=A.extractFromCss(AQ,".sIFR-root","background-color",true)||"#FFFFFF";var n=A.extractFromCss(AQ,".sIFR-root","kerning",true)||"";var AV=A.extractFromCss(AQ,".sIFR-root","opacity",true)||"100";var k=A.extractFromCss(AQ,".sIFR-root","cursor",true)||"default";var AO=parseInt(A.extractFromCss(AQ,".sIFR-root","leading"))||0;var AI=w.gridFitType||(A.extractFromCss(AQ,".sIFR-root","text-align")=="right")?"subpixel":"pixel";var h=this.forceTextTransform===false?"none":A.extractFromCss(AQ,".sIFR-root","text-transform",true)||"none";s=/^\d+(px)?$/.test(s)?parseInt(s):0;AV=parseFloat(AV)<1?100*parseFloat(AV):AV;var AB=w.modifyCss?"":A.cssToString(AQ);var AF=w.wmode||"";if(!AF){if(w.transparent){AF="transparent"}else{if(w.opaque){AF="opaque"}}}if(AF=="transparent"){if(!T.transparencySupport){AF="opaque"}else{e="transparent"}}for(var AU=0;AU<AL.length;AU++){var AE=AL[AU];if(W.hasOneOfClassses(E.IGNORE_CLASSES,AE)||W.ancestorHasClass(AE,E.ALTERNATE)){continue}var AN=W.getDimensions(AE);var f=AN.height;var c=AN.width;var z=W.getComputedStyle(AE,"display");if(!f||!c||!z||z=="none"){continue}c=W.getWidthFromStyle(AE);var m,AG;if(!s){var AK=I(AE);m=Math.min(this.MAX_FONT_SIZE,Math.max(this.MIN_FONT_SIZE,AK.fontSize));if(AD){m=Math.max(8,8*Math.round(m/8))}AG=AK.lines;if(isNaN(AG)||!isFinite(AG)||AG==0){AG=1}if(AG>1&&AO){f+=Math.round((AG-1)*AO)}}else{m=s;AG=1}var d=W.create("span",E.ALTERNATE);var AW=AE.cloneNode(true);AE.parentNode.appendChild(AW);for(var AT=0,AS=AW.childNodes.length;AT<AS;AT++){d.appendChild(AW.childNodes[AT].cloneNode(true))}if(w.modifyContent){w.modifyContent(AW,w.selector)}if(w.modifyCss){AB=w.modifyCss(AQ,AW,w.selector)}var o=P(AW,h,w.uriEncode);AW.parentNode.removeChild(AW);if(w.modifyContentString){o.text=w.modifyContentString(o.text,w.selector)}if(o.text==""){continue}f=Math.round(AG*m);var AJ=Math.round(AG*V(m,r)*m)+this.FLASH_PADDING_BOTTOM+q;var AA=AC?c:"100%";var AH="sIFR_replacement_"+L++;var AP=["id="+AH,"content="+A.escape(o.text),"width="+c,"height="+f,"renderheight="+AJ,"link="+A.escape(o.primaryLink.href||""),"target="+A.escape(o.primaryLink.target||""),"size="+m,"css="+A.escape(AB),"cursor="+k,"tunewidth="+(w.tuneWidth||0),"tuneheight="+q,"offsetleft="+(w.offsetLeft||""),"offsettop="+(w.offsetTop||""),"fitexactly="+p,"preventwrap="+AR,"forcesingleline="+AM,"antialiastype="+(w.antiAliasType||""),"thickness="+(w.thickness||""),"sharpness="+(w.sharpness||""),"kerning="+n,"gridfittype="+AI,"flashfilters="+u,"opacity="+AV,"blendmode="+(w.blendMode||""),"selectable="+(w.selectable==null?"true":w.selectable===true),"fixhover="+(this.fixHover===true),"events="+y,"version="+this.VERSION];var x=A.encodeVars(AP);var g=new K(O,AH,AP,AC,{onReplacement:w.onReplacement,onRollOver:w.onRollOver,onRollOut:w.onRollOut,onRelease:w.onRelease});g.movie=X.create(sIFR,G.brokenFlashIE,AE,T.fixFocus&&w.fixFocus,AH,v,AA,AJ,x,AF,e);this.replacements.push(g);this.replacements[AH]=g;if(w.selector){if(!this.replacements[w.selector]){this.replacements[w.selector]=[g]}else{this.replacements[w.selector].push(g)}}d.setAttribute("id",AH+"_alternate");AE.appendChild(d);W.addClass(E.REPLACED,AE)}G.fragmentIdentifier.restore()};this.getReplacementByFlashElement=function(d){for(var c=0;c<O.replacements.length;c++){if(O.replacements[c].id==d.getAttribute("id")){return O.replacements[c]}}};this.redraw=function(){for(var c=0;c<O.replacements.length;c++){O.replacements[c].resetMovie()}};this.clearReferences=function(){G.brokenFlashIE.clearReferences();G=null;J=null;delete O.replacements};function C(){if(O.domains.length==0){return true}var d=A.domain();for(var c=0;c<O.domains.length;c++){if(A.domainMatches(d,O.domains[c])){return true}}return false}function a(){if(document.location.protocol=="file:"){if(O.debug){O.errors.fire("isFile")}return true}return false}function M(c){if(T.ie&&c.charAt(0)=="/"){c=window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/,"$1$2$3")+c}return c}function V(d,e){for(var c=0;c<e.length;c+=2){if(d<=e[c]){return e[c+1]}}return e[e.length-1]||1}function B(g){var e=[];for(var d in g){if(g[d]==Object.prototype[d]){continue}var c=g[d];d=[d.replace(/filter/i,"")+"Filter"];for(var f in c){if(c[f]==Object.prototype[f]){continue}d.push(f+":"+A.escape(A.toJson(c[f],A.toHexString)))}e.push(d.join(","))}return A.escape(e.join(";"))}function Z(d){var e=Z.viewport;var c=W.getViewport();if(e&&c.width==e.width&&c.height==e.height){return }Z.viewport=c;if(O.replacements.length==0){return }if(Z.timer){clearTimeout(Z.timer)}Z.timer=setTimeout(function(){delete Z.timer;for(var f=0;f<O.replacements.length;f++){O.replacements[f].resize()}},200)}function I(g){var h,d;if(!T.ie){h=W.getStyleAsInt(g,"lineHeight");d=Math.floor(W.getStyleAsInt(g,"height")/h)}else{if(T.ie){var h=W.getComputedStyle(g,"fontSize");if(h.indexOf("px")>0){h=parseInt(h)}else{var f=g.innerHTML;g.style.visibility="visible";g.style.overflow="visible";g.style.position="static";g.style.zoom="normal";g.style.writingMode="lr-tb";g.style.width=g.style.height="auto";g.style.maxWidth=g.style.maxHeight=g.style.styleFloat="none";var i=g;var c=g.currentStyle.hasLayout;if(c){g.innerHTML='<div class="'+E.LAYOUT+'">X<br>X<br>X</div>';i=g.firstChild}else{g.innerHTML="X<br>X<br>X"}var e=i.getClientRects();h=e[1].bottom-e[1].top;h=Math.ceil(h*0.8);if(c){g.innerHTML='<div class="'+E.LAYOUT+'">'+f+"</div>";i=g.firstChild}else{g.innerHTML=f}e=i.getClientRects();d=e.length;if(c){g.innerHTML=f}g.style.visibility=g.style.width=g.style.height=g.style.maxWidth=g.style.maxHeight=g.style.overflow=g.style.styleFloat=g.style.position=g.style.zoom=g.style.writingMode=""}}}return{fontSize:h,lines:d}}function P(c,g,s){s=s||A.uriEncode;var q=[],m=[];var k=null;var e=c.childNodes;var o=false,p=false;var j=0;while(j<e.length){var f=e[j];if(f.nodeType==3){var t=A.textTransform(g,A.normalize(f.nodeValue)).replace(/</g,"&lt;");if(o&&p){t=t.replace(/^\s+/,"")}m.push(t);o=/\s$/.test(t);p=false}if(f.nodeType==1&&!/^(style|script)$/i.test(f.nodeName)){var h=[];var r=f.nodeName.toLowerCase();var n=f.className||"";if(/\s+/.test(n)){if(n.indexOf(E.CLASS)>-1){n=n.match("(\\s|^)"+E.CLASS+"-([^\\s$]*)(\\s|$)")[2]}else{n=n.match(/^([^\s]+)/)[1]}}if(n!=""){h.push('class="'+n+'"')}if(r=="a"){var d=s(f.getAttribute("href")||"");var l=f.getAttribute("target")||"";h.push('href="'+d+'"','target="'+l+'"');if(!k){k={href:d,target:l}}}m.push("<"+r+(h.length>0?" ":"")+h.join(" ")+">");p=true;if(f.hasChildNodes()){q.push(j);j=0;e=f.childNodes;continue}else{if(!/^(br|img)$/i.test(f.nodeName)){m.push("</",f.nodeName.toLowerCase(),">")}}}if(q.length>0&&!f.nextSibling){do{j=q.pop();e=f.parentNode.parentNode.childNodes;f=e[j];if(f){m.push("</",f.nodeName.toLowerCase(),">")}}while(j==e.length-1&&q.length>0)}j++}return{text:m.join("").replace(/^\s+|\s+$|\s*(<br>)\s*/g,"$1"),primaryLink:k||{}}}};
var parseSelector=(function(){var B=/\s*,\s*/;var A=/\s*([\s>+~(),]|^|$)\s*/g;var L=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var F=/(^|\))[^\s>+~]/g;var M=/(\)|^)/;var K=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;function H(R,P){P=P||document.documentElement;var S=R.split(B),X=[];for(var U=0;U<S.length;U++){var N=[P],W=G(S[U]);for(var T=0;T<W.length;){var Q=W[T++],O=W[T++],V="";if(W[T]=="("){while(W[T++]!=")"&&T<W.length){V+=W[T]}V=V.slice(0,-1)}N=I(N,Q,O,V)}X=X.concat(N)}return X}function G(N){var O=N.replace(A,"$1").replace(L,"$1*$2").replace(F,D);return O.match(K)||[]}function D(N){return N.replace(M,"$1 ")}function I(N,P,Q,O){return(H.selectors[P])?H.selectors[P](N,Q,O):[]}var E={toArray:function(O){var N=[];for(var P=0;P<O.length;P++){N.push(O[P])}return N}};var C={isTag:function(O,N){return(N=="*")||(N.toLowerCase()==O.nodeName.toLowerCase())},previousSiblingElement:function(N){do{N=N.previousSibling}while(N&&N.nodeType!=1);return N},nextSiblingElement:function(N){do{N=N.nextSibling}while(N&&N.nodeType!=1);return N},hasClass:function(N,O){return(O.className||"").match("(^|\\s)"+N+"(\\s|$)")},getByTag:function(N,O){return O.getElementsByTagName(N)}};var J={"#":function(N,P){for(var O=0;O<N.length;O++){if(N[O].getAttribute("id")==P){return[N[O]]}}return[]}," ":function(O,Q){var N=[];for(var P=0;P<O.length;P++){N=N.concat(E.toArray(C.getByTag(Q,O[P])))}return N},">":function(O,R){var N=[];for(var Q=0,S;Q<O.length;Q++){S=O[Q];for(var P=0,T;P<S.childNodes.length;P++){T=S.childNodes[P];if(T.nodeType==1&&C.isTag(T,R)){N.push(T)}}}return N},".":function(O,Q){var N=[];for(var P=0,R;P<O.length;P++){R=O[P];if(C.hasClass([Q],R)){N.push(R)}}return N},":":function(N,P,O){return(H.pseudoClasses[P])?H.pseudoClasses[P](N,O):[]}};H.selectors=J;H.pseudoClasses={};H.util=E;H.dom=C;return H})();var bakzidenz = {
	src: 'sifr/flash/ak_bold.swf'
};
var akzidenz = {
	src: 'sifr/flash/akzidenz.swf'
};
sIFR.activate(bakzidenz);
sIFR.activate(akzidenz);
	if(!(Browser.Engine.trident && Browser.Engine.version < 5)) {
		sIFR.replace(akzidenz, {
			selector: '.akzidenz37'
			,wmode: 'transparent'
			,fitExactly:true
			,forceWidth:true
			,fixHover:true
			,css: [
			  '.sIFR-root { color:#000000;font-size:37px;}'
			]
		  });
		
		sIFR.replace(akzidenz, {
			selector: '.akzidenz'
			,wmode: 'transparent'
			,fitExactly:true
			,forceWidth:true
			,fixHover:true
			,css: [
			  '.sIFR-root { color:#000000;font-size:30px;}'
			]
		  });
	}else{
		$$("h1").each(function(item,index){
		item.removeClass("akzidenz");
		item.style.visibility = "visible";
		item.stlye.display = "block";
		item.style.paddingBottom = "5px;"
	});		
}
sIFR.replace(bakzidenz, {
    selector: '.btflash'
	,wmode: 'transparent'
    ,css: [
      '.sIFR-root { color:#000000; font-size: 12px; }'
      ,'a {color:#000000;}'
    ]
  });

sIFR.replace(bakzidenz, {
    selector: '.flashkrd'
	,wmode: 'transparent'
	,fitExactly:true
	,forceWidth:true
	,fixHover:true
    ,css: [
      '.sIFR-root { color:#808080;font-size: 12px;}'
      ,'strong {font-weight:bold;}'
    ]
  });
//});