/*
 * Fitness Anywhere Inc. Plugins File
 * Insert all jQuery plugins into this file, all functions should be called in
 * the scripts.js file
 *
 * Some scoped scripts that don't need separate invocation can be found here as
 * well, ya never know do ya?
 * 
 * Alex Hackbart - November 17, 2011
 */

/*
 * TABLE OF CONTENTS
 *
 * 1. Cookie Plugin
 * 2. qTip Plugin
 * 3. Colorbox Plugin
 * 4. hoverIntent Plugin
 * 5. Easing Plugin
 * 6. Tab Plugin
 * 7. DDAccordion
 * 8. jCarousel Lite Plugin
 * 9. Selector Dropdown Script
 * 10. Validation Plugin
 * 11. In-Field Label Plugin
 * 12. Yetii
 * 13. vjustify
 * 14. runOnLoad
 * 15. Cattree

/*
 * Cookie Plugin
 */

jQuery.cookie=function(key,value,options){if(arguments.length>1&&String(value)!=="[object Object]"){options=jQuery.extend({},options);if(value===null||value===undefined){options.expires=-1}if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days)}value=String(value);return(document.cookie=[encodeURIComponent(key),"=",options.raw?value:encodeURIComponent(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join(""))}options=value||{};var result,decode=options.raw?function(s){return s}:decodeURIComponent;return(result=new RegExp("(?:^|; )"+encodeURIComponent(key)+"=([^;]*)").exec(document.cookie))?decode(result[1]):null};

/*
 * qtip Plugin 
 */

