(function(A){A.extend(A.fn,{validate:function(B){if(!this.length){B&&B.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var C=A.data(this[0],"validator");if(C){return C}C=new A.validator(B,this[0]);A.data(this[0],"validator",C);if(C.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){C.cancelSubmit=true});this.submit(function(D){if(C.settings.debug){D.preventDefault()}function E(){if(C.settings.submitHandler){C.settings.submitHandler.call(C,C.currentForm);return false}return true}if(C.cancelSubmit){C.cancelSubmit=false;return E()}if(C.form()){if(C.pendingRequest){C.formSubmitted=true;return false}return E()}else{C.focusInvalid();return false}})}return C},valid:function(){if(A(this[0]).is("form")){return this.validate().form()}else{var C=false;var B=A(this[0].form).validate();this.each(function(){C|=B.element(this)});return C}},removeAttrs:function(D){var B={},C=this;A.each(D.split(/\s/),function(E,F){B[F]=C.attr(F);C.removeAttr(F)});return B},rules:function(E,B){var G=this[0];if(E){var D=A.data(G.form,"validator").settings;var I=D.rules;var J=A.validator.staticRules(G);switch(E){case"add":A.extend(J,A.validator.normalizeRule(B));I[G.name]=J;if(B.messages){D.messages[G.name]=A.extend(D.messages[G.name],B.messages)}break;case"remove":if(!B){delete I[G.name];return J}var H={};A.each(B.split(/\s/),function(K,L){H[L]=J[L];delete J[L]});return H}}var F=A.validator.normalizeRules(A.extend({},A.validator.metadataRules(G),A.validator.classRules(G),A.validator.attributeRules(G),A.validator.staticRules(G)),G);if(F.required){var C=F.required;delete F.required;F=A.extend({required:C},F)}return F}});A.extend(A.expr[":"],{blank:function(B){return !A.trim(B.value)},filled:function(B){return !!A.trim(B.value)},unchecked:function(B){return !B.checked}});A.format=function(B,C){if(arguments.length==1){return function(){var D=A.makeArray(arguments);D.unshift(B);return A.format.apply(this,D)}}if(arguments.length>2&&C.constructor!=Array){C=A.makeArray(arguments).slice(1)}if(C.constructor!=Array){C=[C]}A.each(C,function(D,E){B=B.replace(new RegExp("\\{"+D+"\\}","g"),E)});return B};A.validator=function(B,C){this.settings=A.extend({},A.validator.defaults,B);this.currentForm=C;this.init()};A.extend(A.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:A([]),errorLabelContainer:A([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(B){this.lastActive=B;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,B,this.settings.errorClass);this.errorsFor(B).hide()}},onfocusout:function(B){if(!this.checkable(B)&&(B.name in this.submitted||!this.optional(B))){this.element(B)}},onkeyup:function(B){if(B.name in this.submitted||B==this.lastElement){this.element(B)}},onclick:function(B){if(B.name in this.submitted){this.element(B)}},highlight:function(C,B){A(C).addClass(B)},unhighlight:function(C,B){A(C).removeClass(B)}},setDefaults:function(B){A.extend(A.validator.defaults,B)},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:A.format("Please enter no more than {0} characters."),minlength:A.format("Please enter at least {0} characters."),rangelength:A.format("Please enter a value between {0} and {1} characters long."),range:A.format("Please enter a value between {0} and {1}."),max:A.format("Please enter a value less than or equal to {0}."),min:A.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=A(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||A(this.currentForm);this.containers=A(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var B=(this.groups={});A.each(this.settings.groups,function(E,F){A.each(F.split(/\s/),function(H,G){B[G]=E})});var D=this.settings.rules;A.each(D,function(E,F){D[E]=A.validator.normalizeRule(F)});function C(F){var E=A.data(this[0].form,"validator");E.settings["on"+F.type]&&E.settings["on"+F.type].call(E,this[0])}A(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",C).delegate("click",":radio, :checkbox",C);if(this.settings.invalidHandler){A(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();A.extend(this.submitted,this.errorMap);this.invalid=A.extend({},this.errorMap);if(!this.valid()){A(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var B=0,C=(this.currentElements=this.elements());C[B];B++){this.check(C[B])}return this.valid()},element:function(C){C=this.clean(C);this.lastElement=C;this.prepareElement(C);this.currentElements=A(C);var B=this.check(C);if(B){delete this.invalid[C.name]}else{this.invalid[C.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return B},showErrors:function(C){if(C){A.extend(this.errorMap,C);this.errorList=[];for(var B in C){this.errorList.push({message:C[B],element:this.findByName(B)[0]})}this.successList=A.grep(this.successList,function(D){return !(D.name in C)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if(A.fn.resetForm){A(this.currentForm).resetForm()}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(D){var C=0;for(var B in D){C++}return C},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{A(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus()}catch(B){}}},findLastActive:function(){var B=this.lastActive;return B&&A.grep(this.errorList,function(C){return C.element.name==B.name}).length==1&&B},elements:function(){var C=this,B={};return A([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&C.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in B||!C.objectLength(A(this).rules())){return false}B[this.name]=true;return true})},clean:function(B){return A(B)[0]},errors:function(){return A(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=A([]);this.toHide=A([]);this.formSubmitted=false;this.currentElements=A([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(B){this.reset();this.toHide=this.errorsFor(B)},check:function(C){C=this.clean(C);if(this.checkable(C)){C=this.findByName(C.name)[0]}var G=A(C).rules();var D=false;for(method in G){var F={method:method,parameters:G[method]};try{var B=A.validator.methods[method].call(this,C.value,C,F.parameters);if(B=="dependency-mismatch"){D=true;continue}D=false;if(B=="pending"){this.toHide=this.toHide.not(this.errorsFor(C));return}if(!B){this.formatAndAdd(C,F);return false}}catch(E){this.settings.debug&&window.console&&console.log("exception occured when checking element "+C.id+", check the '"+F.method+"' method");throw E}}if(D){return}if(this.objectLength(G)){this.successList.push(C)}return true},customMetaMessage:function(B,D){if(!A.metadata){return}var C=this.settings.meta?A(B).metadata()[this.settings.meta]:A(B).metadata();return C&&C.messages&&C.messages[D]},customMessage:function(C,D){var B=this.settings.messages[C];return B&&(B.constructor==String?B:B[D])},findDefined:function(){for(var B=0;B<arguments.length;B++){if(arguments[B]!==undefined){return arguments[B]}}return undefined},defaultMessage:function(B,C){return this.findDefined(this.customMessage(B.name,C),this.customMetaMessage(B,C),!this.settings.ignoreTitle&&B.title||undefined,A.validator.messages[C],"<strong>Warning: No message defined for "+B.name+"</strong>")},formatAndAdd:function(B,D){var C=this.defaultMessage(B,D.method);if(typeof C=="function"){C=C.call(this,D.parameters,B)}this.errorList.push({message:C,element:B});this.errorMap[B.name]=C;this.submitted[B.name]=C},addWrapper:function(B){if(this.settings.wrapper){B=B.add(B.parents(this.settings.wrapper))}return B},defaultShowErrors:function(){for(var C=0;this.errorList[C];C++){var B=this.errorList[C];this.settings.highlight&&this.settings.highlight.call(this,B.element,this.settings.errorClass);this.showLabel(B.element,B.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(var C=0;this.successList[C];C++){this.showLabel(this.successList[C])}}if(this.settings.unhighlight){for(var C=0,D=this.validElements();D[C];C++){this.settings.unhighlight.call(this,D[C],this.settings.errorClass)}}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 A(this.errorList).map(function(){return this.element})},showLabel:function(C,D){var B=this.errorsFor(C);if(B.length){B.removeClass().addClass(this.settings.errorClass);B.attr("generated")&&B.html(D)}else{B=A("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(C),generated:true}).addClass(this.settings.errorClass).html(D||"");if(this.settings.wrapper){B=B.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(B).length){this.settings.errorPlacement?this.settings.errorPlacement(B,A(C)):B.insertAfter(C)}}if(!D&&this.settings.success){B.text("");typeof this.settings.success=="string"?B.addClass(this.settings.success):this.settings.success(B)}this.toShow=this.toShow.add(B)},errorsFor:function(B){return this.errors().filter("[for='"+this.idOrName(B)+"']")},idOrName:function(B){return this.groups[B.name]||(this.checkable(B)?B.name:B.id||B.name)},checkable:function(B){return/radio|checkbox/i.test(B.type)},findByName:function(B){var C=this.currentForm;return A(document.getElementsByName(B)).map(function(D,E){return E.form==C&&E.name==B&&E||null})},getLength:function(C,B){switch(B.nodeName.toLowerCase()){case"select":return A("option:selected",B).length;case"input":if(this.checkable(B)){return this.findByName(B.name).filter(":checked").length}}return C.length},depend:function(C,B){return this.dependTypes[typeof C]?this.dependTypes[typeof C](C,B):true},dependTypes:{"boolean":function(C,B){return C},string:function(C,B){return !!A(C,B.form).length},"function":function(C,B){return C(B)}},optional:function(B){return !A.validator.methods.required.call(this,A.trim(B.value),B)&&"dependency-mismatch"},startRequest:function(B){if(!this.pending[B.name]){this.pendingRequest++;this.pending[B.name]=true}},stopRequest:function(B,C){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[B.name];if(C&&this.pendingRequest==0&&this.formSubmitted&&this.form()){A(this.currentForm).submit()}else{if(!C&&this.pendingRequest==0&&this.formSubmitted){A(this.currentForm).triggerHandler("invalid-form",[this])}}},previousValue:function(B){return A.data(B,"previousValue")||A.data(B,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(B,"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(B,C){B.constructor==String?this.classRuleSettings[B]=C:A.extend(this.classRuleSettings,B)},classRules:function(C){var D={};var B=A(C).attr("class");B&&A.each(B.split(" "),function(){if(this in A.validator.classRuleSettings){A.extend(D,A.validator.classRuleSettings[this])}});return D},attributeRules:function(C){var E={};var B=A(C);for(method in A.validator.methods){var D=B.attr(method);if(D){E[method]=D}}if(E.maxlength&&/-1|2147483647|524288/.test(E.maxlength)){delete E.maxlength}return E},metadataRules:function(B){if(!A.metadata){return{}}var C=A.data(B.form,"validator").settings.meta;return C?A(B).metadata()[C]:A(B).metadata()},staticRules:function(C){var D={};var B=A.data(C.form,"validator");if(B.settings.rules){D=A.validator.normalizeRule(B.settings.rules[C.name])||{}}return D},normalizeRules:function(C,B){A.each(C,function(F,E){if(E===false){delete C[F];return}if(E.param||E.depends){var D=true;switch(typeof E.depends){case"string":D=!!A(E.depends,B.form).length;break;case"function":D=E.depends.call(B,B);break}if(D){C[F]=E.param!==undefined?E.param:true}else{delete C[F]}}});A.each(C,function(D,E){C[D]=A.isFunction(E)?E(B):E});A.each(["minlength","maxlength","min","max"],function(){if(C[this]){C[this]=Number(C[this])}});A.each(["rangelength","range"],function(){if(C[this]){C[this]=[Number(C[this][0]),Number(C[this][1])]}});if(A.validator.autoCreateRanges){if(C.min&&C.max){C.range=[C.min,C.max];delete C.min;delete C.max}if(C.minlength&&C.maxlength){C.rangelength=[C.minlength,C.maxlength];delete C.minlength;delete C.maxlength}}if(C.messages){delete C.messages}return C},normalizeRule:function(C){if(typeof C=="string"){var B={};A.each(C.split(/\s/),function(){B[this]=true});C=B}return C},addMethod:function(B,D,C){A.validator.methods[B]=D;A.validator.messages[B]=C;if(D.length<3){A.validator.addClassRules(B,A.validator.normalizeRule(B))}},methods:{required:function(D,C,E){if(!this.depend(E,C)){return"dependency-mismatch"}switch(C.nodeName.toLowerCase()){case"select":var B=A("option:selected",C);return B.length>0&&(C.type=="select-multiple"||(A.browser.msie&&!(B[0].attributes.value.specified)?B[0].text:B[0].value).length>0);case"input":if(this.checkable(C)){return this.getLength(D,C)>0}default:return A.trim(D).length>0}},remote:function(F,C,G){if(this.optional(C)){return"dependency-mismatch"}var D=this.previousValue(C);if(!this.settings.messages[C.name]){this.settings.messages[C.name]={}}this.settings.messages[C.name].remote=typeof D.message=="function"?D.message(F):D.message;G=typeof G=="string"&&{url:G}||G;if(D.old!==F){D.old=F;var B=this;this.startRequest(C);var E={};E[C.name]=F;A.ajax(A.extend(true,{url:G,mode:"abort",port:"validate"+C.name,dataType:"json",data:E,success:function(I){if(I){var H=B.formSubmitted;B.prepareElement(C);B.formSubmitted=H;B.successList.push(C);B.showErrors()}else{var J={};J[C.name]=I||B.defaultMessage(C,"remote");B.showErrors(J)}D.valid=I;B.stopRequest(C,I)}},G));return"pending"}else{if(this.pending[C.name]){return"pending"}}return D.valid},minlength:function(C,B,D){return this.optional(B)||this.getLength(A.trim(C),B)>=D},maxlength:function(C,B,D){return this.optional(B)||this.getLength(A.trim(C),B)<=D},rangelength:function(D,B,E){var C=this.getLength(A.trim(D),B);return this.optional(B)||(C>=E[0]&&C<=E[1])},min:function(C,B,D){return this.optional(B)||C>=D},max:function(C,B,D){return this.optional(B)||C<=D},range:function(C,B,D){return this.optional(B)||(C>=D[0]&&C<=D[1])},email:function(C,B){return this.optional(B)||/^((([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(C)},url:function(C,B){return this.optional(B)||/^(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(C)},date:function(C,B){return this.optional(B)||!/Invalid|NaN/.test(new Date(C))},dateISO:function(C,B){return this.optional(B)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(C)},dateDE:function(C,B){return this.optional(B)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(C)},number:function(C,B){return this.optional(B)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(C)},numberDE:function(C,B){return this.optional(B)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(C)},digits:function(C,B){return this.optional(B)||/^\d+$/.test(C)},creditcard:function(F,C){if(this.optional(C)){return"dependency-mismatch"}if(/[^0-9-]+/.test(F)){return false}var G=0,E=0,B=false;F=F.replace(/\D/g,"");for(n=F.length-1;n>=0;n--){var D=F.charAt(n);var E=parseInt(D,10);if(B){if((E*=2)>9){E-=9}}G+=E;B=!B}return(G%10)==0},accept:function(C,B,D){D=typeof D=="string"?D:"png|jpe?g|gif";return this.optional(B)||C.match(new RegExp(".("+D+")$","i"))},equalTo:function(C,B,D){return C==A(D).val()}}})})(jQuery);(function(C){var B=C.ajax;var A={};C.ajax=function(E){E=C.extend(E,C.extend({},C.ajaxSettings,E));var D=E.port;if(E.mode=="abort"){if(A[D]){A[D].abort()}return(A[D]=B.apply(this,arguments))}return B.apply(this,arguments)}})(jQuery);(function(A){A.each({focus:"focusin",blur:"focusout"},function(C,B){A.event.special[B]={setup:function(){if(A.browser.msie){return false}this.addEventListener(C,A.event.special[B].handler,true)},teardown:function(){if(A.browser.msie){return false}this.removeEventListener(C,A.event.special[B].handler,true)},handler:function(D){arguments[0]=A.event.fix(D);arguments[0].type=B;return A.event.handle.apply(this,arguments)}}});A.extend(A.fn,{delegate:function(D,C,B){return this.bind(D,function(E){var F=A(E.target);if(F.is(C)){return B.apply(F,arguments)}})},triggerEvent:function(B,C){return this.triggerHandler(B,[A.event.fix({type:B,target:C})])}})})(jQuery);(function(D){D.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(F,E){D.fx.step[E]=function(G){if(G.state==0){G.start=C(G.elem,E);G.end=B(G.end)}G.elem.style[E]="rgb("+[Math.max(Math.min(parseInt((G.pos*(G.end[0]-G.start[0]))+G.start[0]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[1]-G.start[1]))+G.start[1]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[2]-G.start[2]))+G.start[2]),255),0)].join(",")+")"}});function B(F){var E;if(F&&F.constructor==Array&&F.length==3){return F}if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return[parseInt(E[1]),parseInt(E[2]),parseInt(E[3])]}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return[parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55]}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return[parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16)]}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return[parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16)]}if(E=/rgba\(0, 0, 0, 0\)/.exec(F)){return A.transparent}return A[D.trim(F).toLowerCase()]}function C(G,E){var F;do{F=D.curCSS(G,E);if(F!=""&&F!="transparent"||D.nodeName(G,"body")){break}E="backgroundColor"}while(G=G.parentNode);return B(F)}var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]}})(jQuery);jQuery.cookie=function(B,I,L){if(typeof I!="undefined"){L=L||{};if(I===null){I="";L.expires=-1}var E="";if(L.expires&&(typeof L.expires=="number"||L.expires.toUTCString)){var F;if(typeof L.expires=="number"){F=new Date();F.setTime(F.getTime()+(L.expires*24*60*60*1000))}else{F=L.expires}E="; expires="+F.toUTCString()}var K=L.path?"; path="+(L.path):"";var G=L.domain?"; domain="+(L.domain):"";var A=L.secure?"; secure":"";if(L.encode||typeof L.encode==="undefined"){document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")}else{document.cookie=[B,"=",I,E,K,G,A].join("")}}else{var D=null;if(document.cookie&&document.cookie!=""){var J=document.cookie.split(";");for(var H=0;H<J.length;H++){var C=jQuery.trim(J[H]);if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));break}}}return D}};(function($){function toIntegersAtLease(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(date){return this.getUTCFullYear()+"-"+toIntegersAtLease(this.getUTCMonth())+"-"+toIntegersAtLease(this.getUTCDate())};var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};jQuery.quoteString=function(string){if(escapeable.test(string)){return'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==="string"){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+string+'"'};jQuery.toJSON=function(o,compact){var type=typeof(o);if(type=="undefined"){return"undefined"}else{if(type=="number"||type=="boolean"){return o+""}else{if(o===null){return"null"}}}if(type=="string"){return jQuery.quoteString(o)}if(type=="object"&&typeof o.toJSON=="function"){return o.toJSON(compact)}if(type!="function"&&typeof(o.length)=="number"){var ret=[];for(var i=0;i<o.length;i++){ret.push(jQuery.toJSON(o[i],compact))}if(compact){return"["+ret.join(",")+"]"}else{return"["+ret.join(", ")+"]"}}if(type=="function"){throw new TypeError("Unable to convert object of type 'function' to json.")}var ret=[];for(var k in o){var name;type=typeof(k);if(type=="number"){name='"'+k+'"'}else{if(type=="string"){name=jQuery.quoteString(k)}else{continue}}var val=jQuery.toJSON(o[k],compact);if(typeof(val)!="string"){continue}if(compact){ret.push(name+":"+val)}else{ret.push(name+": "+val)}}return"{"+ret.join(", ")+"}"};jQuery.compactJSON=function(o){return jQuery.toJSON(o,true)};jQuery.evalJSON=function(src){return eval("("+src+")")};jQuery.secureEvalJSON=function(src){var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,"@");filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,"");if(/^[\],:{}\s]*$/.test(filtered)){return eval("("+src+")")}else{throw new SyntaxError("Error parsing JSON, source is not valid.")}}})(jQuery);(function(A){A.fn.tweet=function(D){var C={username:["seaofclouds"],avatar_size:null,count:3,intro_text:null,outro_text:null,join_text:null,auto_join_text_default:"i said,",auto_join_text_ed:"i",auto_join_text_ing:"i am",auto_join_text_reply:"i replied to",auto_join_text_url:"i was looking at",loading_text:null,query:null};A.fn.extend({linkUrl:function(){var E=[];var F=/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;this.each(function(){E.push(this.replace(F,'<a href="$1">$1</a>'))});return A(E)},linkUser:function(){var E=[];var F=/[\@]+([A-Za-z0-9-_]+)/gi;this.each(function(){E.push(this.replace(F,'<a href="http://twitter.com/$1">@$1</a>'))});return A(E)},linkHash:function(){var E=[];var F=/ [\#]+([A-Za-z0-9-_]+)/gi;this.each(function(){E.push(this.replace(F,' <a href="http://search.twitter.com/search?q=&tag=$1&lang=all&from='+C.username.join("%2BOR%2B")+'">#$1</a>'))});return A(E)},capAwesome:function(){var E=[];this.each(function(){E.push(this.replace(/(a|A)wesome/gi,"AWESOME"))});return A(E)},capEpic:function(){var E=[];this.each(function(){E.push(this.replace(/(e|E)pic/gi,"EPIC"))});return A(E)},makeHeart:function(){var E=[];this.each(function(){E.push(this.replace(/[&lt;]+[3]/gi,"<tt class='heart'>&#x2665;</tt>"))});return A(E)}});function B(F){var E=Date.parse(F);var G=(arguments.length>1)?arguments[1]:new Date();var H=parseInt((G.getTime()-E)/1000);if(H<60){return"less than a minute ago"}else{if(H<120){return"about a minute ago"}else{if(H<(45*60)){return(parseInt(H/60)).toString()+" minutes ago"}else{if(H<(90*60)){return"about an hour ago"}else{if(H<(24*60*60)){return"about "+(parseInt(H/3600)).toString()+" hours ago"}else{if(H<(48*60*60)){return"1 day ago"}else{return(parseInt(H/86400)).toString()+" days ago"}}}}}}}if(D){A.extend(C,D)}return this.each(function(){var I=A('<ul class="tweet_list">').appendTo(this);var H='<p class="tweet_intro">'+C.intro_text+"</p>";var E='<p class="tweet_outro">'+C.outro_text+"</p>";var J=A('<p class="loading">'+C.loading_text+"</p>");if(typeof(C.username)=="string"){C.username=[C.username]}var G="";if(C.query){G+="q="+C.query}G+="&q=from:"+C.username.join("%20OR%20from:");var F="http://search.twitter.com/search.json?&"+G+"&rpp="+C.count+"&callback=?";if(C.loading_text){A(this).append(J)}A.getJSON(F,function(K){if(C.loading_text){J.remove()}if(C.intro_text){I.before(H)}A.each(K.results,function(O,T){if(C.join_text=="auto"){if(T.text.match(/^(@([A-Za-z0-9-_]+)) .*/i)){var M=C.auto_join_text_reply}else{if(T.text.match(/(^\w+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+) .*/i)){var M=C.auto_join_text_url}else{if(T.text.match(/^((\w+ed)|just) .*/im)){var M=C.auto_join_text_ed}else{if(T.text.match(/^(\w*ing) .*/i)){var M=C.auto_join_text_ing}else{var M=C.auto_join_text_default}}}}}else{var M=C.join_text}var R='<span class="tweet_join"> '+M+" </span>";var L=((C.join_text)?R:" ");var P='<a class="tweet_avatar" href="http://twitter.com/'+T.from_user+'"><img src="'+T.profile_image_url+'" height="'+C.avatar_size+'" width="'+C.avatar_size+'" alt="'+T.from_user+'\'s avatar" border="0"/></a>';var Q=(C.avatar_size?P:"");var N='<a href="http://twitter.com/'+T.from_user+"/statuses/"+T.id+'" title="view tweet on twitter">'+B(T.created_at)+"</a>";var S='<span class="tweet_text">'+A([T.text]).linkUrl().linkUser().linkHash().makeHeart().capAwesome().capEpic()[0]+"</span>";I.append("<li>"+Q+N+L+S+"</li>");I.children("li:first").addClass("tweet_first");I.children("li:odd").addClass("tweet_even");I.children("li:even").addClass("tweet_odd")});if(C.outro_text){I.after(E)}})})}})(jQuery);new function(E){var D=E.separator||"&";var C=E.spaces===false?false:true;var A=E.suffix===false?"":"[]";var G=E.prefix===false?false:true;var B=G?E.hash===true?"#":"?":"";var F=E.numbers===false?false:true;jQuery.query=new function(){var H=function(M,L){return M!=undefined&&M!==null&&(!!L?M.constructor==L:true)};var I=function(Q){var L,P=/\[([^[]*)\]/g,M=/^([^[]+)(\[.*\])?$/.exec(Q),N=M[1],O=[];while(L=P.exec(M[2])){O.push(L[1])}return[N,O]};var K=function(R,Q,P){var S,O=Q.shift();if(typeof R!="object"){R=null}if(O===""){if(!R){R=[]}if(H(R,Array)){R.push(Q.length==0?P:K(null,Q.slice(0),P))}else{if(H(R,Object)){var N=0;while(R[N++]!=null){}R[--N]=Q.length==0?P:K(R[N],Q.slice(0),P)}else{R=[];R.push(Q.length==0?P:K(null,Q.slice(0),P))}}}else{if(O&&O.match(/^\s*[0-9]+\s*$/)){var M=parseInt(O,10);if(!R){R=[]}R[M]=Q.length==0?P:K(R[M],Q.slice(0),P)}else{if(O){var M=O.replace(/^\s*|\s*$/g,"");if(!R){R={}}if(H(R,Array)){var L={};for(var N=0;N<R.length;++N){L[N]=R[N]}R=L}R[M]=Q.length==0?P:K(R[M],Q.slice(0),P)}else{return P}}}return R};var J=function(L){var M=this;M.keys={};if(L.queryObject){jQuery.each(L.get(),function(N,O){M.SET(N,O)})}else{jQuery.each(arguments,function(){var N=""+this;N=N.replace(/^[?#]/,"");N=N.replace(/[;&]$/,"");if(C){N=N.replace(/[+]/g," ")}jQuery.each(N.split(/[&;]/),function(){var O=decodeURIComponent(this.split("=")[0]||"");var P=decodeURIComponent(this.split("=")[1]||"");if(!O){return}if(F){if(/^[+-]?[0-9]+\.[0-9]*$/.test(P)){P=parseFloat(P)}else{if(/^[+-]?[0-9]+$/.test(P)){P=parseInt(P,10)}}}P=(!P&&P!==0)?true:P;if(P!==false&&P!==true&&typeof P!="number"){P=P}M.SET(O,P)})})}return M};J.prototype={queryObject:true,has:function(L,M){var N=this.get(L);return H(N,M)},GET:function(M){if(!H(M)){return this.keys}var L=I(M),N=L[0],P=L[1];var O=this.keys[N];while(O!=null&&P.length!=0){O=O[P.shift()]}return typeof O=="number"?O:O||""},get:function(L){var M=this.GET(L);if(H(M,Object)){return jQuery.extend(true,{},M)}else{if(H(M,Array)){return M.slice(0)}}return M},SET:function(M,R){var O=!H(R)?null:R;var L=I(M),N=L[0],Q=L[1];var P=this.keys[N];this.keys[N]=K(P,Q.slice(0),O);return this},set:function(L,M){return this.copy().SET(L,M)},REMOVE:function(L){return this.SET(L,null).COMPACT()},remove:function(L){return this.copy().REMOVE(L)},EMPTY:function(){var L=this;jQuery.each(L.keys,function(M,N){delete L.keys[M]});return L},load:function(L){var N=L.replace(/^.*?[#](.+?)(?:\?.+)?$/,"$1");var M=L.replace(/^.*?[?](.+?)(?:#.+)?$/,"$1");return new J(L.length==M.length?"":M,L.length==N.length?"":N)},empty:function(){return this.copy().EMPTY()},copy:function(){return new J(this)},COMPACT:function(){function L(O){var N=typeof O=="object"?H(O,Array)?[]:{}:O;if(typeof O=="object"){function M(R,P,Q){if(H(R,Array)){R.push(Q)}else{R[P]=Q}}jQuery.each(O,function(P,Q){if(!H(Q)){return true}M(N,P,L(Q))})}return N}this.keys=L(this.keys);return this},compact:function(){return this.copy().COMPACT()},toString:function(){var N=0,R=[],Q=[],M=this;var O=function(S){S=S+"";if(C){S=S.replace(/ /g,"+")}return encodeURIComponent(S)};var L=function(S,T,U){if(!H(U)||U===false){return}var V=[O(T)];if(U!==true){V.push("=");V.push(O(U))}S.push(V.join(""))};var P=function(T,S){var U=function(V){return !S||S==""?[V].join(""):[S,"[",V,"]"].join("")};jQuery.each(T,function(V,W){if(typeof W=="object"){P(W,U(V))}else{L(Q,U(V),W)}})};P(this.keys);if(Q.length>0){R.push(B)}R.push(Q.join(D));return R.join("")}};return new J(location.search,location.hash)}}(jQuery.query||{});var dateFormat=function(){var A=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,B=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,D=/[^-+\dA-Z]/g,C=function(F,E){F=String(F);E=E||2;while(F.length<E){F="0"+F}return F};return function(J,V,R){var G=dateFormat;if(arguments.length==1&&Object.prototype.toString.call(J)=="[object String]"&&!/\d/.test(J)){V=J;J=undefined}J=J?new Date(J):new Date;if(isNaN(J)){throw SyntaxError("invalid date")}V=String(G.masks[V]||V||G.masks["default"]);if(V.slice(0,4)=="UTC:"){V=V.slice(4);R=true}var T=R?"getUTC":"get",O=J[T+"Date"](),E=J[T+"Day"](),K=J[T+"Month"](),Q=J[T+"FullYear"](),S=J[T+"Hours"](),N=J[T+"Minutes"](),U=J[T+"Seconds"](),P=J[T+"Milliseconds"](),F=R?0:J.getTimezoneOffset(),I={d:O,dd:C(O),ddd:G.i18n.dayNames[E],dddd:G.i18n.dayNames[E+7],m:K+1,mm:C(K+1),mmm:G.i18n.monthNames[K],mmmm:G.i18n.monthNames[K+12],yy:String(Q).slice(2),yyyy:Q,h:S%12||12,hh:C(S%12||12),H:S,HH:C(S),M:N,MM:C(N),s:U,ss:C(U),l:C(P,3),L:C(P>99?Math.round(P/10):P),t:S<12?"a":"p",tt:S<12?"am":"pm",T:S<12?"A":"P",TT:S<12?"AM":"PM",Z:R?"UTC":(String(J).match(B)||[""]).pop().replace(D,""),o:(F>0?"-":"+")+C(Math.floor(Math.abs(F)/60)*100+Math.abs(F)%60,4),S:["th","st","nd","rd"][O%10>3?0:(O%100-O%10!=10)*O%10]};return V.replace(A,function(H){return H in I?I[H]:H.slice(1,H.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(A,B){return dateFormat(this,A,B)};/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var d="undefined",R="object",s="Shockwave Flash",w="ShockwaveFlash.ShockwaveFlash",Q="application/x-shockwave-flash",r="SWFObjectExprInst",X="onreadystatechange",o=window,J=document,T=navigator,t=false,u=[H],O=[],n=[],i=[],L,q,e,b,j=false,A=false,N,g,M=true,m=function(){var Aa=typeof J.getElementById!=d&&typeof J.getElementsByTagName!=d&&typeof J.createElement!=d,Ah=T.userAgent.toLowerCase(),y=T.platform.toLowerCase(),Ae=y?/win/.test(y):/win/.test(Ah),Ac=y?/mac/.test(y):/mac/.test(Ah),Af=/webkit/.test(Ah)?parseFloat(Ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,x=!+"\v1",Ag=[0,0,0],Ab=null;if(typeof T.plugins!=d&&typeof T.plugins[s]==R){Ab=T.plugins[s].description;if(Ab&&!(typeof T.mimeTypes!=d&&T.mimeTypes[Q]&&!T.mimeTypes[Q].enabledPlugin)){t=true;x=false;Ab=Ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");Ag[0]=parseInt(Ab.replace(/^(.*)\..*$/,"$1"),10);Ag[1]=parseInt(Ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);Ag[2]=/[a-zA-Z]/.test(Ab)?parseInt(Ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof o.ActiveXObject!=d){try{var Ad=new ActiveXObject(w);if(Ad){Ab=Ad.GetVariable("$version");if(Ab){x=true;Ab=Ab.split(" ")[1].split(",");Ag=[parseInt(Ab[0],10),parseInt(Ab[1],10),parseInt(Ab[2],10)]}}}catch(z){}}}return{w3:Aa,pv:Ag,wk:Af,ie:x,win:Ae,mac:Ac}}(),K=function(){if(!m.w3){return}if((typeof J.readyState!=d&&J.readyState=="complete")||(typeof J.readyState==d&&(J.getElementsByTagName("body")[0]||J.body))){F()}if(!j){if(typeof J.addEventListener!=d){J.addEventListener("DOMContentLoaded",F,false)}if(m.ie&&m.win){J.attachEvent(X,function(){if(J.readyState=="complete"){J.detachEvent(X,arguments.callee);F()}});if(o==top){(function(){if(j){return}try{J.documentElement.doScroll("left")}catch(x){setTimeout(arguments.callee,0);return}F()})()}}if(m.wk){(function(){if(j){return}if(!/loaded|complete/.test(J.readyState)){setTimeout(arguments.callee,0);return}F()})()}S(F)}}();function F(){if(j){return}try{var z=J.getElementsByTagName("body")[0].appendChild(c("span"));z.parentNode.removeChild(z)}catch(Aa){return}j=true;var x=u.length;for(var y=0;y<x;y++){u[y]()}}function k(x){if(j){x()}else{u[u.length]=x}}function S(y){if(typeof o.addEventListener!=d){o.addEventListener("load",y,false)}else{if(typeof J.addEventListener!=d){J.addEventListener("load",y,false)}else{if(typeof o.attachEvent!=d){I(o,"onload",y)}else{if(typeof o.onload=="function"){var x=o.onload;o.onload=function(){x();y()}}else{o.onload=y}}}}}function H(){if(t){v()}else{h()}}function v(){var x=J.getElementsByTagName("body")[0];var Aa=c(R);Aa.setAttribute("type",Q);var z=x.appendChild(Aa);if(z){var y=0;(function(){if(typeof z.GetVariable!=d){var Ab=z.GetVariable("$version");if(Ab){Ab=Ab.split(" ")[1].split(",");m.pv=[parseInt(Ab[0],10),parseInt(Ab[1],10),parseInt(Ab[2],10)]}}else{if(y<10){y++;setTimeout(arguments.callee,10);return}}x.removeChild(Aa);z=null;h()})()}else{h()}}function h(){var Ag=O.length;if(Ag>0){for(var Af=0;Af<Ag;Af++){var y=O[Af].id;var Ab=O[Af].callbackFn;var Aa={success:false,id:y};if(m.pv[0]>0){var Ae=C(y);if(Ae){if(f(O[Af].swfVersion)&&!(m.wk&&m.wk<312)){W(y,true);if(Ab){Aa.success=true;Aa.ref=Z(y);Ab(Aa)}}else{if(O[Af].expressInstall&&a()){var Ai={};Ai.data=O[Af].expressInstall;Ai.width=Ae.getAttribute("width")||"0";Ai.height=Ae.getAttribute("height")||"0";if(Ae.getAttribute("class")){Ai.styleclass=Ae.getAttribute("class")}if(Ae.getAttribute("align")){Ai.align=Ae.getAttribute("align")}var Ah={};var x=Ae.getElementsByTagName("param");var Ac=x.length;for(var Ad=0;Ad<Ac;Ad++){if(x[Ad].getAttribute("name").toLowerCase()!="movie"){Ah[x[Ad].getAttribute("name")]=x[Ad].getAttribute("value")}}p(Ai,Ah,y,Ab)}else{P(Ae);if(Ab){Ab(Aa)}}}}}else{W(y,true);if(Ab){var z=Z(y);if(z&&typeof z.SetVariable!=d){Aa.success=true;Aa.ref=z}Ab(Aa)}}}}}function Z(Aa){var x=null;var y=C(Aa);if(y&&y.nodeName=="OBJECT"){if(typeof y.SetVariable!=d){x=y}else{var z=y.getElementsByTagName(R)[0];if(z){x=z}}}return x}function a(){return !A&&f("6.0.65")&&(m.win||m.mac)&&!(m.wk&&m.wk<312)}function p(Aa,Ab,x,z){A=true;e=z||null;b={success:false,id:x};var Ae=C(x);if(Ae){if(Ae.nodeName=="OBJECT"){L=G(Ae);q=null}else{L=Ae;q=x}Aa.id=r;if(typeof Aa.width==d||(!/%$/.test(Aa.width)&&parseInt(Aa.width,10)<310)){Aa.width="310"}if(typeof Aa.height==d||(!/%$/.test(Aa.height)&&parseInt(Aa.height,10)<137)){Aa.height="137"}J.title=J.title.slice(0,47)+" - Flash Player Installation";var Ad=m.ie&&m.win?"ActiveX":"PlugIn",Ac="MMredirectURL="+o.location.toString().replace(/&/g,"%26")+"&MMplayerType="+Ad+"&MMdoctitle="+J.title;if(typeof Ab.flashvars!=d){Ab.flashvars+="&"+Ac}else{Ab.flashvars=Ac}if(m.ie&&m.win&&Ae.readyState!=4){var y=c("div");x+="SWFObjectNew";y.setAttribute("id",x);Ae.parentNode.insertBefore(y,Ae);Ae.style.display="none";(function(){if(Ae.readyState==4){Ae.parentNode.removeChild(Ae)}else{setTimeout(arguments.callee,10)}})()}U(Aa,Ab,x)}}function P(y){if(m.ie&&m.win&&y.readyState!=4){var x=c("div");y.parentNode.insertBefore(x,y);x.parentNode.replaceChild(G(y),x);y.style.display="none";(function(){if(y.readyState==4){y.parentNode.removeChild(y)}else{setTimeout(arguments.callee,10)}})()}else{y.parentNode.replaceChild(G(y),y)}}function G(Ab){var Aa=c("div");if(m.win&&m.ie){Aa.innerHTML=Ab.innerHTML}else{var y=Ab.getElementsByTagName(R)[0];if(y){var Ac=y.childNodes;if(Ac){var x=Ac.length;for(var z=0;z<x;z++){if(!(Ac[z].nodeType==1&&Ac[z].nodeName=="PARAM")&&!(Ac[z].nodeType==8)){Aa.appendChild(Ac[z].cloneNode(true))}}}}}return Aa}function U(Ai,Ag,y){var x,Aa=C(y);if(m.wk&&m.wk<312){return x}if(Aa){if(typeof Ai.id==d){Ai.id=y}if(m.ie&&m.win){var Ah="";for(var Ae in Ai){if(Ai[Ae]!=Object.prototype[Ae]){if(Ae.toLowerCase()=="data"){Ag.movie=Ai[Ae]}else{if(Ae.toLowerCase()=="styleclass"){Ah+=' class="'+Ai[Ae]+'"'}else{if(Ae.toLowerCase()!="classid"){Ah+=" "+Ae+'="'+Ai[Ae]+'"'}}}}}var Af="";for(var Ad in Ag){if(Ag[Ad]!=Object.prototype[Ad]){Af+='<param name="'+Ad+'" value="'+Ag[Ad]+'" />'}}Aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+Ah+">"+Af+"</object>";n[n.length]=Ai.id;x=C(Ai.id)}else{var z=c(R);z.setAttribute("type",Q);for(var Ac in Ai){if(Ai[Ac]!=Object.prototype[Ac]){if(Ac.toLowerCase()=="styleclass"){z.setAttribute("class",Ai[Ac])}else{if(Ac.toLowerCase()!="classid"){z.setAttribute(Ac,Ai[Ac])}}}}for(var Ab in Ag){if(Ag[Ab]!=Object.prototype[Ab]&&Ab.toLowerCase()!="movie"){E(z,Ab,Ag[Ab])}}Aa.parentNode.replaceChild(z,Aa);x=z}}return x}function E(z,x,y){var Aa=c("param");Aa.setAttribute("name",x);Aa.setAttribute("value",y);z.appendChild(Aa)}function Y(y){var x=C(y);if(x&&x.nodeName=="OBJECT"){if(m.ie&&m.win){x.style.display="none";(function(){if(x.readyState==4){B(y)}else{setTimeout(arguments.callee,10)}})()}else{x.parentNode.removeChild(x)}}}function B(z){var y=C(z);if(y){for(var x in y){if(typeof y[x]=="function"){y[x]=null}}y.parentNode.removeChild(y)}}function C(z){var x=null;try{x=J.getElementById(z)}catch(y){}return x}function c(x){return J.createElement(x)}function I(z,x,y){z.attachEvent(x,y);i[i.length]=[z,x,y]}function f(z){var y=m.pv,x=z.split(".");x[0]=parseInt(x[0],10);x[1]=parseInt(x[1],10)||0;x[2]=parseInt(x[2],10)||0;return(y[0]>x[0]||(y[0]==x[0]&&y[1]>x[1])||(y[0]==x[0]&&y[1]==x[1]&&y[2]>=x[2]))?true:false}function V(Ac,y,Ad,Ab){if(m.ie&&m.mac){return}var Aa=J.getElementsByTagName("head")[0];if(!Aa){return}var x=(Ad&&typeof Ad=="string")?Ad:"screen";if(Ab){N=null;g=null}if(!N||g!=x){var z=c("style");z.setAttribute("type","text/css");z.setAttribute("media",x);N=Aa.appendChild(z);if(m.ie&&m.win&&typeof J.styleSheets!=d&&J.styleSheets.length>0){N=J.styleSheets[J.styleSheets.length-1]}g=x}if(m.ie&&m.win){if(N&&typeof N.addRule==R){N.addRule(Ac,y)}}else{if(N&&typeof J.createTextNode!=d){N.appendChild(J.createTextNode(Ac+" {"+y+"}"))}}}function W(z,x){if(!M){return}var y=x?"visible":"hidden";if(j&&C(z)){C(z).style.visibility=y}else{V("#"+z,"visibility:"+y)}}function l(y){var z=/[\\\"<>\.;]/;var x=z.exec(y)!=null;return x&&typeof encodeURIComponent!=d?encodeURIComponent(y):y}var D=function(){if(m.ie&&m.win){window.attachEvent("onunload",function(){var Ac=i.length;for(var Ab=0;Ab<Ac;Ab++){i[Ab][0].detachEvent(i[Ab][1],i[Ab][2])}var z=n.length;for(var Aa=0;Aa<z;Aa++){Y(n[Aa])}for(var y in m){m[y]=null}m=null;for(var x in swfobject){swfobject[x]=null}swfobject=null})}}();return{registerObject:function(Ab,x,Aa,z){if(m.w3&&Ab&&x){var y={};y.id=Ab;y.swfVersion=x;y.expressInstall=Aa;y.callbackFn=z;O[O.length]=y;W(Ab,false)}else{if(z){z({success:false,id:Ab})}}},getObjectById:function(x){if(m.w3){return Z(x)}},embedSWF:function(Ab,Ah,Ae,Ag,y,Aa,z,Ad,Af,Ac){var x={success:false,id:Ah};if(m.w3&&!(m.wk&&m.wk<312)&&Ab&&Ah&&Ae&&Ag&&y){W(Ah,false);k(function(){Ae+="";Ag+="";var Aj={};if(Af&&typeof Af===R){for(var Al in Af){Aj[Al]=Af[Al]}}Aj.data=Ab;Aj.width=Ae;Aj.height=Ag;var Am={};if(Ad&&typeof Ad===R){for(var Ak in Ad){Am[Ak]=Ad[Ak]}}if(z&&typeof z===R){for(var Ai in z){if(typeof Am.flashvars!=d){Am.flashvars+="&"+Ai+"="+z[Ai]}else{Am.flashvars=Ai+"="+z[Ai]}}}if(f(y)){var An=U(Aj,Am,Ah);if(Aj.id==Ah){W(Ah,true)}x.success=true;x.ref=An}else{if(Aa&&a()){Aj.data=Aa;p(Aj,Am,Ah,Ac);return}else{W(Ah,true)}}if(Ac){Ac(x)}})}else{if(Ac){Ac(x)}}},switchOffAutoHideShow:function(){M=false},ua:m,getFlashPlayerVersion:function(){return{major:m.pv[0],minor:m.pv[1],release:m.pv[2]}},hasFlashPlayerVersion:f,createSWF:function(z,y,x){if(m.w3){return U(z,y,x)}else{return undefined}},showExpressInstall:function(z,Aa,x,y){if(m.w3&&a()){p(z,Aa,x,y)}},removeSWF:function(x){if(m.w3){Y(x)}},createCSS:function(Aa,z,y,x){if(m.w3){V(Aa,z,y,x)}},addDomLoadEvent:k,addLoadEvent:S,getQueryParamValue:function(Aa){var z=J.location.search||J.location.hash;if(z){if(/\?/.test(z)){z=z.split("?")[1]}if(Aa==null){return l(z)}var y=z.split("&");for(var x=0;x<y.length;x++){if(y[x].substring(0,y[x].indexOf("="))==Aa){return l(y[x].substring((y[x].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A){var x=C(r);if(x&&L){x.parentNode.replaceChild(L,x);if(q){W(q,true);if(m.ie&&m.win){L.style.display="block"}}if(e){e(b)}}A=false}}}}();String.prototype.startsWith=function(A){return(this.substr(0,A.length)===A)?true:false};String.prototype.contains=function(A){return this.indexOf(A)>=0};jQuery("html").addClass("js");var CP=window.CP||{};CP.Global=(function(){var B=function(){jQuery("form.search input[type=text]").each(function(){var G=jQuery(this);var F=G.prev("label");var E=F.text();this.value=(this.value==="")?E:this.value;F.remove();G.focus(function(){this.value=(this.value===E)?"":this.value});G.blur(function(){this.value=(this.value==="")?E:this.value})});jQuery("form.search").submit(function(){var E=jQuery(this).contents().find("input[type=text]")[0];if(E.value===undefined||E.value===""||E.value===defaultText){return false}else{return true}})};var D=function(){jQuery('a:not([href*="coreperformance.com"],[href^="/"],[href^="#"],[href^="javascript:"])').attr("target","_blank");jQuery("a[rel=external]").attr("target","_blank")};var A=function(){jQuery("#content img.videoStill").each(function(){var I=jQuery(this),E=jQuery("<div></div>"),H=I.parent(),G=((I.outerWidth()>250)?true:false),F=I.css("float");H.css("position","relative");E.css({position:"absolute",left:((G)?"10px":"5px"),bottom:((G)?"10px":"5px")}).addClass((G)?"videoOverlayLarge":"videoOverlay");H.css({display:"block",lineHeight:0,marginRight:I.css("margin-right"),marginBottom:I.css("margin-bottom"),"float":(F==="left"||F==="right")?F:""});I.css("margin",0);H.append(E)})};var C=function(){if(CP.Global.isUserSignedIn){jQuery("#user .signedOut").hide();jQuery("#user .signedIn").show()}};return{isSecurePage:("https:"==document.location.protocol),resourcePrefix:"",isUserSignedIn:(document.cookie.indexOf("_CPTicket=")>-1||document.cookie.indexOf("myCPToken=")>-1),isIe6:(jQuery.browser.msie&&jQuery.browser.version.slice(0,1)==6)?true:false,initialize:function(){if(this.initialized===true){return}CP.Cookie.init();this.applyModuleCorners("div.module:not(.noCorners)");this.applyModuleCorners("div.textBubble:not(.noCorners)");B();D();A();C();CP.Video.initialize.apply(CP.Video);CP.Slideshow.initialize();this.initialized=true},createNew:function(E){function G(){}G.prototype=E;return new G},ieCornerFix:function(){if(jQuery.browser.msie){jQuery("div.module").each(function(){$this=jQuery(this);var E=$this.css("position");$this.css("position","static").css("position",E)})}},initURLs:function(){if(CP.Global.isSecurePage){CP.Global.resourcePrefix="https://a248.e.akamai.net/=/743/126505/365d/origin.static.fuelforit.com/cp"}else{if(window.location.hostname.startsWith("dev.")){CP.Global.resourcePrefix="http://dev.static.fuelforit.com/cp"}else{if(window.location.hostname.startsWith("stage.")){CP.Global.resourcePrefix="http://stage.static.fuelforit.com/cp"}else{if(window.location.hostname==="coreperformance.localhost"){CP.Global.resourcePrefix="/resources"}else{CP.Global.resourcePrefix="http://static.fuelforit.com/cp"}}}}},applyModuleCorners:function(F){var E=jQuery(F).add(".roundedCorners");E.each(function(){var J=jQuery(this);if(J.hasClass("roundedCorners")){var H=jQuery("<div></div>").css({"margin-top":J.css("margin-top"),"margin-bottom":J.css("margin-bottom"),position:"relative"});J.css("margin",0);J.wrap(H);J.removeClass("roundedCorners");J=J.parent()}var G=6;var K=J.innerWidth();var I={$tl:jQuery('<span class="tl"></span>').css("width",K-G),$tr:jQuery('<span class="tr"></span>').css("width",G),$bl:jQuery('<span class="bl"></span>').css("width",K-G),$br:jQuery('<span class="br"></span>').css("width",G)};J.prepend(I.$tl);J.prepend(I.$tr);J.append(I.$bl);J.append(I.$br)})}}})();CP.Global.initURLs();CP.GridView={settings:"",init:function(B){this.settings=B;var A=this;jQuery(this.settings.gridId+" ul li").each(function(){var C=jQuery(this);jQuery(this).find("a").click(function(D){D.preventDefault();A.showView(C);if(A.settings.showActive){jQuery(A.settings.gridId+" ul li a").removeClass("active");jQuery(this).addClass("active")}})})},showView:function(C){for(var B in this.settings.elements){if(typeof(this.settings.elements[B])=="object"){var D=new Object;for(var A in this.settings.elements[B]){D[A]=jQuery(C).find(B+":first").attr(this.settings.elements[B][A])}jQuery(this.settings.viewId).find(B+":first").attr(D)}else{if(this.settings.elements[B]===""){jQuery(this.settings.viewId).find(B+":first").html(jQuery(C).find(B+":first").html())}else{jQuery(this.settings.viewId).find(B+":first").html(jQuery(C).find(this.settings.elements[B]+":first").html())}}}CP.Global.ieCornerFix()}};CP.Video=(function(){var B={standard:{width:411,height:231,mode:"standard"},common:{playerSwf:CP.Global.resourcePrefix+"/v2/flash/CPVideoPlayer.swf",XISwf:CP.Global.resourcePrefix+"/v2/flash/expressInstall.swf"}};var F={autoPlay:false,excludeIds:"",configUrl:CP.Global.resourcePrefix+"/v2/flash/xml/config.xml"};var E={base:CP.Global.resourcePrefix+"/v2/flash/",allowfullscreen:"true",allowscriptaccess:"always"};var A={};var D=function(I){if(I===null||typeof I!=="object"){return I}var G=new I.constructor();for(var H in I){G[H]=D(I[H])}return G};var C=function(){var H=this;var G=jQuery("#contentPrimary .video");if(G.length===0){return}G.each(function(){var J=jQuery(this),M=J.find("ul.playlist"),P=M.find("li"),L=P.eq(0),O=".videoPlayer",K=J.find(O).eq(0).attr("id"),N=[],I=0;P.click(function(S){S.preventDefault(S);var R=jQuery(this);if(R.hasClass("active")){return}var Q=document[K]||window[K];if(typeof Q==="undefined"||typeof Q.loadClip!=="function"){return}if(typeof Q.setAutoPlay==="function"){Q.setAutoPlay(true)}Q.loadClip(R.attr("id").replace(/^v_/,""));jQuery(".active",J).removeClass("active");R.addClass("active")});P.each(function(Q){N.push(jQuery(this).attr("id").replace(/^v_/,""))});N=N.join(",");I=L.attr("id").replace(/^v_/,"");H.loadPlayer("standard",{targetId:K,clipId:I,excludeIds:N},function(){L.addClass("active")});if(M.find("li").length==1){M.html("")}})};return{loadedIds:[],initialize:function(){if(this.initialized){return}C.apply(this);this.initialized=true},loadPlayer:function(H,J,M){if((H!=="standard")||typeof J==="undefined"||typeof J.targetId==="undefined"||jQuery.inArray(J.targetId,CP.Video.loadedIds)>-1){return}var I=D(F);I.mode=B[H].mode;I.clipId=J.clipId||"";I.autoPlay=J.autoPlay||I.autoPlay;I.excludeIds=J.excludeIds||I.excludeIds;try{var K,G=jQuery("#"+J.targetId);if(G.attr("class")!==""){K=jQuery("<div></div>").addClass(G.attr("class"));G.removeAttr("class");G.wrap(K)}swfobject.embedSWF(B.common.playerSwf,J.targetId,B[H].width,B[H].height,"9.0.115",B.common.XISwf,I,E,A);CP.Video.loadedIds.push(J.targetId);if(typeof M==="function"){M()}}catch(L){}}}}());CP.Modules={};CP.Modules.Newsletter=function(){var F="Enter your email address",J=".newsletter span.br",I="div#resultWrapper",D="#newsletterClose",B=".newsletter:not(.noJS) form",K=".newsletter input.text",M="input.text",G=false,N={h2:"Invalid Email Address",p:"Please make sure you've entered a valid email address and try again."};function L(R){if(jQuery(this).val()===F){jQuery(this).val("")}return false}function A(R){if(jQuery(this).val().length===0){jQuery(this).val(F)}return false}function H(T){T.preventDefault();var S=jQuery(this);var R=S.find(M).val();if(R===F||R.length===0){}else{if(!(/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(R))){E(N)}else{jQuery(B).unbind("submit",H).submit()}}}function C(S,R){if(R==="success"){E({h2:"Thank you for subscribing",p:"Each week we will send updates on the latest Core Performance news. We will never provide your email address to anyone else for any purpose without your permission. Connect with other members and visit our message boards and be part of the conversation."})}else{E(N)}}function Q(S){var R='<div id="resultWrapper" style="display: none;"><div class="result"><div class="close"><a id="newsletterClose" href="javascript: void(0)">X</a></div><h2>'+S.h2+"</h2><p>"+S.p+'</p></div><span id="newsletterBL" class="bl"></span><span id="newsletterBR" class="br"></span></div>';return R}function E(R){O();jQuery(J).after(Q(R));jQuery(I).show("fast");jQuery(D).click(O);G=true}function O(){if(G){jQuery(I).hide("fast",function(){jQuery(I).remove();jQuery("#newsletterBL,#newsletterBR").remove()})}G=false}function P(){jQuery(D).click(O);jQuery(K).val(F).click(L).blur(A);jQuery(B).submit(H)}jQuery(document).ready(P);return{}}();CP.Slideshow=(function(){var A=function(){jQuery("a.slideshow").each(function(){var E=jQuery(this),D=jQuery("<a></a>").text("Launch Slideshow"),G=jQuery("<p></p>").addClass("more").addClass("slideshowLauncher").append(D),C=E.attr("href");var F=function(H){H.preventDefault();B(C)};E.click(F);D.click(F);E.append(jQuery('<div class="overlay"></div>'));E.before(G)})};var B=function(C){C+=(((C.indexOf("?")>-1)?"&":"?")+"TB_iframe=true");Thickbox.display(null,C,null)};return{initialize:function(){if(this.initialized){return}A();this.initialized=true}}}());CP.Forms={};CP.Forms.Validator={formId:null,hasErrors:false,compare:function(B,A,C){if(C){return(B!=""&&A!=""&&B==A)}else{return(B==A)}},isValidEmail:function(A){return/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(A)},isChecked:function(A){return jQuery(A).is(":checked")},isNumeric:function(A){return(jQuery.trim(A)!=""&&!isNaN(A))},minLength:function(B,A){return(B.length>=A)},ccValidVisa:function(A){return/^4[0-9]{12}(?:[0-9]{3})?$/.test(A)},ccValidMasterCard:function(A){return/^5[1-5][0-9]{14}$/.test(A)},ccValidAmex:function(A){return/^3[47][0-9]{13}$/.test(A)},ccValidDiscover:function(A){return/^6(?:011|5[0-9]{2})[0-9]{12}$/.test(A)},ccValidLuhn:function(C){var A=C.length;var D=A%2;var B=0;for(i=0;i<A;i++){var E=C.charAt(i);if(i%2==D){E=E*2;if(E>9){E=E-9}}B=B+parseInt(E)}if(B%10==0){return true}else{return false}},showError:function(B,D,A){A=A||false;var C=jQuery(B).parent("fieldset");C.addClass("error");C.children("label").width(418);C.children("span:not(#loading,.error)").width(418);if(C.children("span.error").length==0){C.append('<span class="error">'+D+"</span>");if(C.height()<C.children("span.error").outerHeight(true)){C.height(C.children("span.error").outerHeight(true))}}if(!A){this.hasErrors=true}},clearError:function(A){if(jQuery(A)[0].tagName!="FIELDSET"){try{var C=jQuery(A).parent("fieldset");C.children("label").css("width","95%");C.children("span:not(#loading)").css("width","100%");C.removeClass("error");C.children("span.error").remove();C.css("height","auto")}catch(B){}}else{try{jQuery(A).children("label").css("width","95%");jQuery(A).children("span:not(#loading)").css("width","100%");jQuery(A).removeClass("error");jQuery(A).children("span.error").remove();jQuery(A).css("height","auto")}catch(B){}}},clearAllErrors:function(){var A=this.formId;this.hasErrors=false;try{jQuery(A+" fieldset.error > span.error").remove();jQuery(A).find("fieldset.error > label").css("width","95%");jQuery(A).find("fieldset.error > span:not(#loading)").css("width","100%");jQuery(A).find("fieldset.error").removeClass("error")}catch(B){}},updateErrorFieldSets:function(){var B=jQuery("span.error").parent("fieldset");var A=this;B.each(function(C){if(jQuery(this).height()<jQuery(this).children("span.error").outerHeight(true)){jQuery(this).height(jQuery(this).children("span.error").outerHeight(true))}A.hasErrors=true});if(A.hasErrors){A.scrollToFirstError()}},scrollToFirstError:function(){this.scrollToField(this.formId+" fieldset.error:first")},scrollToField:function(A){jQuery("html,body").animate({scrollTop:jQuery(A).offset().top},400,"swing")}};CP.Cookie=(function(){return{visitor:{},init:function(){var A=jQuery.cookie("Visitor");if(A!=null){CP.Cookie.visitor=jQuery.evalJSON(A)}},set:function(A,B){CP.Cookie.visitor[A]=B;this.saveCookie(CP.Cookie.visitor)},saveCookie:function(A){jQuery.cookie("Visitor",jQuery.toJSON(A),{expires:365,path:"/",domain:".coreperformance.com"})}}})();CP.Global.firstTimeVisit=(function(){var A={},B={};B.initControls=function(){if(CP.Cookie.visitor.firstTimeSeen>=2){jQuery("#firstTime .close").click(function(){CP.Cookie.visitor.firstTimeMod="closed";delete (CP.Cookie.visitor.firstTimeSeen);CP.Cookie.saveCookie(CP.Cookie.visitor);jQuery("#firstTime").hide()})}else{jQuery("#firstTime .close").hide()}if(typeof(_kmq)!=="undefined"){_kmq.push(["trackClick","ftvSignUp","Clicked First Time Visit Module"],{Page:window.location.pathname})}};A.initialize=function(){if(jQuery("#firstTime").length&&CP.Cookie.visitor.firstTimeMod!=="closed"&&CP.Global.isUserSignedIn==false&&CP.Global.isIe6==false){if(CP.Cookie.visitor.firstTime){delete (CP.Cookie.visitor.firstTime)}if(typeof(CP.Cookie.visitor.firstTimeSeen)==="number"){CP.Cookie.visitor.firstTimeSeen++}else{CP.Cookie.visitor.firstTimeSeen=1}CP.Cookie.saveCookie(CP.Cookie.visitor);B.initControls();jQuery("#firstTime").show();if(typeof(_kmq)!=="undefined"){_kmq.push(["record","Viewed First Time Visit Module",{Page:window.location.pathname}])}}};return A})();CP.Modules.StayConnected=(function(){var A=function(){jQuery("#stayConnected input[name=email]").focus(function(){if(jQuery.trim(jQuery(this).val())=="Enter your email address"){jQuery(this).val("")}}).blur(function(){if(jQuery.trim(jQuery(this).val())==""){jQuery(this).val("Enter your email address")}});jQuery("#stayConnected button").click(function(B){B.preventDefault();if((/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(jQuery("#stayConnected input[name=email]").val()))){jQuery(this).attr("disabled","disabled");jQuery.ajax({type:"POST",url:"/templates/Subscribe_Newsletter",data:{nlSignup:"Submit",email:jQuery("#stayConnected input[name=email]").val()}});jQuery("#stayConnected input[name=email], #stayConnected span").removeClass("error");jQuery("#stayConnected input[name=email]").val("Thanks for subscribing!");jQuery("#stayConnected form span").text("We respect your privacy")}else{jQuery("#stayConnected form span").addClass("error").text("Please enter a valid email address").prevUntil("#stayConnected form").addClass("error")}})};return{initialize:function(){if(this.initialized){return}if(jQuery("#stayConnected")[0]){A()}this.initialized=true}}}());CP.Analytics={isSecurePage:("https:"==document.location.protocol)};jQuery(document).ready(function(){CP.Global.initialize.apply(CP.Global);CP.Slideshow.initialize.apply(CP.Slideshow);CP.Global.firstTimeVisit.initialize();CP.Modules.StayConnected.initialize()});jQuery(window).load(function(){if(jQuery.browser.msie){CP.Global.ieCornerFix()}});var Thickbox=window.Thickbox||(function(){var G=CP.Global.resourcePrefix+"/v2/media/icons/loading.gif";var B=new Image();var F={};var A=function(J,K){J=J||TB_WIDTH;K=K||TB_HEIGHT;F.$window.css({marginLeft:"-"+parseInt((J/2),10)+"px",width:J+"px"});if(!(jQuery.browser.msie&&jQuery.browser.version<7)){var I=window.innerHeight||document.documentElement.clientHeight,L=(parseInt((K/2),10)>parseInt(((I/2)-10),10))?parseInt(((I/2)-10),10):parseInt((K/2),10);F.$window.css({marginTop:"-"+L+"px"})}};var D=function(L){var M={};if(!L){return M}var I=L.split(/[;&]/);for(var K=0;K<I.length;K++){var O=I[K].split("=");if(!O||O.length!=2){continue}var J=unescape(O[0]);var N=unescape(O[1]);N=N.replace(/\+/g," ");M[J]=N}return M};var E=function(){var K=document.documentElement;var I=window.innerWidth||self.innerWidth||(K&&K.clientWidth)||document.body.clientWidth;var J=window.innerHeight||self.innerHeight||(K&&K.clientHeight)||document.body.clientHeight;arrayPageSize=[I,J];return arrayPageSize};function C(){var I=navigator.userAgent.toLowerCase();if(I.indexOf("mac")!=-1&&I.indexOf("firefox")!=-1){return true}}var H=function(I){if(I!=="show"&&I!=="hide"){return}jQuery("embed, object").each(function(){jQuery(this).css("visibility",((I==="show")?"visible":"hidden"))})};return{initialize:function(I){var J=this;I=I||"a.thickbox, area.thickbox, input.thickbox";jQuery(I).click(function(N){N.preventDefault();var L=this.title||this.name||null;var K=this.href||this.alt;var M=this.rel||false;J.display(L,K,M);this.blur()});B.src=G},display:function(S,J,P){var Q=this,L;F.$body=F.body||jQuery("body");F.$overlay=F.$overlay||jQuery('<div id="TB_overlay"></div>');F.$window=F.$window||jQuery('<div id="TB_window"></div>');F.$loading=F.$loading||jQuery('<div id="TB_load"><img src="'+B.src+'" /></div>');try{if(typeof document.body.style.maxHeight==="undefined"){jQuery("body","html").css({height:"100%",width:"100%"});jQuery("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){F.$body.append(F.$overlay).append(F.$window);F.$overlay.click(Q.remove)}}else{if(document.getElementById("TB_overlay")===null){F.$body.append(F.$overlay).append(F.$window);F.$overlay.click(Q.remove)}}H("hide");if(C()){F.$overlay.addClass("TB_overlayMacFFBGHack");L=1}else{F.$overlay.addClass("TB_overlayBG");L=0.85}F.$overlay.css("opacity","0").animate({opacity:L},200);if(S===null){S=""}F.$body.append(F.$loading);F.$loading.show();var K;if(J.indexOf("?")!==-1){K=J.substr(0,J.indexOf("?"))}else{K=J}var O=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;var T=K.toLowerCase().match(O);if(T==".jpg"||T==".jpeg"||T==".png"||T==".gif"||T==".bmp"){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(P){TB_TempArray=jQuery("a[@rel="+P+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){var N=TB_TempArray[TB_Counter].href.toLowerCase().match(O);if(!(TB_TempArray[TB_Counter].href==J)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>"}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>"}}else{TB_FoundURL=true;TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length)}}}imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var X=E();var V=X[0]-150;var a=X[1]-150;var W=imgPreloader.width;var U=imgPreloader.height;if(W>V){U=U*(V/W);W=V;if(U>a){W=W*(a/U);U=a}}else{if(U>a){W=W*(a/U);U=a;if(W>V){U=U*(V/W);W=V}}}TB_WIDTH=W+30;TB_HEIGHT=U+60;F.$window.append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+J+"' width='"+W+"' height='"+U+"' alt='"+S+"'/></a><div id='TB_caption'>"+S+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>");jQuery("#TB_closeWindowButton").click(Q.remove);if(!(TB_PrevHTML==="")){function Z(){if(jQuery(document).unbind("click",Z)){jQuery(document).unbind("click",Z)}F.$window.remove();jQuery("body").append("<div id='TB_window'></div>");display(TB_PrevCaption,TB_PrevURL,P);return false}jQuery("#TB_prev").click(Z)}if(!(TB_NextHTML==="")){function Y(){F.$window.remove();jQuery("body").append("<div id='TB_window'></div>");display(TB_NextCaption,TB_NextURL,P);return false}jQuery("#TB_next").click(Y)}document.onkeydown=function(b){if(b==null){keycode=event.keyCode}else{keycode=b.which}if(keycode==27){Q.remove()}else{if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";Y()}}else{if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";Z()}}}}};A();F.$loading.remove();jQuery("#TB_ImageOff").click(Q.remove);F.$window.css({display:"block"})};imgPreloader.src=J}else{var I=J.replace(/^[^\?]+\??/,"");var M=D(I);TB_WIDTH=(M.width*1)+30||500;TB_HEIGHT=(M.height*1)+40||440;ajaxContentW=TB_WIDTH;ajaxContentH=TB_HEIGHT;if(J.indexOf("TB_iframe")!=-1){urlNoQuery=J.split("TB_");F.$iframe=jQuery("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' scrolling='no' onload='Thickbox.showIframe()'></iframe>");F.$iframe.css({height:"100%",width:"100%",backgroundColor:"transparent"});jQuery("#TB_iframeContent").remove();if(!document.getElementById("TB_iframeContent")){if(M.modal!="true"){F.$window.append(F.$iframe)}else{F.$overlay.unbind();F.$window.append(F.$iframe)}}}else{if(F.$window.css("display")!="block"){if(M.modal!="true"){F.$window.append("<div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>")}else{F.$overlay.unbind();F.$window.append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>")}}else{jQuery("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";jQuery("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";jQuery("#TB_ajaxContent")[0].scrollTop=0;jQuery("#TB_ajaxWindowTitle").html(S)}}jQuery("#TB_closeWindowButton").click(Q.remove);if(J.indexOf("TB_inline")!=-1){jQuery("#TB_ajaxContent").append(jQuery("#"+M.inlineId).children());F.$window.unload(function(){jQuery("#"+M.inlineId).append(jQuery("#TB_ajaxContent").children())});A();F.$loading.remove();F.$window.css({display:"block"})}else{if(J.indexOf("TB_iframe")!=-1){A();if(jQuery.browser.safari){F.$loading.remove();F.$window.css({display:"block"})}}else{jQuery("#TB_ajaxContent").load(J+=(J.indexOf("?")>-1?"&":"?")+"random="+(new Date().getTime()),function(V,X,U){A();F.$loading.remove();Thickbox.initialize.call(Q,"#TB_ajaxContent a.thickbox");F.$window.css({display:"block"});if(X==="success"){var W=jQuery(this);W.find("a:not(.external)").click(function(c){c.preventDefault();var Z=this.title||this.name||null;var Y=this.href||this.alt;var b=this.rel||false;Q.display(Z,Y,b)});W.find("form:not(.external)").submit(function(Y){Y.preventDefault();Q.display(null,jQuery(this).attr("action"),null)})}})}}}if(!M.modal){document.onkeyup=function(U){if(U==null){keycode=event.keyCode}else{keycode=U.which}if(keycode==27){Q.remove()}}}}catch(R){throw (R)}},showIframe:function(){var O=this,L=F.$iframe.attr("name"),P=function(Q){Q.preventDefault();O.remove()},N=jQuery('<a href="#">close</a>').click(P).css("cursor","pointer"),K=jQuery("<p></p>").append(N);F.$iframeDocument=jQuery(window[L].document);F.$iframePage=F.$iframeDocument.find("#page");F.$loading.remove();F.$window.css({display:"block"});F.$iframePage.find("a.close").click(P);var J=F.$iframePage.innerWidth(),M=F.$iframePage.innerHeight(),I=(window.innerHeight||document.documentElement.clientHeight)-40;F.$iframe.css({height:M+"px",width:J+"px"});M=(M>I)?I:M;F.$window.css({width:(J+20)+"px",height:(M+20)+"px"});A((J+20),(M+20));F.$iframePage.find("form").attr("target",L)},remove:function(){jQuery("#TB_imageOff").unbind("click");jQuery("#TB_closeWindowButton").unbind("click");F.$window.fadeOut("fast",function(){F.$window.trigger("unload").unbind().remove();F.$overlay.trigger("unload").unbind().remove();jQuery("#TB_HideSelect").trigger("unload").unbind().remove();H("show")});F.$loading.remove();if(typeof document.body.style.maxHeight=="undefined"){jQuery("body","html").css({height:"auto",width:"auto"});jQuery("html").css("overflow","")}document.onkeydown="";document.onkeyup="";if(typeof this.callback==="function"){this.callback();this.callback===null}return false}}}());jQuery(document).ready(function(){Thickbox.initialize.call(Thickbox)});