(function($,window,undefined){var TRUE=true,FALSE=false,NULL=null,QTIP,PLUGINS,MOUSE,uitooltip="ui-tooltip",widget="ui-widget",disabled="ui-state-disabled",selector="div.qtip."+uitooltip,defaultClass=uitooltip+"-default",focusClass=uitooltip+"-focus",hoverClass=uitooltip+"-hover",hideOffset="-31000px",replaceSuffix="_replacedByqTip",oldtitle="oldtitle";function sanitizeOptions(opts){var content;if(!opts||"object"!==typeof opts){return FALSE}if("object"!==typeof opts.metadata){opts.metadata={type:opts.metadata}}if("content" in opts){if("object"!==typeof opts.content||opts.content.jquery){opts.content={text:opts.content}}content=opts.content.text||FALSE;if(!$.isFunction(content)&&((!content&&!content.attr)||content.length<1||("object"===typeof content&&!content.jquery))){opts.content.text=FALSE}if("title" in opts.content){if("object"!==typeof opts.content.title){opts.content.title={text:opts.content.title}}content=opts.content.title.text||FALSE;if(!$.isFunction(content)&&((!content&&!content.attr)||content.length<1||("object"===typeof content&&!content.jquery))){opts.content.title.text=FALSE}}}if("position" in opts){if("object"!==typeof opts.position){opts.position={my:opts.position,at:opts.position}}}if("show" in opts){if("object"!==typeof opts.show){if(opts.show.jquery){opts.show={target:opts.show}}else{opts.show={event:opts.show}}}}if("hide" in opts){if("object"!==typeof opts.hide){if(opts.hide.jquery){opts.hide={target:opts.hide}}else{opts.hide={event:opts.hide}}}}if("style" in opts){if("object"!==typeof opts.style){opts.style={classes:opts.style}}}$.each(PLUGINS,function(){if(this.sanitize){this.sanitize(opts)}});return opts}function QTip(target,options,id,attr){var self=this,docBody=document.body,tooltipID=uitooltip+"-"+id,isPositioning=0,isDrawing=0,tooltip=$(),namespace=".qtip-"+id,elements,cache;self.id=id;self.rendered=FALSE;self.elements=elements={target:target};self.timers={img:[]};self.options=options;self.checks={};self.plugins={};self.cache=cache={event:{},target:$(),disabled:FALSE,attr:attr};function convertNotation(notation){var i=0,obj,option=options,levels=notation.split(".");while(option=option[levels[i++]]){if(i<levels.length){obj=option}}return[obj||options,levels.pop()]}function setWidget(){var on=options.style.widget;tooltip.toggleClass(widget,on).toggleClass(defaultClass,!on);elements.content.toggleClass(widget+"-content",on);if(elements.titlebar){elements.titlebar.toggleClass(widget+"-header",on)}if(elements.button){elements.button.toggleClass(uitooltip+"-icon",!on)}}function removeTitle(){if(elements.title){elements.titlebar.remove();elements.titlebar=elements.title=elements.button=NULL;self.reposition()}}function createButton(){var button=options.content.title.button,isString=typeof button==="string",close=isString?button:"Close tooltip";if(elements.button){elements.button.remove()}if(button.jquery){elements.button=button}else{elements.button=$("<a />",{"class":"ui-state-default "+(options.style.widget?"":uitooltip+"-icon"),title:close,"aria-label":close}).prepend($("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"}))}elements.button.appendTo(elements.titlebar).attr("role","button").hover(function(event){$(this).toggleClass("ui-state-hover",event.type==="mouseenter")}).click(function(event){if(!tooltip.hasClass(disabled)){self.hide(event)}return FALSE}).bind("mousedown keydown mouseup keyup mouseout",function(event){$(this).toggleClass("ui-state-active ui-state-focus",event.type.substr(-4)==="down")});self.redraw()}function createTitle(){var id=tooltipID+"-title";if(elements.titlebar){removeTitle()}elements.titlebar=$("<div />",{"class":uitooltip+"-titlebar "+(options.style.widget?"ui-widget-header":"")}).append(elements.title=$("<div />",{id:id,"class":uitooltip+"-title","aria-atomic":TRUE})).insertBefore(elements.content);if(options.content.title.button){createButton()}else{if(self.rendered){self.redraw()}}}function updateButton(button){var elem=elements.button,title=elements.title;if(!self.rendered){return FALSE}if(!button){elem.remove()}else{if(!title){createTitle()}createButton()}}function updateTitle(content){var elem=elements.title;if(!self.rendered||!content){return FALSE}if($.isFunction(content)){content=content.call(target,self)||""}if(content.jquery&&content.length>0){elem.empty().append(content.css({display:"block"}))}else{elem.html(content)}self.redraw();if(self.rendered&&tooltip.is(":visible")){self.reposition(cache.event)}}function updateContent(content,reposition){var elem=elements.content;content=content||options.content.text;if(!self.rendered||!content){return FALSE}if($.isFunction(content)){content=content.call(target,self)||""}if(content.jquery&&content.length>0){elem.empty().append(content.css({display:"block"}))}else{elem.html(content)}function detectImages(next){var images;function imageLoad(event){if((images=images.not(this)).length===0){self.redraw();if(reposition!==FALSE){self.reposition(cache.event)}next()}}if((images=elem.find("img:not([height]):not([width])")).length===0){return imageLoad.call(images)}images.each(function(i,elem){(function timer(){var timers=self.timers.img;if(elem.height&&elem.width){clearTimeout(timers[i]);return imageLoad.call(elem)}timers[i]=setTimeout(timer,20)}())})}if(self.rendered<0){tooltip.queue("fx",detectImages)}else{isDrawing=0;detectImages($.noop)}return self}function assignEvents(){var posOptions=options.position,targets={show:options.show.target,hide:options.hide.target,viewport:$(posOptions.viewport),document:$(document),window:$(window)},events={show:$.trim(""+options.show.event).split(" "),hide:$.trim(""+options.hide.event).split(" ")},IE6=$.browser.msie&&parseInt($.browser.version,10)===6;function showMethod(event){if(tooltip.hasClass(disabled)){return FALSE}targets.show.trigger("qtip-"+id+"-inactive");clearTimeout(self.timers.show);clearTimeout(self.timers.hide);var callback=function(){self.show(event)};if(options.show.delay>0){self.timers.show=setTimeout(callback,options.show.delay)}else{callback()}}function hideMethod(event){if(tooltip.hasClass(disabled)){return FALSE}var relatedTarget=$(event.relatedTarget||event.target),ontoTooltip=relatedTarget.closest(selector)[0]===tooltip[0],ontoTarget=relatedTarget[0]===targets.show[0];clearTimeout(self.timers.show);clearTimeout(self.timers.hide);if((posOptions.target==="mouse"&&ontoTooltip)||(options.hide.fixed&&((/mouse(out|leave|move)/).test(event.type)&&(ontoTooltip||ontoTarget)))){event.preventDefault();return}if(options.hide.delay>0){self.timers.hide=setTimeout(function(){self.hide(event)},options.hide.delay)}else{self.hide(event)}}function inactiveMethod(event){if(tooltip.hasClass(disabled)){return FALSE}clearTimeout(self.timers.inactive);self.timers.inactive=setTimeout(function(){self.hide(event)},options.hide.inactive)}function repositionMethod(event){if(tooltip.is(":visible")){self.reposition(event)}}tooltip.bind("mouseenter"+namespace+" mouseleave"+namespace,function(event){var state=event.type==="mouseenter";if(state){self.focus(event)}tooltip.toggleClass(hoverClass,state)});if(options.hide.fixed){targets.hide=targets.hide.add(tooltip);tooltip.bind("mouseover"+namespace,function(){if(!tooltip.hasClass(disabled)){clearTimeout(self.timers.hide)}})}if(/mouse(out|leave)/i.test(options.hide.event)){if(options.hide.leave){targets.window.bind("mouse"+(options.hide.leave.indexOf("frame")>-1?"out":"leave")+namespace,function(event){if(/select|option/.test(event.target)&&!event.relatedTarget){self.hide(event)}})}}else{if(/mouse(over|enter)/i.test(options.show.event)){targets.hide.bind("mouseleave"+namespace,function(event){clearTimeout(self.timers.show)})}}if((""+options.hide.event).indexOf("unfocus")>-1){targets.document.bind("mousedown"+namespace,function(event){var $target=$(event.target),enabled=!tooltip.hasClass(disabled)&&tooltip.is(":visible");if($target.parents(selector).length===0&&$target.add(target).length>1){self.hide(event)}})}if("number"===typeof options.hide.inactive){targets.show.bind("qtip-"+id+"-inactive",inactiveMethod);$.each(QTIP.inactiveEvents,function(index,type){targets.hide.add(elements.tooltip).bind(type+namespace+"-inactive",inactiveMethod)})}$.each(events.hide,function(index,type){var showIndex=$.inArray(type,events.show),targetHide=$(targets.hide);if((showIndex>-1&&targetHide.add(targets.show).length===targetHide.length)||type==="unfocus"){targets.show.bind(type+namespace,function(event){if(tooltip.is(":visible")){hideMethod(event)}else{showMethod(event)}});delete events.show[showIndex]}else{targets.hide.bind(type+namespace,hideMethod)}});$.each(events.show,function(index,type){targets.show.bind(type+namespace,showMethod)});if("number"===typeof options.hide.distance){targets.show.bind("mousemove"+namespace,function(event){var origin=cache.origin||{},limit=options.hide.distance,abs=Math.abs;if(abs(event.pageX-origin.pageX)>=limit||abs(event.pageY-origin.pageY)>=limit){self.hide(event)}})}if(posOptions.target==="mouse"){targets.show.add(tooltip).bind("mousemove"+namespace,function(event){MOUSE={pageX:event.pageX,pageY:event.pageY,type:"mousemove"}});if(posOptions.adjust.mouse){if(options.hide.event){tooltip.bind("mouseleave"+namespace,function(event){if((event.relatedTarget||event.target)!==targets.show[0]){self.hide(event)}})}targets.document.bind("mousemove"+namespace,function(event){if(!tooltip.hasClass(disabled)&&tooltip.is(":visible")){self.reposition(event||MOUSE)}})}}if(posOptions.adjust.resize||targets.viewport.length){($.event.special.resize?targets.viewport:targets.window).bind("resize"+namespace,repositionMethod)}if(targets.viewport.length||(IE6&&tooltip.css("position")==="fixed")){targets.viewport.bind("scroll"+namespace,repositionMethod)}}function unassignEvents(){var targets=[options.show.target[0],options.hide.target[0],self.rendered&&elements.tooltip[0],options.position.container[0],options.position.viewport[0],window,document];if(self.rendered){$([]).pushStack($.grep(targets,function(i){return typeof i==="object"})).unbind(namespace)}else{options.show.target.unbind(namespace+"-create")}}self.checks.builtin={"^id$":function(obj,o,v){var id=v===TRUE?QTIP.nextid:v,tooltipID=uitooltip+"-"+id;if(id!==FALSE&&id.length>0&&!$("#"+tooltipID).length){tooltip[0].id=tooltipID;elements.content[0].id=tooltipID+"-content";elements.title[0].id=tooltipID+"-title"}},"^content.text$":function(obj,o,v){updateContent(v)},"^content.title.text$":function(obj,o,v){if(!v){return removeTitle()}if(!elements.title&&v){createTitle()}updateTitle(v)},"^content.title.button$":function(obj,o,v){updateButton(v)},"^position.(my|at)$":function(obj,o,v){if("string"===typeof v){obj[o]=new PLUGINS.Corner(v)}},"^position.container$":function(obj,o,v){if(self.rendered){tooltip.appendTo(v)}},"^show.ready$":function(){if(!self.rendered){self.render(1)}else{self.show()}},"^style.classes$":function(obj,o,v){$.attr(tooltip[0],"class",uitooltip+" qtip ui-helper-reset "+v)},"^style.widget|content.title":setWidget,"^events.(render|show|move|hide|focus|blur)$":function(obj,o,v){tooltip[($.isFunction(v)?"":"un")+"bind"]("tooltip"+o,v)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)$":function(){unassignEvents();assignEvents()}};$.extend(self,{render:function(show){if(self.rendered){return self}var title=options.content.title.text,callback=$.Event("tooltiprender");$.attr(target[0],"aria-describedby",tooltipID);tooltip=elements.tooltip=$("<div/>",{id:tooltipID,"class":uitooltip+" qtip ui-helper-reset "+defaultClass+" "+options.style.classes,width:options.style.width||"",role:"alert","aria-live":"polite","aria-atomic":FALSE,"aria-describedby":tooltipID+"-content","aria-hidden":TRUE}).toggleClass(disabled,cache.disabled).data("qtip",self).appendTo(options.position.container).append(elements.content=$("<div />",{"class":uitooltip+"-content",id:tooltipID+"-content","aria-atomic":TRUE}));self.rendered=-1;isDrawing=1;if(title){createTitle();updateTitle(title)}updateContent(FALSE,FALSE);self.rendered=TRUE;setWidget();$.each(options.events,function(name,callback){if($.isFunction(callback)){tooltip.bind(name==="toggle"?"tooltipshow tooltiphide":"tooltip"+name,callback)}});$.each(PLUGINS,function(){if(this.initialize==="render"){this(self)}});assignEvents();tooltip.queue("fx",function(next){callback.originalEvent=cache.event;tooltip.trigger(callback,[self]);isDrawing=0;self.redraw();if(options.show.ready||show){self.show(cache.event)}next()});return self},get:function(notation){var result,o;switch(notation.toLowerCase()){case"dimensions":result={height:tooltip.outerHeight(),width:tooltip.outerWidth()};break;case"offset":result=PLUGINS.offset(tooltip,options.position.container);break;default:o=convertNotation(notation.toLowerCase());result=o[0][o[1]];result=result.precedance?result.string():result;break}return result},set:function(option,value){var rmove=/^position\.(my|at|adjust|target|container)|style|content|show\.ready/i,rdraw=/^content\.(title|attr)|style/i,reposition=FALSE,redraw=FALSE,checks=self.checks,name;function callback(notation,args){var category,rule,match;for(category in checks){for(rule in checks[category]){if(match=(new RegExp(rule,"i")).exec(notation)){args.push(match);checks[category][rule].apply(self,args)}}}}if("string"===typeof option){name=option;option={};option[name]=value}else{option=$.extend(TRUE,{},option)}$.each(option,function(notation,value){var obj=convertNotation(notation.toLowerCase()),previous;previous=obj[0][obj[1]];obj[0][obj[1]]="object"===typeof value&&value.nodeType?$(value):value;option[notation]=[obj[0],obj[1],value,previous];reposition=rmove.test(notation)||reposition;redraw=rdraw.test(notation)||redraw});sanitizeOptions(options);isPositioning=isDrawing=1;$.each(option,callback);isPositioning=isDrawing=0;if(tooltip.is(":visible")&&self.rendered){if(reposition){self.reposition(options.position.target==="mouse"?NULL:cache.event)}if(redraw){self.redraw()}}return self},toggle:function(state,event){if(!self.rendered){if(state){self.render(1)}else{return self}}var type=state?"show":"hide",opts=options[type],visible=tooltip.is(":visible"),sameTarget=cache.target[0]===event.target,delay,callback;if((typeof state).search("boolean|number")){state=!visible}if(visible===state&&sameTarget){return self}if(event){if((/over|enter/).test(event.type)&&(/out|leave/).test(cache.event.type)&&event.target===options.show.target[0]&&tooltip.has(event.relatedTarget).length){return self}cache.event=$.extend({},event)}callback=$.Event("tooltip"+type);callback.originalEvent=event?cache.event:NULL;tooltip.trigger(callback,[self,90]);if(callback.isDefaultPrevented()){return self}$.attr(tooltip[0],"aria-hidden",!!!state);if(state){cache.origin=$.extend({},MOUSE);self.focus(event);if($.isFunction(options.content.text)){updateContent()}self.reposition(event);if(opts.solo){$(selector,opts.solo).not(tooltip).qtip("hide",callback)}}else{clearTimeout(self.timers.show);delete cache.origin;self.blur(event)}function after(){if(!state){tooltip.css({display:"",visibility:"",width:options.style.width||"",opacity:"",left:"",top:""})}else{if($.browser.msie){tooltip[0].style.removeAttribute("filter")}tooltip.css("overflow","")}}if(sameTarget){tooltip.stop(0,1)}if(sameTarget||opts.effect===FALSE){tooltip[type]();after.call(tooltip)}else{if($.isFunction(opts.effect)){opts.effect.call(tooltip,self);tooltip.queue("fx",function(n){after();n()})}else{tooltip.fadeTo(90,state?1:0,after)}}if(state){opts.target.trigger("qtip-"+id+"-inactive")}return self},show:function(event){return self.toggle(TRUE,event)},hide:function(event){return self.toggle(FALSE,event)},focus:function(event){if(!self.rendered){return self}var qtips=$(selector),curIndex=parseInt(tooltip[0].style.zIndex,10),newIndex=QTIP.zindex+qtips.length,cachedEvent=$.extend({},event),focusedElem,callback;if(!tooltip.hasClass(focusClass)){callback=$.Event("tooltipfocus");callback.originalEvent=cachedEvent;tooltip.trigger(callback,[self,newIndex]);if(!callback.isDefaultPrevented()){if(curIndex!==newIndex){qtips.each(function(){if(this.style.zIndex>curIndex){this.style.zIndex=this.style.zIndex-1}});qtips.filter("."+focusClass).qtip("blur",cachedEvent)}tooltip.addClass(focusClass)[0].style.zIndex=newIndex}}return self},blur:function(event){var cachedEvent=$.extend({},event),callback;tooltip.removeClass(focusClass);callback=$.Event("tooltipblur");callback.originalEvent=cachedEvent;tooltip.trigger(callback,[self]);return self},reposition:function(event,effect){if(!self.rendered||isPositioning){return self}isPositioning=1;var target=options.position.target,posOptions=options.position,my=posOptions.my,at=posOptions.at,adjust=posOptions.adjust,method=adjust.method.split(" "),elemWidth=tooltip.outerWidth(),elemHeight=tooltip.outerHeight(),targetWidth=0,targetHeight=0,callback=$.Event("tooltipmove"),fixed=tooltip.css("position")==="fixed",viewport=posOptions.viewport,position={left:0,top:0},tip=(self.plugins.tip||{}).corner,readjust={horizontal:method[0],vertical:method[1]||method[0],tip:options.style.tip||{},left:function(posLeft){var isShift=readjust.horizontal==="shift",viewportScroll=viewport.offset.left+viewport.scrollLeft,myWidth=my.x==="left"?elemWidth:my.x==="right"?-elemWidth:-elemWidth/2,atWidth=at.x==="left"?targetWidth:at.x==="right"?-targetWidth:-targetWidth/2,tipWidth=(readjust.tip.width+readjust.tip.border*2)||0,tipAdjust=tip&&tip.precedance==="x"&&!isShift?tipWidth:0,overflowLeft=viewportScroll-posLeft-tipAdjust,overflowRight=posLeft+elemWidth-viewport.width-viewportScroll+tipAdjust,offset=myWidth-(my.precedance==="x"||my.x===my.y?atWidth:0),isCenter=my.x==="center";if(isShift){tipAdjust=tip&&tip.precedance==="y"?tipWidth:0;offset=(my.x==="left"?1:-1)*myWidth-tipAdjust;position.left+=overflowLeft>0?overflowLeft:overflowRight>0?-overflowRight:0;position.left=Math.max(viewport.offset.left+(tipAdjust&&tip.x==="center"?readjust.tip.offset:0),posLeft-offset,Math.min(Math.max(viewport.offset.left+viewport.width,posLeft+offset),position.left))}else{if(overflowLeft>0&&(my.x!=="left"||overflowRight>0)){position.left-=offset+(isCenter?0:2*adjust.x)}else{if(overflowRight>0&&(my.x!=="right"||overflowLeft>0)){position.left-=isCenter?-offset:offset+(2*adjust.x)}}if(position.left!==posLeft&&isCenter){position.left-=adjust.x}if(position.left<viewportScroll&&-position.left>overflowRight){position.left=posLeft}}return position.left-posLeft},top:function(posTop){var isShift=readjust.vertical==="shift",viewportScroll=viewport.offset.top+viewport.scrollTop,myHeight=my.y==="top"?elemHeight:my.y==="bottom"?-elemHeight:-elemHeight/2,atHeight=at.y==="top"?targetHeight:at.y==="bottom"?-targetHeight:-targetHeight/2,tipHeight=(readjust.tip.height+readjust.tip.border*2)||0,tipAdjust=tip&&tip.precedance==="y"&&!isShift?tipHeight:0,overflowTop=viewportScroll-posTop-tipAdjust,overflowBottom=posTop+elemHeight-viewport.height-viewportScroll+tipAdjust,offset=myHeight-(my.precedance==="y"||my.x===my.y?atHeight:0),isCenter=my.y==="center";if(isShift){tipAdjust=tip&&tip.precedance==="x"?tipHeight:0;offset=(my.y==="top"?1:-1)*myHeight-tipAdjust;position.top+=overflowTop>0?overflowTop:overflowBottom>0?-overflowBottom:0;position.top=Math.max(viewport.offset.top+(tipAdjust&&tip.x==="center"?readjust.tip.offset:0),posTop-offset,Math.min(Math.max(viewport.offset.top+viewport.height,posTop+offset),position.top))}else{if(overflowTop>0&&(my.y!=="top"||overflowBottom>0)){position.top-=offset+(isCenter?0:2*adjust.y)}else{if(overflowBottom>0&&(my.y!=="bottom"||overflowTop>0)){position.top-=isCenter?-offset:offset+(2*adjust.y)}}if(position.top!==posTop&&isCenter){position.top-=adjust.y}if(position.top<0&&-position.top>overflowBottom){position.top=posTop}}return position.top-posTop}};if(target==="mouse"){at={x:"left",y:"top"};event=event&&(event.type==="resize"||event.type==="scroll")?cache.event:!adjust.mouse&&cache.origin?cache.origin:MOUSE&&(adjust.mouse||!event||!event.pageX)?{pageX:MOUSE.pageX,pageY:MOUSE.pageY}:event;position={top:event.pageY,left:event.pageX}}else{if(target==="event"){if(event&&event.target&&event.type!=="scroll"&&event.type!=="resize"){target=cache.target=$(event.target)}else{target=cache.target}}else{cache.target=$(target)}target=$(target).eq(0);if(target.length===0){return self}else{if(target[0]===document||target[0]===window){targetWidth=PLUGINS.iOS?window.innerWidth:target.width();targetHeight=PLUGINS.iOS?window.innerHeight:target.height();if(target[0]===window){position={top:!fixed||PLUGINS.iOS?(viewport||target).scrollTop():0,left:!fixed||PLUGINS.iOS?(viewport||target).scrollLeft():0}}}else{if(target.is("area")&&PLUGINS.imagemap){position=PLUGINS.imagemap(target,at)}else{if(target[0].namespaceURI==="http://www.w3.org/2000/svg"&&PLUGINS.svg){position=PLUGINS.svg(target,at)}else{targetWidth=target.outerWidth();targetHeight=target.outerHeight();position=PLUGINS.offset(target,posOptions.container,fixed)}}}}if(position.offset){targetWidth=position.width;targetHeight=position.height;position=position.offset}position.left+=at.x==="right"?targetWidth:at.x==="center"?targetWidth/2:0;position.top+=at.y==="bottom"?targetHeight:at.y==="center"?targetHeight/2:0}position.left+=adjust.x+(my.x==="right"?-elemWidth:my.x==="center"?-elemWidth/2:0);position.top+=adjust.y+(my.y==="bottom"?-elemHeight:my.y==="center"?-elemHeight/2:0);if(viewport.jquery&&target[0]!==window&&target[0]!==docBody&&readjust.vertical+readjust.horizontal!=="nonenone"){viewport={elem:viewport,height:viewport[(viewport[0]===window?"h":"outerH")+"eight"](),width:viewport[(viewport[0]===window?"w":"outerW")+"idth"](),scrollLeft:fixed?0:viewport.scrollLeft(),scrollTop:fixed?0:viewport.scrollTop(),offset:viewport.offset()||{left:0,top:0}};position.adjusted={left:readjust.horizontal!=="none"?readjust.left(position.left):0,top:readjust.vertical!=="none"?readjust.top(position.top):0}}else{position.adjusted={left:0,top:0}}tooltip.attr("class",function(i,val){return $.attr(this,"class").replace(/ui-tooltip-pos-\w+/i,"")}).addClass(uitooltip+"-pos-"+my.abbreviation());callback.originalEvent=$.extend({},event);tooltip.trigger(callback,[self,position,viewport.elem||viewport]);if(callback.isDefaultPrevented()){return self}delete position.adjusted;if(effect===FALSE||isNaN(position.left)||isNaN(position.top)||target==="mouse"||!$.isFunction(posOptions.effect)){tooltip.css(position)}else{if($.isFunction(posOptions.effect)){posOptions.effect.call(tooltip,self,$.extend({},position));tooltip.queue(function(next){$(this).css({opacity:"",height:""});if($.browser.msie){this.style.removeAttribute("filter")}next()})}}isPositioning=0;return self},redraw:function(){if(self.rendered<1||isDrawing){return self}var fluid=uitooltip+"-fluid",container=options.position.container,perc,width,max,min;isDrawing=1;if(options.style.width){tooltip.css("width",options.style.width)}else{tooltip.css("width","").addClass(fluid);width=tooltip.width()+($.browser.mozilla?1:0);max=tooltip.css("max-width")||"";min=tooltip.css("min-width")||"";perc=(max+min).indexOf("%")>-1?container.width()/100:0;max=((max.indexOf("%")>-1?perc:1)*parseInt(max,10))||width;min=((min.indexOf("%")>-1?perc:1)*parseInt(min,10))||0;width=max+min?Math.min(Math.max(width,min),max):width;tooltip.css("width",Math.round(width)).removeClass(fluid)}isDrawing=0;return self},disable:function(state){var c=disabled;if("boolean"!==typeof state){state=!(tooltip.hasClass(c)||cache.disabled)}if(self.rendered){tooltip.toggleClass(c,state);$.attr(tooltip[0],"aria-disabled",state)}else{cache.disabled=!!state}return self},enable:function(){return self.disable(FALSE)},destroy:function(){var t=target[0],title=$.attr(t,oldtitle);if(self.rendered){tooltip.remove();$.each(self.plugins,function(){if(this.destroy){this.destroy()}})}clearTimeout(self.timers.show);clearTimeout(self.timers.hide);unassignEvents();$.removeData(t,"qtip");if(title){$.attr(t,"title",title);target.removeAttr(oldtitle)}target.removeAttr("aria-describedby").unbind(".qtip");return target}})}function init(id,opts){var obj,posOptions,attr,config,elem=$(this),docBody=$(document.body),newTarget=this===document?docBody:elem,metadata=(elem.metadata)?elem.metadata(opts.metadata):NULL,metadata5=opts.metadata.type==="html5"&&metadata?metadata[opts.metadata.name]:NULL,html5=elem.data(opts.metadata.name||"qtipopts");try{html5=typeof html5==="string"?(new Function("return "+html5))():html5}catch(e){$.error("Unable to parse HTML5 attribute data: "+html5)}config=$.extend(TRUE,{},QTIP.defaults,opts,typeof html5==="object"?sanitizeOptions(html5):NULL,sanitizeOptions(metadata5||metadata));posOptions=config.position;config.id=id;if("boolean"===typeof config.content.text){attr=elem.attr(config.content.attr);if(config.content.attr!==FALSE&&attr){config.content.text=attr}else{return FALSE}}if(posOptions.container===FALSE){posOptions.container=docBody}if(posOptions.target===FALSE){posOptions.target=newTarget}if(config.show.target===FALSE){config.show.target=newTarget}if(config.show.solo===TRUE){config.show.solo=docBody}if(config.hide.target===FALSE){config.hide.target=newTarget}if(config.position.viewport===TRUE){config.position.viewport=posOptions.container}posOptions.at=new PLUGINS.Corner(posOptions.at);posOptions.my=new PLUGINS.Corner(posOptions.my);if($.data(this,"qtip")){if(config.overwrite){elem.qtip("destroy")}else{if(config.overwrite===FALSE){return FALSE}}}if($.attr(this,"title")){$.attr(this,oldtitle,$.attr(this,"title"));this.removeAttribute("title")}obj=new QTip(elem,config,id,!!attr);$.data(this,"qtip",obj);elem.bind("remove.qtip",function(){obj.destroy()});return obj}QTIP=$.fn.qtip=function(options,notation,newValue){var command=(""+options).toLowerCase(),returned=NULL,args=command==="disable"?[TRUE]:$.makeArray(arguments).slice(1),event=args[args.length-1],opts=this[0]?$.data(this[0],"qtip"):NULL;if((!arguments.length&&opts)||command==="api"){return opts}else{if("string"===typeof options){this.each(function(){var api=$.data(this,"qtip");if(!api){return TRUE}if(event&&event.timeStamp){api.cache.event=event}if((command==="option"||command==="options")&&notation){if($.isPlainObject(notation)||newValue!==undefined){api.set(notation,newValue)}else{returned=api.get(notation);return FALSE}}else{if(api[command]){api[command].apply(api[command],args)}}});return returned!==NULL?returned:this}else{if("object"===typeof options||!arguments.length){opts=sanitizeOptions($.extend(TRUE,{},options));return QTIP.bind.call(this,opts,event)}}}};QTIP.bind=function(opts,event){return this.each(function(i){var options,targets,events,id=(!opts.id||opts.id===FALSE||opts.id.length<1||$("#"+uitooltip+"-"+opts.id).length)?QTIP.nextid++:opts.id,namespace=".qtip-"+id+"-create",api=init.call(this,id,opts);if(api===FALSE){return TRUE}options=api.options;$.each(PLUGINS,function(){if(this.initialize==="initialize"){this(api)}});targets={show:options.show.target,hide:options.hide.target};events={show:$.trim(""+options.show.event).replace(/ /g,namespace+" ")+namespace,hide:$.trim(""+options.hide.event).replace(/ /g,namespace+" ")+namespace};if(/mouse(over|enter)/i.test(events.show)&&!/mouse(out|leave)/i.test(events.hide)){events.hide+=" mouseleave"+namespace}if(options.position.target==="mouse"){targets.show.bind("mousemove"+namespace,function(event){MOUSE={pageX:event.pageX,pageY:event.pageY,type:"mousemove"}})}function hoverIntent(event){function render(){api.render(typeof event==="object"||options.show.ready);targets.show.add(targets.hide).unbind(namespace)}if(api.cache.disabled){return FALSE}api.cache.event=$.extend({},event);if(options.show.delay>0){clearTimeout(api.timers.show);api.timers.show=setTimeout(render,options.show.delay);if(events.show!==events.hide){targets.hide.bind(events.hide,function(){clearTimeout(api.timers.show)})}}else{render()}}targets.show.bind(events.show,hoverIntent);if(options.show.ready||options.prerender){hoverIntent(event)}})};PLUGINS=QTIP.plugins={Corner:function(corner){corner=(""+corner).replace(/([A-Z])/," $1").replace(/middle/gi,"center").toLowerCase();this.x=(corner.match(/left|right/i)||corner.match(/center/)||["inherit"])[0].toLowerCase();this.y=(corner.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();this.precedance=(corner.charAt(0).search(/^(t|b)/)>-1)?"y":"x";this.string=function(){return this.precedance==="y"?this.y+this.x:this.x+this.y};this.abbreviation=function(){var x=this.x.substr(0,1),y=this.y.substr(0,1);return x===y?x:(x==="c"||(x!=="c"&&y!=="c"))?y+x:x+y}},offset:function(elem,container,fixed){var pos=elem.offset(),parent=container,deep=0,docBody=document.body,coffset;function scroll(e,i){pos.left+=i*e.scrollLeft();pos.top+=i*e.scrollTop()}if(parent){do{if(parent[0]===docBody){break}else{if(parent.css("position")!=="static"){coffset=parent.position();pos.left-=coffset.left+(parseInt(parent.css("borderLeftWidth"),10)||0);pos.top-=coffset.top+(parseInt(parent.css("borderTopWidth"),10)||0);deep++}}}while(parent=parent.offsetParent());if(container[0]!==docBody||deep>1){scroll(container,1)}if((PLUGINS.iOS<4.1&&PLUGINS.iOS>3.1)||(!PLUGINS.iOS&&fixed)){scroll($(window),-1)}}return pos},iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_","."))||FALSE,fn:{attr:function(attr,val){if(!this.length){return}var self=this[0],title="title",api=$.data(self,"qtip");if(attr===title){if(arguments.length<2){return $.attr(self,oldtitle)}else{if(typeof api==="object"){if(api&&api.rendered&&api.options.content.attr===title&&api.cache.attr){api.set("content.text",val)}$.fn["attr"+replaceSuffix].apply(this,arguments);$.attr(self,oldtitle,$.attr(self,title));return this.removeAttr(title)}}}},clone:function(keepData){var titles=$([]),title="title",elem;elem=$.fn["clone"+replaceSuffix].apply(this,arguments).filter("[oldtitle]").each(function(){$.attr(this,title,$.attr(this,oldtitle));this.removeAttribute(oldtitle)}).end();return elem},remove:$.ui?NULL:function(selector,keepData){$(this).each(function(){if(!keepData){if(!selector||$.filter(selector,[this]).length){$("*",this).add(this).each(function(){$(this).triggerHandler("remove")})}}})}}};$.each(PLUGINS.fn,function(name,func){if(!func){return TRUE}var old=$.fn[name+replaceSuffix]=$.fn[name];$.fn[name]=function(){return func.apply(this,arguments)||old.apply(this,arguments)}});QTIP.version="nightly";QTIP.nextid=0;QTIP.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");QTIP.zindex=15000;QTIP.defaults={prerender:FALSE,id:FALSE,overwrite:TRUE,content:{text:TRUE,attr:"title",title:{text:FALSE,button:FALSE}},position:{my:"top left",at:"bottom right",target:FALSE,container:FALSE,viewport:FALSE,adjust:{x:0,y:0,mouse:TRUE,resize:TRUE,method:"flip flip"},effect:function(api,pos,viewport){$(this).stop().animate(pos,200)}},show:{target:FALSE,event:"mouseenter",effect:TRUE,delay:90,solo:FALSE,ready:FALSE},hide:{target:FALSE,event:"mouseleave",effect:TRUE,delay:0,fixed:FALSE,inactive:FALSE,leave:"window",distance:FALSE},style:{classes:"",widget:FALSE,width:FALSE},events:{render:NULL,move:NULL,show:NULL,hide:NULL,toggle:NULL,focus:NULL,blur:NULL}};function BGIFrame(api){var self=this,elems=api.elements,tooltip=elems.tooltip,namespace=".bgiframe-"+api.id;$.extend(self,{init:function(){elems.bgiframe=$('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';"  style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>');elems.bgiframe.appendTo(tooltip);tooltip.bind("tooltipmove"+namespace,self.adjust)},adjust:function(){var dimensions=api.get("dimensions"),plugin=api.plugins.tip,tip=elems.tip,tipAdjust,offset;offset=parseInt(tooltip.css("border-left-width"),10)||0;offset={left:-offset,top:-offset};if(plugin&&tip){tipAdjust=(plugin.corner.precedance==="x")?["width","left"]:["height","top"];offset[tipAdjust[1]]-=tip[tipAdjust[0]]()}elems.bgiframe.css(offset).css(dimensions)},destroy:function(){elems.bgiframe.remove();tooltip.unbind(namespace)}});self.init()}PLUGINS.bgiframe=function(api){var browser=$.browser,self=api.plugins.bgiframe;if($("select, object").length<1||!(browser.msie&&browser.version.charAt(0)==="6")){return FALSE}return"object"===typeof self?self:(api.plugins.bgiframe=new BGIFrame(api))};PLUGINS.bgiframe.initialize="render"}(jQuery,window));

/* 
 * Colorbox
 */

(function($){var colorbox="colorbox",hover="hover",TRUE=true,FALSE=false,cboxPublic,isIE=!$.support.opacity,isIE6=isIE&&!window.XMLHttpRequest,cbox_click="click.colorbox",cbox_open="cbox_open",cbox_load="cbox_load",cbox_complete="cbox_complete",cbox_cleanup="cbox_cleanup",cbox_closed="cbox_closed",cbox_resize="resize.cbox_resize",$overlay,$cbox,$wrap,$content,$topBorder,$leftBorder,$rightBorder,$bottomBorder,$related,$window,$loaded,$loadingOverlay,$loadingGraphic,$title,$current,$slideshow,$next,$prev,$close,interfaceHeight,interfaceWidth,loadedHeight,loadedWidth,element,index,settings,open,active,callback,defaults={transition:"elastic",speed:350,width:FALSE,height:FALSE,innerWidth:FALSE,innerHeight:FALSE,initialWidth:"400",initialHeight:"400",maxWidth:FALSE,maxHeight:FALSE,scalePhotos:TRUE,scrolling:TRUE,inline:FALSE,html:FALSE,iframe:FALSE,photo:FALSE,href:FALSE,title:FALSE,rel:FALSE,opacity:0.9,preloading:TRUE,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:FALSE,overlayClose:TRUE,slideshow:FALSE,slideshowAuto:TRUE,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",preloadIMG:TRUE};function setSize(size,dimension){dimension=dimension==="x"?document.documentElement.clientWidth:document.documentElement.clientHeight;return(typeof size==="string")?Math.round((size.match(/%/)?(dimension/100)*parseInt(size,10):parseInt(size,10))):size}function isImage(url){return settings.photo||url.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function process(){for(var i in settings){if(typeof(settings[i])==="function"){settings[i]=settings[i].call(element)}}}cboxPublic=$.fn.colorbox=function(options,custom_callback){if(this.length){this.each(function(){var data=$(this).data(colorbox)?$.extend({},$(this).data(colorbox),options):$.extend({},defaults,options);$(this).data(colorbox,data).addClass("cboxelement")})}else{$(this).data(colorbox,$.extend({},defaults,options))}$(this).unbind(cbox_click).bind(cbox_click,function(e){element=this;settings=$(element).data(colorbox);process();callback=custom_callback||FALSE;var rel=settings.rel||element.rel;if(rel&&rel!=="nofollow"){$related=$(".cboxelement").filter(function(){var relRelated=$(this).data(colorbox).rel||this.rel;return(relRelated===rel)});index=$related.index(element);if(index<0){$related=$related.add(element);index=$related.length-1}}else{$related=$(element);index=0}if(!open){open=TRUE;active=TRUE;$().bind("keydown.cbox_close",function(e){if(e.keyCode===27){e.preventDefault();cboxPublic.close()}}).bind("keydown.cbox_arrows",function(e){if(e.keyCode===37){e.preventDefault();$prev.click()}else{if(e.keyCode===39){e.preventDefault();$next.click()}}});if(settings.overlayClose){$overlay.css({cursor:"pointer"}).one("click",cboxPublic.close)}element.blur();$.event.trigger(cbox_open);$close.html(settings.close);$overlay.css({opacity:settings.opacity}).show();settings.w=setSize(settings.initialWidth,"x");settings.h=setSize(settings.initialHeight,"y");cboxPublic.position(0);if(isIE6){$window.bind("resize.cboxie6 scroll.cboxie6",function(){$overlay.css({width:$window.width(),height:$window.height(),top:$window.scrollTop(),left:$window.scrollLeft()})}).trigger("scroll.cboxie6")}}cboxPublic.slideshow();cboxPublic.load();e.preventDefault()});if(options&&options.open){$(this).triggerHandler(cbox_click)}return this};cboxPublic.init=function(){function $div(id){return $('<div id="cbox'+id+'"/>')}$window=$(window);$cbox=$('<div id="colorbox"/>');$overlay=$div("Overlay").hide();$wrap=$div("Wrapper");$content=$div("Content").append($loaded=$div("LoadedContent").css({width:0,height:0}),$loadingOverlay=$div("LoadingOverlay"),$loadingGraphic=$div("LoadingGraphic"),$title=$div("Title"),$current=$div("Current"),$slideshow=$div("Slideshow"),$next=$div("Next"),$prev=$div("Previous"),$close=$div("Close"));$wrap.append($("<div/>").append($div("TopLeft"),$topBorder=$div("TopCenter"),$div("TopRight")),$("<div/>").append($leftBorder=$div("MiddleLeft"),$content,$rightBorder=$div("MiddleRight")),$("<div/>").append($div("BottomLeft"),$bottomBorder=$div("BottomCenter"),$div("BottomRight"))).children().children().css({"float":"left"});$("body").prepend($overlay,$cbox.append($wrap));if(isIE){$cbox.addClass("cboxIE");if(isIE6){$overlay.css("position","absolute")}}$content.children().addClass(hover).mouseover(function(){$(this).addClass(hover)}).mouseout(function(){$(this).removeClass(hover)}).hide();interfaceHeight=$topBorder.height()+$bottomBorder.height()+$content.outerHeight(TRUE)-$content.height();interfaceWidth=$leftBorder.width()+$rightBorder.width()+$content.outerWidth(TRUE)-$content.width();loadedHeight=$loaded.outerHeight(TRUE);loadedWidth=$loaded.outerWidth(TRUE);$cbox.css({"padding-bottom":interfaceHeight,"padding-right":interfaceWidth}).hide();$next.click(cboxPublic.next);$prev.click(cboxPublic.prev);$close.click(cboxPublic.close);$content.children().removeClass(hover)};cboxPublic.position=function(speed,loadedCallback){var animate_speed,winHeight=document.documentElement.clientHeight,posTop=Math.max(winHeight-settings.h-loadedHeight-interfaceHeight,0)/2+$window.scrollTop(),posLeft=Math.max(document.documentElement.clientWidth-settings.w-loadedWidth-interfaceWidth,0)/2+$window.scrollLeft();animate_speed=($cbox.width()===settings.w+loadedWidth&&$cbox.height()===settings.h+loadedHeight)?0:speed;$wrap[0].style.width=$wrap[0].style.height="9999px";function modalDimensions(that){$topBorder[0].style.width=$bottomBorder[0].style.width=$content[0].style.width=that.style.width;$loadingGraphic[0].style.height=$loadingOverlay[0].style.height=$content[0].style.height=$leftBorder[0].style.height=$rightBorder[0].style.height=that.style.height}$cbox.dequeue().animate({width:settings.w+loadedWidth,height:settings.h+loadedHeight,top:posTop,left:posLeft},{duration:animate_speed,complete:function(){modalDimensions(this);active=FALSE;$wrap[0].style.width=(settings.w+loadedWidth+interfaceWidth)+"px";$wrap[0].style.height=(settings.h+loadedHeight+interfaceHeight)+"px";if(loadedCallback){loadedCallback()}},step:function(){modalDimensions(this)}})};cboxPublic.resize=function(object){if(!open){return}var topMargin,prev,prevSrc,next,nextSrc,photo,timeout,speed=settings.transition==="none"?0:settings.speed;$window.unbind(cbox_resize);if(!object){timeout=setTimeout(function(){var $child=$loaded.wrapInner("<div style='overflow:auto'></div>").children();settings.h=$child.height();$loaded.css({height:settings.h});$child.replaceWith($child.children());cboxPublic.position(speed)},1);return}$loaded.remove();$loaded=$('<div id="cboxLoadedContent"/>').html(object);function getWidth(){settings.w=settings.w||$loaded.width();return settings.w}function getHeight(){settings.h=settings.h||$loaded.height();return settings.h}$loaded.hide().appendTo($overlay).css({width:getWidth(),overflow:settings.scrolling?"auto":"hidden"}).css({height:getHeight()}).prependTo($content);$("#cboxPhoto").css({cssFloat:"none"});if(isIE6){$("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(cbox_cleanup,function(){this.style.visibility="inherit"})}function setPosition(s){cboxPublic.position(s,function(){if(!open){return}if(isIE){if(photo){$loaded.fadeIn(100)}$cbox[0].style.removeAttribute("filter")}$content.children().show();if(settings.iframe){$loaded.append("<iframe id='cboxIframe'"+(settings.scrolling?" ":"scrolling='no'")+" name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+(settings.href||element.href)+"' />")}$loadingOverlay.hide();$loadingGraphic.hide();$slideshow.hide();if($related.length>1){$current.html(settings.current.replace(/\{current\}/,index+1).replace(/\{total\}/,$related.length));$next.html(settings.next);$prev.html(settings.previous);if(settings.slideshow){$slideshow.show()}}else{$current.hide();$next.hide();$prev.hide()}$title.html(settings.title||element.title);$.event.trigger(cbox_complete);if(callback){callback.call(element)}if(settings.transition==="fade"){$cbox.fadeTo(speed,1,function(){if(isIE){$cbox[0].style.removeAttribute("filter")}})}$window.bind(cbox_resize,function(){cboxPublic.position(0)})})}if((settings.transition==="fade"&&$cbox.fadeTo(speed,0,function(){setPosition(0)}))||setPosition(speed)){}if(settings.preloading&&$related.length>1){prev=index>0?$related[index-1]:$related[$related.length-1];next=index<$related.length-1?$related[index+1]:$related[0];nextSrc=$(next).data(colorbox).href||next.href;prevSrc=$(prev).data(colorbox).href||prev.href;if(isImage(nextSrc)){$("<img />").attr("src",nextSrc)}if(isImage(prevSrc)){$("<img />").attr("src",prevSrc)}}};cboxPublic.load=function(){var href,img,setResize,resize=cboxPublic.resize;active=TRUE;function preload(html){var $ajax=$(html),$imgs=$ajax.find("img"),x=$imgs.length;(function loadloop(){var img=new Image();x=x-1;if(x>=0&&settings.preloadIMG){img.onload=loadloop;img.src=$imgs[x].src}else{resize($ajax)}}())}element=$related[index];settings=$(element).data(colorbox);process();$.event.trigger(cbox_load);settings.h=settings.height?setSize(settings.height,"y")-loadedHeight-interfaceHeight:settings.innerHeight?setSize(settings.innerHeight,"y"):FALSE;settings.w=settings.width?setSize(settings.width,"x")-loadedWidth-interfaceWidth:settings.innerWidth?setSize(settings.innerWidth,"x"):FALSE;settings.mw=settings.w;settings.mh=settings.h;if(settings.maxWidth){settings.mw=setSize(settings.maxWidth,"x")-loadedWidth-interfaceWidth;settings.mw=settings.w&&settings.w<settings.mw?settings.w:settings.mw}if(settings.maxHeight){settings.mh=setSize(settings.maxHeight,"y")-loadedHeight-interfaceHeight;settings.mh=settings.h&&settings.h<settings.mh?settings.h:settings.mh}href=settings.href||element.href;$loadingOverlay.show();$loadingGraphic.show();$close.show();if(settings.inline){$('<div id="cboxInlineTemp" />').hide().insertBefore($(href)[0]).bind(cbox_load+" "+cbox_cleanup,function(){$(this).replaceWith($loaded.children())});resize($(href))}else{if(settings.iframe){resize(" ")}else{if(settings.html){preload(settings.html)}else{if(isImage(href)){img=new Image();img.onload=function(){var percent;img.onload=null;img.id="cboxPhoto";$(img).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(settings.scalePhotos){setResize=function(){img.height-=img.height*percent;img.width-=img.width*percent};if(settings.mw&&img.width>settings.mw){percent=(img.width-settings.mw)/img.width;setResize()}if(settings.mh&&img.height>settings.mh){percent=(img.height-settings.mh)/img.height;setResize()}}if(settings.h){img.style.marginTop=Math.max(settings.h-img.height,0)/2+"px"}resize(img);if($related.length>1){$(img).css({cursor:"pointer"}).click(cboxPublic.next)}if(isIE){img.style.msInterpolationMode="bicubic"}};img.src=href}else{$("<div />").load(href,function(data,textStatus){if(textStatus==="success"){preload(this)}else{resize($("<p>Request unsuccessful.</p>"))}})}}}}};cboxPublic.next=function(){if(!active){index=index<$related.length-1?index+1:0;cboxPublic.load()}};cboxPublic.prev=function(){if(!active){index=index>0?index-1:$related.length-1;cboxPublic.load()}};cboxPublic.slideshow=function(){var stop,timeOut,className="cboxSlideshow_";$slideshow.bind(cbox_closed,function(){$slideshow.unbind();clearTimeout(timeOut);$cbox.removeClass(className+"off "+className+"on")});function start(){$slideshow.text(settings.slideshowStop).bind(cbox_complete,function(){timeOut=setTimeout(cboxPublic.next,settings.slideshowSpeed)}).bind(cbox_load,function(){clearTimeout(timeOut)}).one("click",function(){stop();$(this).removeClass(hover)});$cbox.removeClass(className+"off").addClass(className+"on")}stop=function(){clearTimeout(timeOut);$slideshow.text(settings.slideshowStart).unbind(cbox_complete+" "+cbox_load).one("click",function(){start();timeOut=setTimeout(cboxPublic.next,settings.slideshowSpeed);$(this).removeClass(hover)});$cbox.removeClass(className+"on").addClass(className+"off")};if(settings.slideshow&&$related.length>1){if(settings.slideshowAuto){start()}else{stop()}}};cboxPublic.close=function(){$.event.trigger(cbox_cleanup);open=FALSE;$().unbind("keydown.cbox_close keydown.cbox_arrows");$window.unbind(cbox_resize+" resize.cboxie6 scroll.cboxie6");$overlay.css({cursor:"auto"}).fadeOut("fast");$cbox.stop(TRUE,FALSE).fadeOut("fast",function(){$loaded.remove();$cbox.css({opacity:1});$content.children().hide();$.event.trigger(cbox_closed)})};cboxPublic.element=function(){return element};cboxPublic.settings=defaults;$(cboxPublic.init)}(jQuery));

/*
 * hoverIntent
 */

(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

/*
 * jQuery Easing
 */

jQuery.easing={easein:function(x,t,b,c,d){return c*(t/=d)*t+b},easeinout:function(x,t,b,c,d){if(t<d/2)return 2*c*t*t/(d*d)+b;var a=t-d/2;return-2*c*a*a/(d*d)+2*c*a/d+c/2+b},easeout:function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b},expoin:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}return a*(Math.exp(Math.log(c)/d*t))+b},expoout:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}return a*(-Math.exp(-Math.log(c)/d*(t-d))+c+1)+b},expoinout:function(x,t,b,c,d){var a=1;if(c<0){a*=-1;c*=-1}if(t<d/2)return a*(Math.exp(Math.log(c/2)/(d/2)*t))+b;return a*(-Math.exp(-2*Math.log(c/2)/d*(t-d))+c+1)+b},bouncein:function(x,t,b,c,d){return c-jQuery.easing['bounceout'](x,d-t,0,c,d)+b},bounceout:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},bounceinout:function(x,t,b,c,d){if(t<d/2)return jQuery.easing['bouncein'](x,t*2,0,c,d)*.5+b;return jQuery.easing['bounceout'](x,t*2-d,0,c,d)*.5+c*.5+b},elasin:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},elasout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},elasinout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},backin:function(x,t,b,c,d){var s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},backout:function(x,t,b,c,d){var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},backinout:function(x,t,b,c,d){var s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},linear:function(x,t,b,c,d){return c*t/d+b}};

/*
 * jQuery Tab Plugin
 */

(function($){$.extend({tabs:{remoteCount:0}});$.fn.tabs=function(initial,settings){if(typeof initial=='object')settings=initial;settings=$.extend({initial:(initial&&typeof initial=='number'&&initial>0)?--initial:0,disabled:null,bookmarkable:$.ajaxHistory?true:false,remote:false,spinner:'Loading&#8230;',hashPrefix:'remote-tab-',fxFade:null,fxSlide:null,fxShow:null,fxHide:null,fxSpeed:'normal',fxShowSpeed:null,fxHideSpeed:null,fxAutoHeight:false,onClick:null,onHide:null,onShow:null,navClass:'tabs-nav',selectedClass:'tabs-selected',disabledClass:'tabs-disabled',containerClass:'tabs-container',hideClass:'tabs-hide',loadingClass:'tabs-loading',tabStruct:'div'},settings||{});$.browser.msie6=$.browser.msie6||$.browser.msie&&typeof XMLHttpRequest=='function';function unFocus(){scrollTo(0,0);}return this.each(function(){var container=this;var nav=$('ul.'+settings.navClass,container);nav=nav.size()&&nav||$('>ul:eq(0)',container);var tabs=$('a',nav);if(settings.remote){tabs.each(function(){var id=settings.hashPrefix+(++$.tabs.remoteCount),hash='#'+id,url=this.href;this.href=hash;$('<div id="'+id+'" class="'+settings.containerClass+'"></div>').appendTo(container);$(this).bind('loadRemoteTab',function(e,callback){var $$=$(this).addClass(settings.loadingClass),span=$('span',this)[0],tabTitle=span.innerHTML;if(settings.spinner){span.innerHTML='<em>'+settings.spinner+'</em>';}setTimeout(function(){$(hash).load(url,function(){if(settings.spinner){span.innerHTML=tabTitle;}$$.removeClass(settings.loadingClass);callback&&callback();});},0);});});}var containers=$('div.'+settings.containerClass,container);containers=containers.size()&&containers||$('>'+settings.tabStruct,container);nav.is('.'+settings.navClass)||nav.addClass(settings.navClass);containers.each(function(){var $$=$(this);$$.is('.'+settings.containerClass)||$$.addClass(settings.containerClass);});var hasSelectedClass=$('li',nav).index($('li.'+settings.selectedClass,nav)[0]);if(hasSelectedClass>=0){settings.initial=hasSelectedClass;}if(location.hash){tabs.each(function(i){if(this.hash==location.hash){settings.initial=i;if(($.browser.msie||$.browser.opera)&&!settings.remote){var toShow=$(location.hash);var toShowId=toShow.attr('id');toShow.attr('id','');setTimeout(function(){toShow.attr('id',toShowId);},500);}unFocus();return false;}});}if($.browser.msie){unFocus();}containers.filter(':eq('+settings.initial+')').show().end().not(':eq('+settings.initial+')').addClass(settings.hideClass);$('li',nav).removeClass(settings.selectedClass).eq(settings.initial).addClass(settings.selectedClass);tabs.eq(settings.initial).trigger('loadRemoteTab').end();if(settings.fxAutoHeight){var _setAutoHeight=function(reset){var heights=$.map(containers.get(),function(el){var h,jq=$(el);if(reset){if($.browser.msie6){el.style.removeExpression('behaviour');el.style.height='';el.minHeight=null;}h=jq.css({'min-height':''}).height();}else{h=jq.height();}return h;}).sort(function(a,b){return b-a;});if($.browser.msie6){containers.each(function(){this.minHeight=heights[0]+'px';this.style.setExpression('behaviour','this.style.height = this.minHeight ? this.minHeight : "1px"');});}else{containers.css({'min-height':heights[0]+'px'});}};_setAutoHeight();var cachedWidth=container.offsetWidth;var cachedHeight=container.offsetHeight;var watchFontSize=$('#tabs-watch-font-size').get(0)||$('<span id="tabs-watch-font-size">M</span>').css({display:'block',position:'absolute',visibility:'hidden'}).appendTo(document.body).get(0);var cachedFontSize=watchFontSize.offsetHeight;setInterval(function(){var currentWidth=container.offsetWidth;var currentHeight=container.offsetHeight;var currentFontSize=watchFontSize.offsetHeight;if(currentHeight>cachedHeight||currentWidth!=cachedWidth||currentFontSize!=cachedFontSize){_setAutoHeight((currentWidth>cachedWidth||currentFontSize<cachedFontSize));cachedWidth=currentWidth;cachedHeight=currentHeight;cachedFontSize=currentFontSize;}},50);}var showAnim={},hideAnim={},showSpeed=settings.fxShowSpeed||settings.fxSpeed,hideSpeed=settings.fxHideSpeed||settings.fxSpeed;if(settings.fxSlide||settings.fxFade){if(settings.fxSlide){showAnim['height']='show';hideAnim['height']='hide';}if(settings.fxFade){showAnim['opacity']='show';hideAnim['opacity']='hide';}}else{if(settings.fxShow){showAnim=settings.fxShow;}else{showAnim['min-width']=0;showSpeed=settings.bookmarkable?50:1;}if(settings.fxHide){hideAnim=settings.fxHide;}else{hideAnim['min-width']=0;hideSpeed=settings.bookmarkable?50:1;}}var onClick=settings.onClick,onHide=settings.onHide,onShow=settings.onShow;tabs.bind('triggerTab',function(){var li=$(this).parents('li:eq(0)');if(container.locked||li.is('.'+settings.selectedClass)||li.is('.'+settings.disabledClass)){return false;}var hash=this.hash;if($.browser.msie){$(this).trigger('click');if(settings.bookmarkable){$.ajaxHistory.update(hash);location.hash=hash.replace('#','');}}else if($.browser.safari){var tempForm=$('<form action="'+hash+'"><div><input type="submit" value="h" /></div></form>').get(0);tempForm.submit();$(this).trigger('click');if(settings.bookmarkable){$.ajaxHistory.update(hash);}}else{if(settings.bookmarkable){location.hash=hash.replace('#','');}else{$(this).trigger('click');}}});tabs.bind('disableTab',function(){var li=$(this).parents('li:eq(0)');if($.browser.safari){li.animate({opacity:0},1,function(){li.css({opacity:''});});}li.addClass(settings.disabledClass);});if(settings.disabled&&settings.disabled.length){for(var i=0,k=settings.disabled.length;i<k;i++){tabs.eq(--settings.disabled[i]).trigger('disableTab').end();}};tabs.bind('enableTab',function(){var li=$(this).parents('li:eq(0)');li.removeClass(settings.disabledClass);if($.browser.safari){li.animate({opacity:1},1,function(){li.css({opacity:''});});}});tabs.bind('click',function(e){var trueClick=e.clientX;var clicked=this,li=$(this).parents('li:eq(0)'),toShow=$(this.hash),toHide=containers.filter(':visible');if(container['locked']||li.is('.'+settings.selectedClass)||li.is('.'+settings.disabledClass)||typeof onClick=='function'&&onClick(this,toShow[0],toHide[0])===false){this.blur();return false;}container['locked']=true;if(toShow.size()){if($.browser.msie&&settings.bookmarkable){var toShowId=this.hash.replace('#','');toShow.attr('id','');setTimeout(function(){toShow.attr('id',toShowId);},0);}function switchTab(){if(settings.bookmarkable&&trueClick){$.ajaxHistory.update(clicked.hash);}toHide.animate(hideAnim,hideSpeed,function(){$(clicked).parents('li:eq(0)').addClass(settings.selectedClass).siblings().removeClass(settings.selectedClass);if(typeof onHide=='function'){onHide(clicked,toShow[0],toHide[0]);}var resetCSS={display:'',overflow:'',height:''};if(!$.browser.msie){resetCSS['opacity']='';}toHide.addClass(settings.hideClass).css(resetCSS);toShow.removeClass(settings.hideClass).animate(showAnim,showSpeed,function(){toShow.css(resetCSS);if($.browser.msie){toHide[0].style.filter='';toShow[0].style.filter='';}if(typeof onShow=='function'){onShow(clicked,toShow[0],toHide[0]);}container['locked']=null;});});}if(!settings.remote){switchTab();}else{$(clicked).trigger('loadRemoteTab',[switchTab]);}}else{alert('There is no such container.');}var scrollX=window.pageXOffset||document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft||0;var scrollY=window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop||0;setTimeout(function(){window.scrollTo(scrollX,scrollY);},0);this.blur();return settings.bookmarkable&&!!trueClick;});if(settings.bookmarkable){$.ajaxHistory.initialize(function(){tabs.eq(settings.initial).trigger('click').end();});}});};var tabEvents=['triggerTab','disableTab','enableTab'];for(var i=0;i<tabEvents.length;i++){$.fn[tabEvents[i]]=(function(tabEvent){return function(tab){return this.each(function(){var nav=$('ul.tabs-nav',this);nav=nav.size()&&nav||$('>ul:eq(0)',this);var a;if(!tab||typeof tab=='number'){a=$('li a',nav).eq((tab&&tab>0&&tab-1||0));}else if(typeof tab=='string'){a=$('li a[@href$="#'+tab+'"]',nav);}a.trigger(tabEvent);});};})(tabEvents[i]);}$.fn.activeTab=function(){var selectedTabs=[];this.each(function(){var nav=$('ul.tabs-nav',this);nav=nav.size()&&nav||$('>ul:eq(0)',this);var lis=$('li',nav);selectedTabs.push(lis.index(lis.filter('.tabs-selected')[0])+1);});return selectedTabs[0];};})(jQuery);

/*
 * DDAccordion
 */

var ddaccordion={contentclassname:{},expandone:function(headerclass,selected){this.toggleone(headerclass,selected,"expand")},collapseone:function(headerclass,selected){this.toggleone(headerclass,selected,"collapse")},expandall:function(headerclass){var $=jQuery;var $headers=$("."+headerclass);$("."+this.contentclassname[headerclass]+":hidden").each(function(){$headers.eq(parseInt($(this).attr("contentindex"))).trigger("evt_accordion")})},collapseall:function(headerclass){var $=jQuery;var $headers=$("."+headerclass);$("."+this.contentclassname[headerclass]+":visible").each(function(){$headers.eq(parseInt($(this).attr("contentindex"))).trigger("evt_accordion")})},toggleone:function(headerclass,selected,optstate){var $=jQuery;var $targetHeader=$("."+headerclass).eq(selected);var $subcontent=$("."+this.contentclassname[headerclass]).eq(selected);if(typeof optstate=="undefined"||optstate=="expand"&&$subcontent.is(":hidden")||optstate=="collapse"&&$subcontent.is(":visible")){$targetHeader.trigger("evt_accordion")}},expandit:function($targetHeader,$targetContent,config,useractivated,directclick){this.transformHeader($targetHeader,config,"expand");$targetContent.slideDown(config.animatespeed,function(){config.onopenclose($targetHeader.get(0),parseInt($targetHeader.attr("headerindex")),$targetContent.css("display"),useractivated);if(config.postreveal=="gotourl"&&directclick){var targetLink=($targetHeader.is("a"))?$targetHeader.get(0):$targetHeader.find("a:eq(0)").get(0);if(targetLink){setTimeout(function(){location=targetLink.href},200)}}})},collapseit:function($targetHeader,$targetContent,config,isuseractivated){this.transformHeader($targetHeader,config,"collapse");$targetContent.slideUp(config.animatespeed,function(){config.onopenclose($targetHeader.get(0),parseInt($targetHeader.attr("headerindex")),$targetContent.css("display"),isuseractivated)})},transformHeader:function($targetHeader,config,state){$targetHeader.addClass((state=="expand")?config.cssclass.expand:config.cssclass.collapse).removeClass((state=="expand")?config.cssclass.collapse:config.cssclass.expand);if(config.htmlsetting.location=="src"){$targetHeader=($targetHeader.is("img"))?$targetHeader:$targetHeader.find("img").eq(0);$targetHeader.attr("src",(state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)}else{if(config.htmlsetting.location=="prefix"){$targetHeader.find(".accordprefix").html((state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)}else{if(config.htmlsetting.location=="suffix"){$targetHeader.find(".accordsuffix").html((state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)}}}},urlparamselect:function(headerclass){var result=window.location.search.match(new RegExp(headerclass+"=((\\d+)(,(\\d+))*)","i"));if(result!=null){result=RegExp.$1.split(",")}return result},getCookie:function(Name){var re=new RegExp(Name+"=[^;]+","i");if(document.cookie.match(re)){return document.cookie.match(re)[0].split("=")[1]}return null},setCookie:function(name,value){document.cookie=name+"="+value+"; path=/"},init:function(config){document.write('<style type="text/css">\n');document.write("."+config.contentclass+"{display: none}\n");document.write("</style>");jQuery(document).ready(function($){ddaccordion.urlparamselect(config.headerclass);var persistedheaders=ddaccordion.getCookie(config.headerclass);ddaccordion.contentclassname[config.headerclass]=config.contentclass;config.cssclass={collapse:config.toggleclass[0],expand:config.toggleclass[1]};config.revealtype=config.revealtype||"click";config.revealtype=config.revealtype.replace(/mouseover/i,"mouseenter");if(config.revealtype=="clickgo"){config.postreveal="gotourl";config.revealtype="click"}if(typeof config.togglehtml=="undefined"){config.htmlsetting={location:"none"}}else{config.htmlsetting={location:config.togglehtml[0],collapse:config.togglehtml[1],expand:config.togglehtml[2]}}config.oninit=(typeof config.oninit=="undefined")?function(){}:config.oninit;config.onopenclose=(typeof config.onopenclose=="undefined")?function(){}:config.onopenclose;var lastexpanded={};var expandedindices=ddaccordion.urlparamselect(config.headerclass)||((config.persiststate&&persistedheaders!=null)?persistedheaders:config.defaultexpanded);if(typeof expandedindices=="string"){expandedindices=expandedindices.replace(/c/ig,"").split(",")}var $subcontents=$("."+config.contentclass);if(expandedindices.length==1&&expandedindices[0]=="-1"){expandedindices=[]}if(config.collapseprev&&expandedindices.length>1){expandedindices=[expandedindices.pop()]}if(config.onemustopen&&expandedindices.length==0){expandedindices=[0]}$("."+config.headerclass).each(function(index){if(/(prefix)|(suffix)/i.test(config.htmlsetting.location)&&$(this).html()!=""){$('<span class="accordprefix"></span>').prependTo(this);$('<span class="accordsuffix"></span>').appendTo(this)}$(this).attr("headerindex",index+"h");$subcontents.eq(index).attr("contentindex",index+"c");var $subcontent=$subcontents.eq(index);var needle=(typeof expandedindices[0]=="number")?index:index+"";if(jQuery.inArray(needle,expandedindices)!=-1){if(config.animatedefault==false){$subcontent.show()}ddaccordion.expandit($(this),$subcontent,config,false);lastexpanded={$header:$(this),$content:$subcontent}}else{$subcontent.hide();config.onopenclose($(this).get(0),parseInt($(this).attr("headerindex")),$subcontent.css("display"),false);ddaccordion.transformHeader($(this),config,"collapse")}});$("."+config.headerclass).bind("evt_accordion",function(e,isdirectclick){var $subcontent=$subcontents.eq(parseInt($(this).attr("headerindex")));if($subcontent.css("display")=="none"){ddaccordion.expandit($(this),$subcontent,config,true,isdirectclick);if(config.collapseprev&&lastexpanded.$header&&$(this).get(0)!=lastexpanded.$header.get(0)){ddaccordion.collapseit(lastexpanded.$header,lastexpanded.$content,config,true)}lastexpanded={$header:$(this),$content:$subcontent}}else{if(!config.onemustopen||config.onemustopen&&lastexpanded.$header&&$(this).get(0)!=lastexpanded.$header.get(0)){ddaccordion.collapseit($(this),$subcontent,config,true)}}});$("."+config.headerclass).bind(config.revealtype,function(){if(config.revealtype=="mouseenter"){clearTimeout(config.revealdelay);var headerindex=parseInt($(this).attr("headerindex"));config.revealdelay=setTimeout(function(){ddaccordion.expandone(config.headerclass,headerindex)},config.mouseoverdelay||0)}else{$(this).trigger("evt_accordion",[true]);return false}});$("."+config.headerclass).bind("mouseleave",function(){clearTimeout(config.revealdelay)});config.oninit($("."+config.headerclass).get(),expandedindices);$(window).bind("unload",function(){$("."+config.headerclass).unbind();var expandedindices=[];$("."+config.contentclass+":visible").each(function(index){expandedindices.push($(this).attr("contentindex"))});if(config.persiststate==true&&$("."+config.headerclass).length>0){expandedindices=(expandedindices.length==0)?"-1c":expandedindices;ddaccordion.setCookie(config.headerclass,expandedindices)}})})}};

/*
 * JCarouselite
 */

(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:800,easing:null,vertical:false,circular:true,visible:1 ,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var b=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$("ul",c),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$("li",ul),itemLength=f.size(),curr=o.start;c.css("visibility","visible");f.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});c.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;f.css({width:f.width(),height:f.height()});ul.css(sizeCss,h+"px").css(animCss,-(curr*g));c.css(sizeCss,j+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if(o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto)setInterval(function(){go(curr+o.scroll)},o.auto+o.speed);function vis(){return f.slice(curr).slice(0,v)};function go(a){if(!b){if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr=a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(curr*g)}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b))||0};function width(a){return a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')};function height(a){return a[0].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery);

/*
 * Selector Dropdown Script
 */

(function(jQuery){jQuery.fn.extend({dropDownPanels:function(options){var defaults={speed:250,resetTimer:1000};var opts=jQuery.extend(defaults,options);var jQuerythis=jQuery(this);var closetimer;function resetMenu(){jQuerythis.find(".hover").removeClass("hover");jQuerythis.find(".submenu:visible").slideUp(opts.speed)}function activateTimer(){closetimer=window.setTimeout(resetMenu,opts.resetTimer)}function cancelTimer(){if(closetimer){window.clearTimeout(closetimer);closetimer=null}}jQuerythis.find(">li").hoverIntent(function(){cancelTimer();if(!jQuery(this).find(".submenu").is(":visible")){jQuery(this).parent().find(".hover").removeClass("hover");jQuery(this).parent().find(".submenu:visible").hide();if(jQuery(this).has(".submenu")){jQuery(this).find(".submenu").slideDown(opts.speed);jQuery(this).find("a:first").addClass("hover")}}},function(){activateTimer()})}})})(jQuery);jQuery(function(jQuery){jQuery(document).ready(function(){if(jQuery.cookie("trxLang")==null){intlSetCookie("trxLang","US")}if(jQuery.cookie("trxShip")==null){intlSetCookie("trxShip","US")}if((jQuery.cookie("trxLang")!=null)&&(jQuery.cookie("trxShip")!=null)){intlSetImgLang(jQuery.cookie("trxLang"));intlSetImgShip(jQuery.cookie("trxShip"));if((jQuery.cookie("trxLang")=="GB")&&(jQuery.cookie("trxShip")=="GB")){jQuery(".selectors #lang-container").css("visibility","hidden");jQuery("#toggle-lang a.language").removeClass("language")}}function intlRedirect(intlRedir){document.location.href="http://"+intlRedir+".trxtraining.com"+thisServerRequestURI}jQuery(".shipcountry").click(function(e){e.preventDefault();intlSelShip(jQuery(this).attr("id"))});jQuery(".langcountry").click(function(e){e.preventDefault();intlSelLang(jQuery(this).attr("id"))});function intlSetCookie(intlCookieName,intlCookieVal){jQuery.cookie(intlCookieName,intlCookieVal,{path:"/",expires:365,domain:".trxtraining.com"})}function intlSelLang(langid){intlSetImgLang(langid);if(langid=="lang-uk"){intlSetCookie("trxLang","GB");intlRedirect("uk")}if(langid=="lang-us"){intlSetCookie("trxLang","US");if((jQuery.cookie("trxShip"))=="GB"){intlSetCookie("trxShip","US")}intlRedirect("www")}if(langid=="lang-zs"){intlSetCookie("trxLang","ZS");intlRedirect("zs")}if(langid=="lang-fr"){intlSetCookie("trxLang","FR");intlRedirect("fr")}if(langid=="lang-de"){intlSetCookie("trxLang","DE");intlRedirect("de")}if(langid=="lang-it"){intlSetCookie("trxLang","IT");intlRedirect("it")}if(langid=="lang-ja"){intlSetCookie("trxLang","JA");intlRedirect("ja")}if(langid=="lang-ko"){intlSetCookie("trxLang","KO");intlRedirect("ko")}if(langid=="lang-pt"){intlSetCookie("trxLang","PT");intlRedirect("pt")}if(langid=="lang-es"){intlSetCookie("trxLang","ES");intlRedirect("es")}}function intlSelShip(shipid){if(shipid=="ship-usa"){intlSetImgShip("US");intlSetCookie("trxShip","US");intlSetCookie("trxLang","US");intlRedirect("www")}if(shipid=="ship-can"){intlSetImgShip("CA");intlSetCookie("trxShip","CA");intlSetCookie("trxLang","US");intlRedirect("www")}if(shipid=="ship-gb"){intlSetImgShip("GB");intlSetCookie("trxShip","GB");intlSetCookie("trxLang","GB");intlRedirect("uk")}if(shipid=="ship-aus"){intlSetImgShip("AT");intlSetCookie("trxShip","AT");intlSetCookie("trxLang","AT");intlRedirect("www")}if(shipid=="ship-fra"){intlSetImgShip("FR");intlSetCookie("trxShip","FR");intlSetCookie("trxLang","FR");intlRedirect("www")}if(shipid=="ship-ger"){intlSetImgShip("DE");intlSetCookie("trxShip","DE");intlSetCookie("trxLang","DE");intlRedirect("www")}if(shipid=="ship-nor"){intlSetImgShip("NO");intlSetCookie("trxShip","NO");intlSetCookie("trxLang","NO");intlRedirect("www")}if(shipid=="ship-swe"){intlSetImgShip("SE");intlSetCookie("trxShip","SE");intlSetCookie("trxLang","SE");intlRedirect("www")}if(shipid=="ship-br"){intlSetImgShip("BR");document.location.href="http://www.trxtraining.com.br"}}function intlSetImgLang(lang){if(lang=="GB"||lang=="lang-uk"){jQuery("#toggle-lang a.language").css("cursor","default");jQuery("#toggle-lang").children("#selected").css("background-position","-230px -1px");jQuery("#lang-uk").css("background-position","-255px -45px");jQuery("#lang-us").css("background-position","0 0");jQuery("#lang-zs").css("background-position","0 -315px");jQuery("#lang-fr").css("background-position","0 -360px");jQuery("#lang-de").css("background-position","0 -405px");jQuery("#lang-it").css("background-position","0 -450px");jQuery("#lang-ja").css("background-position","0 -495px");jQuery("#lang-ko").css("background-position","0 -540px");jQuery("#lang-pt").css("background-position","0 -585px");jQuery("#lang-es").css("background-position","0 -630px")}if(lang=="US"||lang=="lang-us"){jQuery("#toggle-lang").children("#selected").css("background-position","-230px -14px");jQuery("#lang-uk").css("background-position","0 -45px");jQuery("#lang-us").css("background-position","-255px 0");jQuery("#lang-zs").css("background-position","0 -315px");jQuery("#lang-fr").css("background-position","0 -360px");jQuery("#lang-de").css("background-position","0 -405px");jQuery("#lang-it").css("background-position","0 -450px");jQuery("#lang-ja").css("background-position","0 -495px");jQuery("#lang-ko").css("background-position","0 -540px");jQuery("#lang-pt").css("background-position","0 -585px");jQuery("#lang-es").css("background-position","0 -630px")}if(lang=="ZS"||lang=="lang-zs"){jQuery("#toggle-lang").children("#selected").css("background-position","-230px -27px");jQuery("#lang-uk").css("background-position","0 -45px");jQuery("#lang-us").css("background-position","0 0");jQuery("#lang-zs").css("background-position","-255px -315px");jQuery("#lang-fr").css("background-position","0 -360px");jQuery("#lang-de").css("background-position","0 -405px");jQuery("#lang-it").css("background-position","0 -450px");jQuery("#lang-ja").css("background-position","0 -495px");jQuery("#lang-ko").css("background-position","0 -540px");jQuery("#lang-pt").css("background-position","0 -585px");jQuery("#lang-es").css("background-position","0 -630px")}if(lang=="FR"||lang=="lang-fr"){jQuery("#toggle-lang").children("#selected").css("background-position","-230px -40px");jQuery("#lang-uk").css("background-position","0 -45px");jQuery("#lang-us").css("background-position","0 0");jQuery("#lang-zs").css("background-position","0 -315px");jQuery("#lang-fr").css("background-position","-255px -360px");jQuery("#lang-de").css("background-position","0 -405px");jQuery("#lang-it").css("background-position","0 -450px");jQuery("#lang-ja").css("background-position","0 -495px");jQuery("#lang-ko").css("background-position","0 -540px");jQuery("#lang-pt").css("background-position","0 -585px");jQuery("#lang-es").css("background-position","0 -630px")}if(lang=="DE"||lang=="lang-de"){jQuery("#toggle-lang").children("#selected").css("background-position","-230px -53px");jQuery("#lang-uk").css("background-position","0 -45px");jQuery("#lang-us").css("background-position","0 0");jQuery("#lang-zs").css("background-position","0 -315px");jQuery("#lang-fr").css("background-position","0 -360px");jQuery("#lang-de").css("background-position","-255px -405px");jQuery("#lang-it").css("background-position","0 -450px");jQuery("#lang-ja").css("background-position","0 -495px");jQuery("#lang-ko").css("background-position","0 -540px");jQuery("#lang-pt").css("background-position","0 -585px");jQuery("#lang-es").css("background-position","0 -630px")}if(lang=="IT"||lang=="lang-it"){jQuery("#toggle-lang").children("#selected").css("background-position","-230px -66px");jQuery("#lang-uk").css("background-position","0 -45px");jQuery("#lang-us").css("background-position","0 0");jQuery("#lang-zs").css("background-position","0 -315px");jQuery("#lang-fr").css("background-position","0 -360px");jQuery("#lang-de").css("background-position","0 -405px");jQuery("#lang-it").css("background-position","-255px -450px");jQuery("#lang-ja").css("background-position","0 -495px");jQuery("#lang-ko").css("background-position","0 -540px");jQuery("#lang-pt").css("background-position","0 -585px");jQuery("#lang-es").css("background-position","0 -630px")}if(lang=="JA"||lang=="lang-ja"){jQuery("#toggle-lang").children("#selected").css("background-position","-230px -79px");jQuery("#lang-uk").css("background-position","0 -45px");jQuery("#lang-us").css("background-position","0 0");jQuery("#lang-zs").css("background-position","0 -315px");jQuery("#lang-fr").css("background-position","0 -360px");jQuery("#lang-de").css("background-position","0 -405px");jQuery("#lang-it").css("background-position","0 -450px");jQuery("#lang-ja").css("background-position","-255px -495px");jQuery("#lang-ko").css("background-position","0 -540px");jQuery("#lang-pt").css("background-position","0 -585px");jQuery("#lang-es").css("background-position","0 -630px")}if(lang=="KO"||lang=="lang-ko"){jQuery("#toggle-lang").children("#selected").css("background-position","-230px -92px");jQuery("#lang-uk").css("background-position","0 -45px");jQuery("#lang-us").css("background-position","0 0");jQuery("#lang-zs").css("background-position","0 -315px");jQuery("#lang-fr").css("background-position","0 -360px");jQuery("#lang-de").css("background-position","0 -405px");jQuery("#lang-it").css("background-position","0 -450px");jQuery("#lang-ja").css("background-position","0 -495px");jQuery("#lang-ko").css("background-position","-255px -540px");jQuery("#lang-pt").css("background-position","0 -585px");jQuery("#lang-es").css("background-position","0 -630px")}if(lang=="PT"||lang=="lang-pt"){jQuery("#toggle-lang").children("#selected").css("background-position","-230px -105px");jQuery("#lang-uk").css("background-position","0 -45px");jQuery("#lang-us").css("background-position","0 0");jQuery("#lang-zs").css("background-position","0 -315px");jQuery("#lang-fr").css("background-position","0 -360px");jQuery("#lang-de").css("background-position","0 -405px");jQuery("#lang-it").css("background-position","0 -450px");jQuery("#lang-ja").css("background-position","0 -495px");jQuery("#lang-ko").css("background-position","0 -540px");jQuery("#lang-pt").css("background-position","-255px -585px");jQuery("#lang-es").css("background-position","0 -630px")}if(lang=="ES"||lang=="lang-es"){jQuery("#toggle-lang").children("#selected").css("background-position","-230px -118px");jQuery("#lang-uk").css("background-position","0 -45px");jQuery("#lang-us").css("background-position","0 0");jQuery("#lang-zs").css("background-position","0 -315px");jQuery("#lang-fr").css("background-position","0 -360px");jQuery("#lang-de").css("background-position","0 -405px");jQuery("#lang-it").css("background-position","0 -450px");jQuery("#lang-ja").css("background-position","0 -495px");jQuery("#lang-ko").css("background-position","0 -540px");jQuery("#lang-pt").css("background-position","0 -585px");jQuery("#lang-es").css("background-position","-255px -630px")}}function intlSetImgShip(ship){if(ship=="US"){jQuery("#toggle-ship").children("#selected").css("background-position","-171px -19px");jQuery("#ship-gb").css("background-position","0 -225px");jQuery("#ship-usa").css("background-position","-255px -90px");jQuery("#ship-can").css("background-position","0 -135px");jQuery("#ship-aus").css("background-position","0 -675px");jQuery("#ship-fra").css("background-position","0 -720px");jQuery("#ship-ger").css("background-position","0 -765px");jQuery("#ship-nor").css("background-position","0 -810px");jQuery("#ship-swe").css("background-position","0 -855px");jQuery("#ship-br").css("background-position","0 -900px")}if(ship=="CA"){jQuery("#toggle-ship").children("#selected").css("background-position","-171px -37px");jQuery("#ship-gb").css("background-position","0 -225px");jQuery("#ship-usa").css("background-position","0 -90px");jQuery("#ship-can").css("background-position","-255px -135px");jQuery("#ship-aus").css("background-position","0 -675px");jQuery("#ship-fra").css("background-position","0 -720px");jQuery("#ship-ger").css("background-position","0 -765px");jQuery("#ship-nor").css("background-position","0 -810px");jQuery("#ship-swe").css("background-position","0 -855px");jQuery("#ship-br").css("background-position","0 -900px")}if(ship=="GB"){jQuery("#toggle-ship").children("#selected").css("background-position","-171px -1px");jQuery("#ship-gb").css("background-position","-255px -225px");jQuery("#ship-usa").css("background-position","0 -90px");jQuery("#ship-can").css("background-position","0 -135px");jQuery("#ship-aus").css("background-position","0 -675px");jQuery("#ship-fra").css("background-position","0 -720px");jQuery("#ship-ger").css("background-position","0 -765px");jQuery("#ship-nor").css("background-position","0 -810px");jQuery("#ship-swe").css("background-position","0 -855px");jQuery("#ship-br").css("background-position","0 -900px")}if(ship=="AT"){jQuery("#toggle-ship").children("#selected").css("background-position","-171px -91px");jQuery("#ship-gb").css("background-position","0 -225px");jQuery("#ship-usa").css("background-position","0 -90px");jQuery("#ship-can").css("background-position","0 -135px");jQuery("#ship-aus").css("background-position","-255px -675px");jQuery("#ship-fra").css("background-position","0 -720px");jQuery("#ship-ger").css("background-position","0 -765px");jQuery("#ship-nor").css("background-position","0 -810px");jQuery("#ship-swe").css("background-position","0 -855px");jQuery("#ship-br").css("background-position","0 -900px")}if(ship=="FR"){jQuery("#toggle-ship").children("#selected").css("background-position","-171px -109px");jQuery("#ship-gb").css("background-position","0 -225px");jQuery("#ship-usa").css("background-position","0 -90px");jQuery("#ship-can").css("background-position","0 -135px");jQuery("#ship-aus").css("background-position","0 -675px");jQuery("#ship-fra").css("background-position","-255px -720px");jQuery("#ship-ger").css("background-position","0 -765px");jQuery("#ship-nor").css("background-position","0 -810px");jQuery("#ship-swe").css("background-position","0 -855px");jQuery("#ship-br").css("background-position","0 -900px")}if(ship=="DE"){jQuery("#toggle-ship").children("#selected").css("background-position","-171px -127px");jQuery("#ship-gb").css("background-position","0 -225px");jQuery("#ship-usa").css("background-position","0 -90px");jQuery("#ship-can").css("background-position","0 -135px");jQuery("#ship-aus").css("background-position","0 -675px");jQuery("#ship-fra").css("background-position","0 -720px");jQuery("#ship-ger").css("background-position","-255px -765px");jQuery("#ship-nor").css("background-position","0 -810px");jQuery("#ship-swe").css("background-position","0 -855px");jQuery("#ship-br").css("background-position","0 -900px")}if(ship=="NO"){jQuery("#toggle-ship").children("#selected").css("background-position","-171px -145px");jQuery("#ship-gb").css("background-position","0 -225px");jQuery("#ship-usa").css("background-position","0 -90px");jQuery("#ship-can").css("background-position","0 -135px");jQuery("#ship-aus").css("background-position","0 -675px");jQuery("#ship-fra").css("background-position","0 -720px");jQuery("#ship-ger").css("background-position","0 -765px");jQuery("#ship-nor").css("background-position","-255px -810px");jQuery("#ship-swe").css("background-position","0 -855px");jQuery("#ship-br").css("background-position","0 -900px")}if(ship=="SE"){jQuery("#toggle-ship").children("#selected").css("background-position","-171px -163px");jQuery("#ship-gb").css("background-position","0 -225px");jQuery("#ship-usa").css("background-position","0 -90px");jQuery("#ship-can").css("background-position","0 -135px");jQuery("#ship-aus").css("background-position","0 -675px");jQuery("#ship-fra").css("background-position","0 -720px");jQuery("#ship-ger").css("background-position","0 -765px");jQuery("#ship-nor").css("background-position","0 -810px");jQuery("#ship-swe").css("background-position","-255px -855px");jQuery("#ship-br").css("background-position","0 -900px")}if(ship=="BR"){jQuery("#toggle-ship").children("#selected").css("background-position","-171px -181px");jQuery("#ship-gb").css("background-position","0 -225px");jQuery("#ship-usa").css("background-position","0 -90px");jQuery("#ship-can").css("background-position","0 -135px");jQuery("#ship-aus").css("background-position","0 -675px");jQuery("#ship-fra").css("background-position","0 -720px");jQuery("#ship-ger").css("background-position","0 -765px");jQuery("#ship-nor").css("background-position","0 -810px");jQuery("#ship-swe").css("background-position","0 -855px");jQuery("#ship-br").css("background-position","-255px -900px")}}if(jQuery.cookie("trxShip")!=null){if((jQuery.cookie("trxShip")=="GB")){jQuery("#shopping-cart").attr("href",function(){return"http://uk.shop.trxtraining.com/content/shopping/7726.0.4.3"})}}})});

/*
 * jQuery validation plug-in 1.5.5
 */

(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var validator=$.data(this[0],"validator");if(validator){return validator}validator=new $.validator(options,this[0]);$.data(this[0],"validator",validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this})}this.submit(function(event){if(validator.settings.debug){event.preventDefault()}function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm)}validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove()}return false}return true}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle()}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false}return handle()}else{validator.focusInvalid();return false}})}return validator},valid:function(){if($(this[0]).is("form")){return this.validate().form()}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this)});return valid}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value)});return result},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,"validator").settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages){settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages)}break;case"remove":if(!argument){delete staticRules[element.name];return existingRules}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method]});return filtered}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data)}return data}});$.extend($.expr[":"],{blank:function(a){return !$.trim(a.value)},filled:function(a){return !!$.trim(a.value)},unchecked:function(a){return !a.checked}});$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init()};$.validator.format=function(source,params){if(arguments.length==1){return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args)}}if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1)}if(params.constructor!=Array){params=[params]}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n)});return source};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide()}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element)}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element)}},onclick:function(element){if(element.name in this.submitted){this.element(element)}},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass)},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass)}},setDefaults:function(settings){$.extend($.validator.defaults,settings)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key})});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value)});function delegate(event){var validator=$.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0])}$(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox",delegate);if(this.settings.invalidHandler){$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid()){$(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i])}return this.valid()},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name]}else{this.invalid[element.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return result},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]})}this.successList=$.grep(this.successList,function(element){return !(element.name in errors)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if($.fn.resetForm){$(this.currentForm).resetForm()}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(obj){var count=0;for(var i in obj){count++}return count},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus()}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name}).length==1&&lastActive},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules())){return false}rulesCache[this.name]=true;return true})},clean:function(selector){return $(selector)[0]},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.formSubmitted=false;this.currentElements=$([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element)},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0]}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return}if(!result){this.formatAndAdd(element,rule);return false}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id+", check the '"+rule.method+"' method");throw e}}if(dependencyMismatch){return}if(this.objectLength(rules)){this.successList.push(element)}return true},customMetaMessage:function(element,method){if(!$.metadata){return}var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method]},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method])},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined){return arguments[i]}}return undefined},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>")},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method);if(typeof message=="function"){message=message.call(this,rule.parameters,element)}this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message},addWrapper:function(toToggle){if(this.settings.wrapper){toToggle=toToggle.add(toToggle.parent(this.settings.wrapper))}return toToggle},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i])}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return $(this.errorList).map(function(){return this.element})},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message)}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(label).length){this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element)}}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label)}this.toShow=this.toShow.add(label)},errorsFor:function(element){return this.errors().filter("[for='"+this.idOrName(element)+"']")},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name)},checkable:function(element){return/radio|checkbox/i.test(element.type)},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null})},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case"select":return $("option:selected",element).length;case"input":if(this.checkable(element)){return this.findByName(element.name).filter(":checked").length}}return value.length},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true},dependTypes:{"boolean":function(param,element){return param},string:function(param,element){return !!$(param,element.form).length},"function":function(param,element){return param(element)}},optional:function(element){return !$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch"},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit()}else{if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this])}}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(element,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className)},classRules:function(element){var rules={};var classes=$(element).attr("class");classes&&$.each(classes.split(" "),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this])}});return rules},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength}return rules},metadataRules:function(element){if(!$.metadata){return{}}var meta=$.data(element.form,"validator").settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata()},staticRules:function(element){var rules={};var validator=$.data(element.form,"validator");if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{}}return rules},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break}if(keepRule){rules[prop]=val.param!==undefined?val.param:true}else{delete rules[prop]}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter});$.each(["minlength","maxlength","min","max"],function(){if(rules[this]){rules[this]=Number(rules[this])}});$.each(["rangelength","range"],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])]}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength}}if(rules.messages){delete rules.messages}return rules},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true});data=transformed}return data},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message||$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name))}},methods:{required:function(value,element,param){if(!this.depend(param,element)){return"dependency-mismatch"}switch(element.nodeName.toLowerCase()){case"select":var options=$("option:selected",element);return options.length>0&&(element.type=="select-multiple"||($.browser.msie&&!(options[0].attributes.value.specified)?options[0].text:options[0].value).length>0);case"input":if(this.checkable(element)){return this.getLength(value,element)>0}default:return $.trim(value).length>0}},remote:function(value,element,param){if(this.optional(element)){return"dependency-mismatch"}var previous=this.previousValue(element);if(!this.settings.messages[element.name]){this.settings.messages[element.name]={}}this.settings.messages[element.name].remote=typeof previous.message=="function"?previous.message(value):previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors()}else{var errors={};errors[element.name]=previous.message=response||validator.defaultMessage(element,"remote");validator.showErrors(errors)}previous.valid=valid;validator.stopRequest(element,valid)}},param));return"pending"}else{if(this.pending[element.name]){return"pending"}}return previous.valid},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1])},min:function(value,element,param){return this.optional(element)||value>=param},max:function(value,element,param){return this.optional(element)||value<=param},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1])},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value)},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value)},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value))},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value)},dateDE:function(value,element){return this.optional(element)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value)},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value)},numberDE:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value)},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value)},creditcard:function(value,element){if(this.optional(element)){return"dependency-mismatch"}if(/[^0-9-]+/.test(value)){return false}var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9){nDigit-=9}}nCheck+=nDigit;bEven=!bEven}return(nCheck%10)==0},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"))},equalTo:function(value,element,param){return value==$(param).val()}}});$.format=$.validator.format})(jQuery);(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort()}return(pendingRequests[port]=ajax.apply(this,arguments))}return ajax.apply(this,arguments)}})(jQuery);(function($){$.each({focus:"focusin",blur:"focusout"},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie){return false}this.addEventListener(original,$.event.special[fix].handler,true)},teardown:function(){if($.browser.msie){return false}this.removeEventListener(original,$.event.special[fix].handler,true)},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments)}}});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments)}})},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})])}})})(jQuery);

/*
 * In-Field Label jQuery Plugin
 */

(function($){$.InFieldLabels=function(b,c,d){var f=this;f.$label=$(b);f.label=b;f.$field=$(c);f.field=c;f.$label.data("InFieldLabels",f);f.showing=true;f.init=function(){f.options=$.extend({},$.InFieldLabels.defaultOptions,d);if(f.$field.val()!=""){f.$label.hide();f.showing=false};f.$field.focus(function(){f.fadeOnFocus()}).blur(function(){f.checkForEmpty(true)}).bind('keydown.infieldlabel',function(e){f.hideOnChange(e)}).change(function(e){f.checkForEmpty()}).bind('onPropertyChange',function(){f.checkForEmpty()})};f.fadeOnFocus=function(){if(f.showing){f.setOpacity(f.options.fadeOpacity)}};f.setOpacity=function(a){f.$label.stop().animate({opacity:a},f.options.fadeDuration);f.showing=(a>0.0)};f.checkForEmpty=function(a){if(f.$field.val()==""){f.prepForShow();f.setOpacity(a?1.0:f.options.fadeOpacity)}else{f.setOpacity(0.0)}};f.prepForShow=function(e){if(!f.showing){f.$label.css({opacity:0.0}).show();f.$field.bind('keydown.infieldlabel',function(e){f.hideOnChange(e)})}};f.hideOnChange=function(e){if((e.keyCode==16)||(e.keyCode==9))return;if(f.showing){f.$label.hide();f.showing=false};f.$field.unbind('keydown.infieldlabel')};f.init()};$.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};$.fn.inFieldLabels=function(c){return this.each(function(){var a=$(this).attr('for');if(!a)return;var b=$("input#"+a+"[type='text'],"+"input#"+a+"[type='password'],"+"textarea#"+a);if(b.length==0)return;(new $.InFieldLabels(this,b[0],c))})}})(jQuery);

/*
 * Yetii - Tab Stuff, might be able to delete it
 */

function Yetii(){this.defaults={id:null,active:1,interval:null,wait:null,persist:null,tabclass:"tab",activeclass:"active",callback:null};for(var n in arguments[0]){this.defaults[n]=arguments[0][n]}this.getTabs=function(){var retnode=[];var elem=document.getElementById(this.defaults.id).getElementsByTagName("*");var regexp=new RegExp("(^|\\s)"+this.defaults.tabclass.replace(/\-/g,"\\-")+"(\\s|$)");for(var i=0;i<elem.length;i++){if(regexp.test(elem[i].className)){retnode.push(elem[i])}}return retnode};this.links=document.getElementById(this.defaults.id+"-nav").getElementsByTagName("a");this.show=function(number){for(var i=0;i<this.tabs.length;i++){this.tabs[i].style.display=((i+1)==number)?"block":"none";this.links[i].className=((i+1)==number)?this.defaults.activeclass:""}this.defaults.active=number;if(this.defaults.callback){this.defaults.callback(number)}};this.rotate=function(interval){this.show(this.defaults.active);this.defaults.active++;if(this.defaults.active>this.tabs.length){this.defaults.active=1}var self=this;if(this.defaults.wait){clearTimeout(this.timer2)}this.timer1=setTimeout(function(){self.rotate(interval)},interval*1000)};this.next=function(){this.defaults.active++;if(this.defaults.active>this.tabs.length){this.defaults.active=1}this.show(this.defaults.active)};this.previous=function(){this.defaults.active--;if(!this.defaults.active){this.defaults.active=this.tabs.length}this.show(this.defaults.active)};this.parseurl=function(tabinterfaceid){var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)","i"));return(result==null)?null:parseInt(RegExp.$1)};this.createCookie=function(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString()}else{var expires=""}document.cookie=name+"="+value+expires+"; path=/"};this.readCookie=function(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length)}if(c.indexOf(nameEQ)==0){return c.substring(nameEQ.length,c.length)}}return null};this.tabs=this.getTabs();this.defaults.active=(this.parseurl(this.defaults.id))?this.parseurl(this.defaults.id):this.defaults.active;if(this.defaults.persist&&this.readCookie(this.defaults.id)){this.defaults.active=this.readCookie(this.defaults.id)}this.show(this.defaults.active);var self=this;for(var i=0;i<this.links.length;i++){this.links[i].customindex=i+1;this.links[i].onclick=function(){if(self.timer1){clearTimeout(self.timer1)}if(self.timer2){clearTimeout(self.timer2)}self.show(this.customindex);if(self.defaults.persist){self.createCookie(self.defaults.id,this.customindex,0)}if(self.defaults.wait){self.timer2=setTimeout(function(){self.rotate(self.defaults.interval)},self.defaults.wait*1000)}return false}}if(this.defaults.interval){this.rotate(this.defaults.interval)}};

/*
 * VJustify
 */

jQuery.fn.vjustify=function(){var maxHeight=0;this.each(function(){if(this.offsetHeight>maxHeight){maxHeight=this.offsetHeight;}});this.each(function(){$(this).height(maxHeight+"px");if(this.offsetHeight>maxHeight){$(this).height((maxHeight-(this.offsetHeight-maxHeight))+"px");}});};

/*
 * runOnLoad
 */

function runOnLoad(f){if(runOnLoad.loaded){f();}else{runOnLoad.funcs.push(f);}}runOnLoad.funcs=[];runOnLoad.loaded=false;runOnLoad.run=function(){if(runOnLoad.loaded){return;}for(var i=0;i<runOnLoad.funcs.length;i++){try{runOnLoad.funcs[i]();}catch(e){}}runOnLoad.loaded=true;delete runOnLoad.funcs;delete runOnLoad.run;};if(window.addEventListener){window.addEventListener("load",runOnLoad.run,false);}else{if(window.attachEvent){window.attachEvent("onload",runOnLoad.run);}else{window.onload=runOnLoad.run;}}

/*
 * Cattree
 */

function BarMenu(id){this.catHover=true;this.box2Hover=true;this.highlightActive=false;this.init=function(){if(!document.getElementById(this.id)){alert("Element '"+this.id+"' does not exist in this document. BarMenu cannot be initialized");return;}this.parse(document.getElementById(this.id).childNodes,this.tree,this.id);this.load();if(window.attachEvent){window.attachEvent("onunload",function(e){self.save();});}else{if(window.addEventListener){window.addEventListener("unload",function(e){self.save();},false);}}};this.parse=function(nodes,tree,id){for(var i=0;i<nodes.length;i++){if(nodes[i].nodeType!=1){continue;}if(nodes[i].className){if("cat"==nodes[i].className.substr(0,4)){nodes[i].id=id+"-"+tree.length;tree[tree.length]=new Array();eval('nodes[i].onmouseover = function() { self.catover("'+nodes[i].id+'"); }');eval('nodes[i].onmouseout = function() { self.catout("'+nodes[i].id+'"); }');eval('nodes[i].onclick = function() { self.catclick("'+nodes[i].id+'"); }');}if("section"==nodes[i].className){id=id+"-"+(tree.length-1);nodes[i].id=id+"-section";tree=tree[tree.length-1];}if("box2"==nodes[i].className.substr(0,4)){nodes[i].id=id+"-"+tree.length;tree[tree.length]=new Array();eval('nodes[i].onmouseover = function() { self.box2over("'+nodes[i].id+'", "'+nodes[i].className+'"); }');eval('nodes[i].onmouseout = function() { self.box2out("'+nodes[i].id+'", "'+nodes[i].className+'"); }');}}if(this.highlightActive&&nodes[i].tagName&&nodes[i].tagName=="A"){if(document.location.href==nodes[i].href){nodes[i].className=(nodes[i].className?" active":"active");}}if(nodes[i].childNodes){this.parse(nodes[i].childNodes,tree,id);}}};this.catover=function(id){if(!this.catHover){return;}if(!document.getElementById(id)){return;}document.getElementById(id).className=(this.id_openbox==id?"cat-open-hover":"cat-hover");};this.catout=function(id){if(!this.catHover){return;}if(!document.getElementById(id)){return;}document.getElementById(id).className=(this.id_openbox==id?"cat-open":"cat");};this.catclick=function(id){if(!document.getElementById(id)){return;}var id_openbox=this.id_openbox;if(this.id_openbox){if(!document.getElementById(id+"-section")){return;}this.hide();if(id_openbox==id){if(this.cathover){document.getElementById(id_openbox).className="cat-hover";}else{document.getElementById(id_openbox).className="cat";}}else{document.getElementById(id_openbox).className="cat";}}if(id_openbox!=id){this.show(id);var className=document.getElementById(id).className;if("cat-hover"==className){document.getElementById(id).className="cat-open-hover";}if("cat"==className){document.getElementById(id).className="cat-open";}}};this.box2over=function(id,className){if(!this.box2Hover){return;}if(!document.getElementById(id)){return;}document.getElementById(id).className=className+"-hover";};this.box2out=function(id,className){if(!this.box2Hover){return;}if(!document.getElementById(id)){return;}document.getElementById(id).className=className;};this.show=function(id){if(document.getElementById(id+"-section")){document.getElementById(id+"-section").style.display="block";this.id_openbox=id;}};this.hide=function(){document.getElementById(this.id_openbox+"-section").style.display="none";this.id_openbox="";};this.save=function(){if(this.id_openbox){this.cookie.set(this.id,this.id_openbox);}else{this.cookie.del(this.id);}};this.load=function(){var id_openbox=this.cookie.get(this.id);if(id_openbox){this.show(id_openbox);document.getElementById(id_openbox).className="cat-open";}};function Cookie(){this.get=function(name){var cookies=document.cookie.split(";");for(var i=0;i<cookies.length;i++){var a=cookies[i].split("=");if(a.length==2){a[0]=a[0].trim();a[1]=a[1].trim();if(a[0]==name){return unescape(a[1]);}}}return"";};this.set=function(name,value){document.cookie=name+"="+escape(value);};this.del=function(name){document.cookie=name+"=; expires=Thu, 01-Jan-70 00:00:01 GMT";};}var self=this;this.id=id;this.tree=new Array();this.cookie=new Cookie();this.id_openbox="";}if(typeof String.prototype.trim=="undefined"){String.prototype.trim=function(){var s=this.replace(/^\s*/,"");return s.replace(/\s*$/,"");};}



