(function(b){b.extend(b.fn,{validate:function(a){if(this.length){var d=b.data(this[0],"validator");if(d)return d;d=new b.validator(a,this[0]);b.data(this[0],"validator",d);if(d.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){d.cancelSubmit=true});d.settings.submitHandler&&this.find("input, button").filter(":submit").click(function(){d.submitButton=this});this.submit(function(c){function h(){if(d.settings.submitHandler){if(d.submitButton)var j=b("<input type='hidden'/>").attr("name",
d.submitButton.name).val(d.submitButton.value).appendTo(d.currentForm);d.settings.submitHandler.call(d,d.currentForm);d.submitButton&&j.remove();return false}return true}d.settings.debug&&c.preventDefault();if(d.cancelSubmit){d.cancelSubmit=false;return h()}if(d.form()){if(d.pendingRequest){d.formSubmitted=true;return false}return h()}else{d.focusInvalid();return false}})}return d}else a&&a.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")},valid:function(){if(b(this[0]).is("form"))return this.validate().form();
else{var a=true,d=b(this[0].form).validate();this.each(function(){a&=d.element(this)});return a}},removeAttrs:function(a){var d={},c=this;b.each(a.split(/\s/),function(h,j){d[j]=c.attr(j);c.removeAttr(j)});return d},rules:function(a,d){var c=this[0];if(a){var h=b.data(c.form,"validator").settings,j=h.rules,i=b.validator.staticRules(c);switch(a){case "add":b.extend(i,b.validator.normalizeRule(d));j[c.name]=i;if(d.messages)h.messages[c.name]=b.extend(h.messages[c.name],d.messages);break;case "remove":if(!d){delete j[c.name];
return i}var s={};b.each(d.split(/\s/),function(y,x){s[x]=i[x];delete i[x]});return s}}c=b.validator.normalizeRules(b.extend({},b.validator.metadataRules(c),b.validator.classRules(c),b.validator.attributeRules(c),b.validator.staticRules(c)),c);if(c.required){h=c.required;delete c.required;c=b.extend({required:h},c)}return c}});b.extend(b.expr[":"],{blank:function(a){return!b.trim(""+a.value)},filled:function(a){return!!b.trim(""+a.value)},unchecked:function(a){return!a.checked}});b.validator=function(a,
d){this.settings=b.extend(true,{},b.validator.defaults,a);this.currentForm=d;this.init()};b.validator.format=function(a,d){if(arguments.length==1)return function(){var c=b.makeArray(arguments);c.unshift(a);return b.validator.format.apply(this,c)};if(arguments.length>2&&d.constructor!=Array)d=b.makeArray(arguments).slice(1);if(d.constructor!=Array)d=[d];b.each(d,function(c,h){a=a.replace(RegExp("\\{"+c+"\\}","g"),h)});return a};b.extend(b.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",
validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:b([]),errorLabelContainer:b([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(a){this.lastActive=a;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass);this.errorsFor(a).hide()}},onfocusout:function(a){if(!this.checkable(a)&&(a.name in this.submitted||!this.optional(a)))this.element(a)},onkeyup:function(a){if(a.name in
this.submitted||a==this.lastElement)this.element(a)},onclick:function(a){if(a.name in this.submitted)this.element(a);else a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(a,d,c){b(a).addClass(d).removeClass(c)},unhighlight:function(a,d,c){b(a).removeClass(d).addClass(c)}},setDefaults:function(a){b.extend(b.validator.defaults,a)},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).",number:"Please enter a valid number.",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:b.validator.format("Please enter no more than {0} characters."),minlength:b.validator.format("Please enter at least {0} characters."),rangelength:b.validator.format("Please enter a value between {0} and {1} characters long."),
range:b.validator.format("Please enter a value between {0} and {1}."),max:b.validator.format("Please enter a value less than or equal to {0}."),min:b.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function a(h){var j=b.data(this[0].form,"validator");h="on"+h.type.replace(/^validate/,"");j.settings[h]&&j.settings[h].call(j,this[0])}this.labelContainer=b(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&
this.labelContainer||b(this.currentForm);this.containers=b(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var d=this.groups={};b.each(this.settings.groups,function(h,j){b.each(j.split(/\s/),function(i,s){d[s]=h})});var c=this.settings.rules;b.each(c,function(h,j){c[h]=b.validator.normalizeRule(j)});b(this.currentForm).validateDelegate(":text, :password, :file, select, textarea",
"focusin focusout keyup",a).validateDelegate(":radio, :checkbox, select, option","click",a);this.settings.invalidHandler&&b(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();b.extend(this.submitted,this.errorMap);this.invalid=b.extend({},this.errorMap);this.valid()||b(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,d=this.currentElements=this.elements();d[a];a++)this.check(d[a]);
return this.valid()},element:function(a){this.lastElement=a=this.clean(a);this.prepareElement(a);this.currentElements=b(a);var d=this.check(a);if(d)delete this.invalid[a.name];else this.invalid[a.name]=true;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return d},showErrors:function(a){if(a){b.extend(this.errorMap,a);this.errorList=[];for(var d in a)this.errorList.push({message:a[d],element:this.findByName(d)[0]});this.successList=b.grep(this.successList,
function(c){return!(c.name in a)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){b.fn.resetForm&&b(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var d=0,c;for(c in a)d++;return d},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{b(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var a=this.lastActive;return a&&b.grep(this.errorList,function(d){return d.element.name==a.name}).length==1&&a},elements:function(){var a=this,d={};return b([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&
a.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in d||!a.objectLength(b(this).rules()))return false;return d[this.name]=true})},clean:function(a){return b(a)[0]},errors:function(){return b(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=b([]);this.toHide=b([]);this.currentElements=b([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},
prepareElement:function(a){this.reset();this.toHide=this.errorsFor(a)},check:function(a){a=this.clean(a);if(this.checkable(a))a=this.findByName(a.name)[0];var d=b(a).rules(),c=false;for(method in d){var h={method:method,parameters:d[method]};try{var j=b.validator.methods[method].call(this,a.value.replace(/\r/g,""),a,h.parameters);if(j=="dependency-mismatch")c=true;else{c=false;if(j=="pending"){this.toHide=this.toHide.not(this.errorsFor(a));return}if(!j){this.formatAndAdd(a,h);return false}}}catch(i){this.settings.debug&&
window.console&&console.log("exception occured when checking element "+a.id+", check the '"+h.method+"' method",i);throw i;}}if(!c){this.objectLength(d)&&this.successList.push(a);return true}},customMetaMessage:function(a,d){if(b.metadata){var c=this.settings.meta?b(a).metadata()[this.settings.meta]:b(a).metadata();return c&&c.messages&&c.messages[d]}},customMessage:function(a,d){var c=this.settings.messages[a];return c&&(c.constructor==String?c:c[d])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==
undefined)return arguments[a]},defaultMessage:function(a,d){return this.findDefined(this.customMessage(a.name,d),this.customMetaMessage(a,d),!this.settings.ignoreTitle&&a.title||undefined,b.validator.messages[d],"<strong>Warning: No message defined for "+a.name+"</strong>")},formatAndAdd:function(a,d){var c=this.defaultMessage(a,d.method),h=/\$?\{(\d+)\}/g;if(typeof c=="function")c=c.call(this,d.parameters,a);else if(h.test(c))c=jQuery.format(c.replace(h,"{$1}"),d.parameters);this.errorList.push({message:c,
element:a});this.errorMap[a.name]=c;this.submitted[a.name]=c},addWrapper:function(a){if(this.settings.wrapper)a=a.add(a.parent(this.settings.wrapper));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var d=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,d.element,this.settings.errorClass,this.settings.validClass);this.showLabel(d.element,d.message)}if(this.errorList.length)this.toShow=this.toShow.add(this.containers);if(this.settings.success)for(a=
0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight){a=0;for(d=this.validElements();d[a];a++)this.settings.unhighlight.call(this,d[a],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 b(this.errorList).map(function(){return this.element})},showLabel:function(a,
d){var c=this.errorsFor(a);if(c.length){c.removeClass().addClass(this.settings.errorClass);c.attr("generated")&&c.html(d)}else{c=b("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(a),generated:true}).addClass(this.settings.errorClass).html(d||"");if(this.settings.wrapper)c=c.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();this.labelContainer.append(c).length||(this.settings.errorPlacement?this.settings.errorPlacement(c,b(a)):c.insertAfter(a))}if(!d&&this.settings.success){c.text("");
typeof this.settings.success=="string"?c.addClass(this.settings.success):this.settings.success(c)}this.toShow=this.toShow.add(c)},errorsFor:function(a){var d=this.idOrName(a);return this.errors().filter(function(){return b(this).attr("for")==d})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(a){var d=this.currentForm;return b(document.getElementsByName(a)).map(function(c,h){return h.form==
d&&h.name==a&&h||null})},getLength:function(a,d){switch(d.nodeName.toLowerCase()){case "select":return b("option:selected",d).length;case "input":if(this.checkable(d))return this.findByName(d.name).filter(":checked").length}return a.length},depend:function(a,d){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,d):true},dependTypes:{"boolean":function(a){return a},string:function(a,d){return!!b(a,d.form).length},"function":function(a,d){return a(d)}},optional:function(a){return!b.validator.methods.required.call(this,
b.trim(a.value),a)&&"dependency-mismatch"},startRequest:function(a){if(!this.pending[a.name]){this.pendingRequest++;this.pending[a.name]=true}},stopRequest:function(a,d){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[a.name];if(d&&this.pendingRequest==0&&this.formSubmitted&&this.form()){b(this.currentForm).submit();this.formSubmitted=false}else if(!d&&this.pendingRequest==0&&this.formSubmitted){b(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=
false}},previousValue:function(a){return b.data(a,"previousValue")||b.data(a,"previousValue",{old:null,valid:true,message:this.defaultMessage(a,"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(a,d){a.constructor==String?this.classRuleSettings[a]=d:b.extend(this.classRuleSettings,
a)},classRules:function(a){var d={};(a=b(a).attr("class"))&&b.each(a.split(" "),function(){this in b.validator.classRuleSettings&&b.extend(d,b.validator.classRuleSettings[this])});return d},attributeRules:function(a){var d={};a=b(a);for(method in b.validator.methods){var c=a.attr(method);if(c)d[method]=c}d.maxlength&&/-1|2147483647|524288/.test(d.maxlength)&&delete d.maxlength;return d},metadataRules:function(a){if(!b.metadata)return{};var d=b.data(a.form,"validator").settings.meta;return d?b(a).metadata()[d]:
b(a).metadata()},staticRules:function(a){var d={},c=b.data(a.form,"validator");if(c.settings.rules)d=b.validator.normalizeRule(c.settings.rules[a.name])||{};return d},normalizeRules:function(a,d){b.each(a,function(c,h){if(h===false)delete a[c];else if(h.param||h.depends){var j=true;switch(typeof h.depends){case "string":j=!!b(h.depends,d.form).length;break;case "function":j=h.depends.call(d,d)}if(j)a[c]=h.param!==undefined?h.param:true;else delete a[c]}});b.each(a,function(c,h){a[c]=b.isFunction(h)?
h(d):h});b.each(["minlength","maxlength","min","max"],function(){if(a[this])a[this]=Number(a[this])});b.each(["rangelength","range"],function(){if(a[this])a[this]=[Number(a[this][0]),Number(a[this][1])]});if(b.validator.autoCreateRanges){if(a.min&&a.max){a.range=[a.min,a.max];delete a.min;delete a.max}if(a.minlength&&a.maxlength){a.rangelength=[a.minlength,a.maxlength];delete a.minlength;delete a.maxlength}}a.messages&&delete a.messages;return a},normalizeRule:function(a){if(typeof a=="string"){var d=
{};b.each(a.split(/\s/),function(){d[this]=true});a=d}return a},addMethod:function(a,d,c){b.validator.methods[a]=d;b.validator.messages[a]=c!=undefined?c:b.validator.messages[a];d.length<3&&b.validator.addClassRules(a,b.validator.normalizeRule(a))},methods:{required:function(a,d,c){if(!this.depend(c,d))return"dependency-mismatch";switch(d.nodeName.toLowerCase()){case "select":return(a=b(d).val())&&a.length>0;case "input":if(this.checkable(d))return this.getLength(a,d)>0;default:return b.trim(a).length>
0}},remote:function(a,d,c){if(this.optional(d))return"dependency-mismatch";var h=this.previousValue(d);this.settings.messages[d.name]||(this.settings.messages[d.name]={});h.originalMessage=this.settings.messages[d.name].remote;this.settings.messages[d.name].remote=h.message;c=typeof c=="string"&&{url:c}||c;if(h.old!==a){h.old=a;var j=this;this.startRequest(d);var i={};i[d.name]=a;b.ajax(b.extend(true,{url:c,mode:"abort",port:"validate"+d.name,dataType:"json",data:i,success:function(s){j.settings.messages[d.name].remote=
h.originalMessage;var y=s===true;if(y){var x=j.formSubmitted;j.prepareElement(d);j.formSubmitted=x;j.successList.push(d);j.showErrors()}else{x={};s=h.message=s||j.defaultMessage(d,"remote");x[d.name]=b.isFunction(s)?s(a):s;j.showErrors(x)}h.valid=y;j.stopRequest(d,y)}},c));return"pending"}else if(this.pending[d.name])return"pending";return h.valid},minlength:function(a,d,c){return this.optional(d)||this.getLength(b.trim(a),d)>=c},maxlength:function(a,d,c){return this.optional(d)||this.getLength(b.trim(a),
d)<=c},rangelength:function(a,d,c){a=this.getLength(b.trim(a),d);return this.optional(d)||a>=c[0]&&a<=c[1]},min:function(a,d,c){return this.optional(d)||a>=c},max:function(a,d,c){return this.optional(d)||a<=c},range:function(a,d,c){return this.optional(d)||a>=c[0]&&a<=c[1]},email:function(a,d){return this.optional(d)||/^((([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(a)},
url:function(a,d){return this.optional(d)||/^(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(a)},
date:function(a,d){return this.optional(d)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,d){return this.optional(d)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,d){return this.optional(d)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,d){return this.optional(d)||/^\d+$/.test(a)},creditcard:function(a,d){if(this.optional(d))return"dependency-mismatch";if(/[^0-9-]+/.test(a))return false;var c=0,h=0,j=false;a=a.replace(/\D/g,"");for(var i=a.length-1;i>=
0;i--){h=a.charAt(i);h=parseInt(h,10);if(j)if((h*=2)>9)h-=9;c+=h;j=!j}return c%10==0},accept:function(a,d,c){c=typeof c=="string"?c.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(d)||a.match(RegExp(".("+c+")$","i"))},equalTo:function(a,d,c){c=b(c).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){b(d).valid()});return a==c.val()}}});b.format=b.validator.format})(jQuery);
(function(b){var a=b.ajax,d={};b.ajax=function(c){c=b.extend(c,b.extend({},b.ajaxSettings,c));var h=c.port;if(c.mode=="abort"){d[h]&&d[h].abort();return d[h]=a.apply(this,arguments)}return a.apply(this,arguments)}})(jQuery);
(function(b){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&b.each({focus:"focusin",blur:"focusout"},function(a,d){function c(h){h=b.event.fix(h);h.type=d;return b.event.handle.call(this,h)}b.event.special[d]={setup:function(){this.addEventListener(a,c,true)},teardown:function(){this.removeEventListener(a,c,true)},handler:function(h){arguments[0]=b.event.fix(h);arguments[0].type=d;return b.event.handle.apply(this,arguments)}}});b.extend(b.fn,{validateDelegate:function(a,
d,c){return this.bind(d,function(h){var j=b(h.target);if(j.is(a))return c.apply(j,arguments)})}})})(jQuery);
(function(b,a){function d(o,w){o=o?' id="'+v+o+'"':"";w=w?' style="'+w+'"':"";return b("<div"+o+w+"/>")}function c(o,w){w=w==="x"?I.width():I.height();return typeof o==="string"?Math.round(/%/.test(o)?w/100*parseInt(o,10):parseInt(o,10)):o}function h(o){return l.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(o)}function j(o){for(var w in o)if(b.isFunction(o[w])&&w.substring(0,2)!=="on")o[w]=o[w].call(J);o.rel=o.rel||J.rel||"nofollow";o.href=o.href||b(J).attr("href");o.title=o.title||
J.title;return o}function i(o,w){w&&w.call(J);b.event.trigger(o)}function s(){var o,w=v+"Slideshow_",t="click."+v,E,M;if(l.slideshow&&C[1]){E=function(){da.text(l.slideshowStop).unbind(t).bind(X,function(){if(D<C.length-1||l.loop)o=setTimeout(B.next,l.slideshowSpeed)}).bind(O,function(){clearTimeout(o)}).one(t+" "+R,M);r.removeClass(w+"off").addClass(w+"on");o=setTimeout(B.next,l.slideshowSpeed)};M=function(){clearTimeout(o);da.text(l.slideshowStart).unbind([X,O,R,t].join(" ")).one(t,E);r.removeClass(w+
"on").addClass(w+"off")};l.slideshowAuto?E():M()}}function y(o){if(!ja){J=o;l=j(b.extend({},b.data(J,F)));C=b(J);D=0;if(l.rel!=="nofollow"){C=b("."+ea).filter(function(){return(b.data(this,F).rel||this.rel)===l.rel});D=C.index(J);if(D===-1){C=C.add(J);D=C.length-1}}if(!S){S=ba=true;r.show();if(l.returnFocus)try{J.blur();b(J).one(e,function(){try{this.focus()}catch(t){}})}catch(w){}q.css({opacity:+l.opacity,cursor:l.overlayClose?"pointer":"auto"}).show();l.w=c(l.initialWidth,"x");l.h=c(l.initialHeight,
"y");B.position(0);n&&I.bind("resize."+f+" scroll."+f,function(){q.css({width:I.width(),height:I.height(),top:I.scrollTop(),left:I.scrollLeft()})}).trigger("scroll."+f);i(K,l.onOpen);ka.add(fa).add(ga).add(da).add(ha).hide();la.html(l.close).show()}B.load(true)}}var x={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight: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,returnFocus:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:true,escKey:true,arrowKey:true},F="colorbox",v="cbox",K=v+"_open",O=v+"_load",X=v+"_complete",R=v+"_cleanup",e=v+
"_closed",g=v+"_purge",k=v+"_loaded",m=b.browser.msie&&!b.support.opacity,n=m&&b.browser.version<7,f=v+"_IE6",q,r,A,z,L,N,T,U,C,I,G,u,Q,ha,ka,da,ga,fa,la,Y,Z,V,W,J,D,l,S,ba,ja=false,B,ea=v+"Element";B=b.fn[F]=b[F]=function(o,w){var t=this,E;if(!t[0]&&t.selector)return t;o=o||{};if(w)o.onComplete=w;if(!t[0]||t.selector===undefined){t=b("<a/>");o.open=true}t.each(function(){b.data(this,F,b.extend({},b.data(this,F)||x,o));b(this).addClass(ea)});E=o.open;if(b.isFunction(E))E=E.call(t);E&&y(t[0]);return t};
B.init=function(){I=b(a);r=d().attr({id:F,"class":m?v+"IE":""});q=d("Overlay",n?"position:absolute":"").hide();A=d("Wrapper");z=d("Content").append(G=d("LoadedContent","width:0; height:0; overflow:hidden"),Q=d("LoadingOverlay").add(d("LoadingGraphic")),ha=d("Title"),ka=d("Current"),ga=d("Next"),fa=d("Previous"),da=d("Slideshow").bind(K,s),la=d("Close"));A.append(d().append(d("TopLeft"),L=d("TopCenter"),d("TopRight")),d(false,"clear:left").append(N=d("MiddleLeft"),z,T=d("MiddleRight")),d(false,"clear:left").append(d("BottomLeft"),
U=d("BottomCenter"),d("BottomRight"))).children().children().css({"float":"left"});u=d(false,"position:absolute; width:9999px; visibility:hidden; display:none");b("body").prepend(q,r.append(A,u));z.children().hover(function(){b(this).addClass("hover")},function(){b(this).removeClass("hover")}).addClass("hover");Y=L.height()+U.height()+z.outerHeight(true)-z.height();Z=N.width()+T.width()+z.outerWidth(true)-z.width();V=G.outerHeight(true);W=G.outerWidth(true);r.css({"padding-bottom":Y,"padding-right":Z}).hide();
ga.click(B.next);fa.click(B.prev);la.click(B.close);z.children().removeClass("hover");b("."+ea).live("click",function(o){if(!(o.button!==0&&typeof o.button!=="undefined"||o.ctrlKey||o.shiftKey||o.altKey)){o.preventDefault();y(this)}});q.click(function(){l.overlayClose&&B.close()});b(document).bind("keydown",function(o){if(S&&l.escKey&&o.keyCode===27){o.preventDefault();B.close()}if(S&&l.arrowKey&&!ba&&C[1])if(o.keyCode===37&&(D||l.loop)){o.preventDefault();fa.click()}else if(o.keyCode===39&&(D<C.length-
1||l.loop)){o.preventDefault();ga.click()}})};B.remove=function(){r.add(q).remove();b("."+ea).die("click").removeData(F).removeClass(ea)};B.position=function(o,w){function t(P){L[0].style.width=U[0].style.width=z[0].style.width=P.style.width;Q[0].style.height=Q[1].style.height=z[0].style.height=N[0].style.height=T[0].style.height=P.style.height}var E,M=Math.max(document.documentElement.clientHeight-l.h-V-Y,0)/2+I.scrollTop(),H=Math.max(I.width()-l.w-W-Z,0)/2+I.scrollLeft();E=r.width()===l.w+W&&r.height()===
l.h+V?0:o;A[0].style.width=A[0].style.height="9999px";r.dequeue().animate({width:l.w+W,height:l.h+V,top:M,left:H},{duration:E,complete:function(){t(this);ba=false;A[0].style.width=l.w+W+Z+"px";A[0].style.height=l.h+V+Y+"px";w&&w()},step:function(){t(this)}})};B.resize=function(o){if(S){o=o||{};if(o.width)l.w=c(o.width,"x")-W-Z;if(o.innerWidth)l.w=c(o.innerWidth,"x");G.css({width:l.w});if(o.height)l.h=c(o.height,"y")-V-Y;if(o.innerHeight)l.h=c(o.innerHeight,"y");if(!o.innerHeight&&!o.height){o=G.wrapInner("<div style='overflow:auto'></div>").children();
l.h=o.height();o.replaceWith(o.children())}G.css({height:l.h});B.position(l.transition==="none"?0:l.speed)}};B.prep=function(o){function w(M){var H,P,ca,aa,ia=C.length,ma=l.loop;B.position(M,function(){function na(){m&&r[0].style.removeAttribute("filter")}if(S){m&&t&&G.fadeIn(100);G.show();i(k);ha.show().html(l.title);if(ia>1){typeof l.current==="string"&&ka.html(l.current.replace(/\{current\}/,D+1).replace(/\{total\}/,ia)).show();ga[ma||D<ia-1?"show":"hide"]().html(l.next);fa[ma||D?"show":"hide"]().html(l.previous);
H=D?C[D-1]:C[ia-1];ca=D<ia-1?C[D+1]:C[0];l.slideshow&&da.show();if(l.preloading){aa=b.data(ca,F).href||ca.href;P=b.data(H,F).href||H.href;aa=b.isFunction(aa)?aa.call(ca):aa;P=b.isFunction(P)?P.call(H):P;if(h(aa))b("<img/>")[0].src=aa;if(h(P))b("<img/>")[0].src=P}}Q.hide();l.transition==="fade"?r.fadeTo(E,1,function(){na()}):na();I.bind("resize."+v,function(){B.position(0)});i(X,l.onComplete)}})}if(S){var t,E=l.transition==="none"?0:l.speed;I.unbind("resize."+v);G.remove();G=d("LoadedContent").html(o);
G.hide().appendTo(u.show()).css({width:function(){l.w=l.w||G.width();l.w=l.mw&&l.mw<l.w?l.mw:l.w;return l.w}(),overflow:l.scrolling?"auto":"hidden"}).css({height:function(){l.h=l.h||G.height();l.h=l.mh&&l.mh<l.h?l.mh:l.h;return l.h}()}).prependTo(z);u.hide();b("#"+v+"Photo").css({cssFloat:"none",marginLeft:"auto",marginRight:"auto"});n&&b("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(R,function(){this.style.visibility="inherit"});
l.transition==="fade"?r.fadeTo(E,0,function(){w(0)}):w(E)}};B.load=function(o){var w,t,E,M=B.prep;ba=true;J=C[D];o||(l=j(b.extend({},b.data(J,F))));i(g);i(O,l.onLoad);l.h=l.height?c(l.height,"y")-V-Y:l.innerHeight&&c(l.innerHeight,"y");l.w=l.width?c(l.width,"x")-W-Z:l.innerWidth&&c(l.innerWidth,"x");l.mw=l.w;l.mh=l.h;if(l.maxWidth){l.mw=c(l.maxWidth,"x")-W-Z;l.mw=l.w&&l.w<l.mw?l.w:l.mw}if(l.maxHeight){l.mh=c(l.maxHeight,"y")-V-Y;l.mh=l.h&&l.h<l.mh?l.h:l.mh}w=l.href;Q.show();if(l.inline){d().hide().insertBefore(b(w)[0]).one(g,
function(){b(this).replaceWith(G.children())});M(b(w))}else if(l.iframe){r.one(k,function(){var H=b("<iframe frameborder='0' style='width:100%; height:100%; border:0; display:block'/>")[0];H.name=v+ +new Date;H.src=l.href;if(!l.scrolling)H.scrolling="no";if(m)H.allowtransparency="true";b(H).appendTo(G).one(g,function(){H.src="//about:blank"})});M(" ")}else if(l.html)M(l.html);else if(h(w)){t=new Image;t.onload=function(){var H;t.onload=null;t.id=v+"Photo";b(t).css({border:"none",display:"block",cssFloat:"left"});
if(l.scalePhotos){E=function(){t.height-=t.height*H;t.width-=t.width*H};if(l.mw&&t.width>l.mw){H=(t.width-l.mw)/t.width;E()}if(l.mh&&t.height>l.mh){H=(t.height-l.mh)/t.height;E()}}if(l.h)t.style.marginTop=Math.max(l.h-t.height,0)/2+"px";if(C[1]&&(D<C.length-1||l.loop))b(t).css({cursor:"pointer"}).click(B.next);if(m)t.style.msInterpolationMode="bicubic";setTimeout(function(){M(t)},1)};setTimeout(function(){t.src=w},1)}else w&&u.load(w,function(H,P,ca){M(P==="error"?"Request unsuccessful: "+ca.statusText:
b(this).children())})};B.next=function(){if(!ba){D=D<C.length-1?D+1:0;B.load()}};B.prev=function(){if(!ba){D=D?D-1:C.length-1;B.load()}};B.close=function(){if(S&&!ja){ja=true;S=false;i(R,l.onCleanup);I.unbind("."+v+" ."+f);q.fadeTo("fast",0);r.stop().fadeTo("fast",0,function(){i(g);G.remove();r.add(q).css({opacity:1,cursor:"auto"}).hide();setTimeout(function(){ja=false;i(e,l.onClosed)},1)})}};B.element=function(){return b(J)};B.settings=x;b(B.init)})(jQuery,this);
(function(b){function a(e){b.fn.cycle.debug&&d(e)}function d(){window.console&&console.log&&console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function c(e,g,k){var m=b(e).data("cycle.opts"),n=!!e.cyclePause;if(n&&m.paused)m.paused(e,m,g,k);else!n&&m.resumed&&m.resumed(e,m,g,k)}function h(e,g,k){function m(f,q,r){if(!f&&q===true){f=b(r).data("cycle.opts");if(!f){d("options not found, can not resume");return false}if(r.cycleTimeout){clearTimeout(r.cycleTimeout);r.cycleTimeout=0}v(f.elements,
f,1,!f.backwards)}}if(e.cycleStop==undefined)e.cycleStop=0;if(g===undefined||g===null)g={};if(g.constructor==String){switch(g){case "destroy":case "stop":k=b(e).data("cycle.opts");if(!k)return false;e.cycleStop++;e.cycleTimeout&&clearTimeout(e.cycleTimeout);e.cycleTimeout=0;k.elements&&b(k.elements).stop();b(e).removeData("cycle.opts");g=="destroy"&&i(k);return false;case "toggle":e.cyclePause=e.cyclePause===1?0:1;m(e.cyclePause,k,e);c(e);return false;case "pause":e.cyclePause=1;c(e);return false;
case "resume":e.cyclePause=0;m(false,k,e);c(e);return false;case "prev":case "next":k=b(e).data("cycle.opts");if(!k){d('options not found, "prev/next" ignored');return false}b.fn.cycle[g](k);return false;default:g={fx:g}}return g}else if(g.constructor==Number){var n=g;g=b(e).data("cycle.opts");if(!g){d("options not found, can not advance slide");return false}if(n<0||n>=g.elements.length){d("invalid slide index: "+n);return false}g.nextSlide=n;if(e.cycleTimeout){clearTimeout(e.cycleTimeout);e.cycleTimeout=
0}if(typeof k=="string")g.oneTimeFx=k;v(g.elements,g,1,n>=g.currSlide);return false}return g}function j(e,g){if(!b.support.opacity&&g.cleartype&&e.style.filter)try{e.style.removeAttribute("filter")}catch(k){}}function i(e){e.next&&b(e.next).unbind(e.prevNextEvent);e.prev&&b(e.prev).unbind(e.prevNextEvent);if(e.pager||e.pagerAnchorBuilder)b.each(e.pagerAnchors||[],function(){this.unbind().remove()});e.pagerAnchors=null;e.destroy&&e.destroy(e)}function s(e,g,k,m,n){var f=b.extend({},b.fn.cycle.defaults,
m||{},b.metadata?e.metadata():b.meta?e.data():{}),q=b.isFunction(e.data)?e.data(f.metaAttr):null;if(q)f=b.extend(f,q);if(f.autostop)f.countdown=f.autostopCount||k.length;var r=e[0];e.data("cycle.opts",f);f.$cont=e;f.stopCount=r.cycleStop;f.elements=k;f.before=f.before?[f.before]:[];f.after=f.after?[f.after]:[];!b.support.opacity&&f.cleartype&&f.after.push(function(){j(this,f)});f.continuous&&f.after.push(function(){v(k,f,0,!f.backwards)});y(f);!b.support.opacity&&f.cleartype&&!f.cleartypeNoBg&&R(g);
e.css("position")=="static"&&e.css("position","relative");f.width&&e.width(f.width);f.height&&f.height!="auto"&&e.height(f.height);if(f.startingSlide)f.startingSlide=parseInt(f.startingSlide,10);else if(f.backwards)f.startingSlide=k.length-1;if(f.random){f.randomMap=[];for(q=0;q<k.length;q++)f.randomMap.push(q);f.randomMap.sort(function(){return Math.random()-0.5});f.randomIndex=1;f.startingSlide=f.randomMap[1]}else if(f.startingSlide>=k.length)f.startingSlide=0;f.currSlide=f.startingSlide||0;var A=
f.startingSlide;g.css({position:"absolute",top:0,left:0}).hide().each(function(u){u=f.backwards?A?u<=A?k.length+(u-A):A-u:k.length-u:A?u>=A?k.length-(u-A):A-u:k.length-u;b(this).css("z-index",u)});b(k[A]).css("opacity",1).show();j(k[A],f);if(f.fit)if(f.aspect)g.each(function(){var u=b(this),Q=f.aspect===true?u.width()/u.height():f.aspect;if(f.width&&u.width()!=f.width){u.width(f.width);u.height(f.width/Q)}if(f.height&&u.height()<f.height){u.height(f.height);u.width(f.height*Q)}});else{f.width&&g.width(f.width);
f.height&&f.height!="auto"&&g.height(f.height)}if(f.center&&(!f.fit||f.aspect))g.each(function(){var u=b(this);u.css({"margin-left":f.width?(f.width-u.width())/2+"px":0,"margin-top":f.height?(f.height-u.height())/2+"px":0})});f.center&&!f.fit&&!f.slideResize&&g.each(function(){var u=b(this);u.css({"margin-left":f.width?(f.width-u.width())/2+"px":0,"margin-top":f.height?(f.height-u.height())/2+"px":0})});if(f.containerResize&&!e.innerHeight()){for(var z=q=0,L=0;L<k.length;L++){var N=b(k[L]),T=N[0],
U=N.outerWidth(),C=N.outerHeight();U||(U=T.offsetWidth||T.width||N.attr("width"));C||(C=T.offsetHeight||T.height||N.attr("height"));q=U>q?U:q;z=C>z?C:z}q>0&&z>0&&e.css({width:q+"px",height:z+"px"})}var I=false;f.pause&&e.hover(function(){I=true;this.cyclePause++;c(r,true)},function(){I&&this.cyclePause--;c(r,true)});if(x(f)===false)return false;var G=false;m.requeueAttempts=m.requeueAttempts||0;g.each(function(){var u=b(this);this.cycleH=f.fit&&f.height?f.height:u.height()||this.offsetHeight||this.height||
u.attr("height")||0;this.cycleW=f.fit&&f.width?f.width:u.width()||this.offsetWidth||this.width||u.attr("width")||0;if(u.is("img")){u=b.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete;var Q=b.browser.opera&&(this.cycleW==42&&this.cycleH==19||this.cycleW==37&&this.cycleH==17)&&!this.complete,ha=this.cycleH==0&&this.cycleW==0&&!this.complete;if(b.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete||u||Q||ha)if(n.s&&f.requeueOnImageNotLoaded&&++m.requeueAttempts<100){d(m.requeueAttempts,
" - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){b(n.s,n.c).cycle(m)},f.requeueTimeout);G=true;return false}else d("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}return true});if(G)return false;f.cssBefore=f.cssBefore||{};f.cssAfter=f.cssAfter||{};f.cssFirst=f.cssFirst||{};f.animIn=f.animIn||{};f.animOut=f.animOut||{};g.not(":eq("+A+")").css(f.cssBefore);b(g[A]).css(f.cssFirst);if(f.timeout){f.timeout=parseInt(f.timeout,
10);if(f.speed.constructor==String)f.speed=b.fx.speeds[f.speed]||parseInt(f.speed,10);f.sync||(f.speed/=2);for(q=f.fx=="none"?0:f.fx=="shuffle"?500:250;f.timeout-f.speed<q;)f.timeout+=f.speed}if(f.easing)f.easeIn=f.easeOut=f.easing;if(!f.speedIn)f.speedIn=f.speed;if(!f.speedOut)f.speedOut=f.speed;f.slideCount=k.length;f.currSlide=f.lastSlide=A;if(f.random){if(++f.randomIndex==k.length)f.randomIndex=0;f.nextSlide=f.randomMap[f.randomIndex]}else f.nextSlide=f.backwards?f.startingSlide==0?k.length-1:
f.startingSlide-1:f.startingSlide>=k.length-1?0:f.startingSlide+1;if(!f.multiFx){q=b.fn.cycle.transitions[f.fx];if(b.isFunction(q))q(e,g,f);else if(f.fx!="custom"&&!f.multiFx){d("unknown transition: "+f.fx,"; slideshow terminating");return false}}e=g[A];if(!f.skipInitializationCallbacks){f.before.length&&f.before[0].apply(e,[e,e,f,true]);f.after.length&&f.after[0].apply(e,[e,e,f,true])}f.next&&b(f.next).bind(f.prevNextEvent,function(){return O(f,1)});f.prev&&b(f.prev).bind(f.prevNextEvent,function(){return O(f,
0)});if(f.pager||f.pagerAnchorBuilder)X(k,f);F(f,k);return f}function y(e){e.original={before:[],after:[]};e.original.cssBefore=b.extend({},e.cssBefore);e.original.cssAfter=b.extend({},e.cssAfter);e.original.animIn=b.extend({},e.animIn);e.original.animOut=b.extend({},e.animOut);b.each(e.before,function(){e.original.before.push(this)});b.each(e.after,function(){e.original.after.push(this)})}function x(e){var g,k,m=b.fn.cycle.transitions;if(e.fx.indexOf(",")>0){e.multiFx=true;e.fxs=e.fx.replace(/\s*/g,
"").split(",");for(g=0;g<e.fxs.length;g++){var n=e.fxs[g];k=m[n];if(!k||!m.hasOwnProperty(n)||!b.isFunction(k)){d("discarding unknown transition: ",n);e.fxs.splice(g,1);g--}}if(!e.fxs.length){d("No valid transitions named; slideshow terminating.");return false}}else if(e.fx=="all"){e.multiFx=true;e.fxs=[];for(p in m){k=m[p];m.hasOwnProperty(p)&&b.isFunction(k)&&e.fxs.push(p)}}if(e.multiFx&&e.randomizeEffects){k=Math.floor(Math.random()*20)+30;for(g=0;g<k;g++)e.fxs.push(e.fxs.splice(Math.floor(Math.random()*
e.fxs.length),1)[0]);a("randomized fx sequence: ",e.fxs)}return true}function F(e,g){e.addSlide=function(k,m){var n=b(k),f=n[0];e.autostopCount||e.countdown++;g[m?"unshift":"push"](f);if(e.els)e.els[m?"unshift":"push"](f);e.slideCount=g.length;n.css("position","absolute");n[m?"prependTo":"appendTo"](e.$cont);if(m){e.currSlide++;e.nextSlide++}!b.support.opacity&&e.cleartype&&!e.cleartypeNoBg&&R(n);e.fit&&e.width&&n.width(e.width);e.fit&&e.height&&e.height!="auto"&&n.height(e.height);f.cycleH=e.fit&&
e.height?e.height:n.height();f.cycleW=e.fit&&e.width?e.width:n.width();n.css(e.cssBefore);if(e.pager||e.pagerAnchorBuilder)b.fn.cycle.createPagerAnchor(g.length-1,f,b(e.pager),g,e);b.isFunction(e.onAddSlide)?e.onAddSlide(n):n.hide()}}function v(e,g,k,m){if(k&&g.busy&&g.manualTrump){a("manualTrump in go(), stopping active transition");b(e).stop(true,true);g.busy=0}if(g.busy)a("transition active, ignoring new tx request");else{var n=g.$cont[0],f=e[g.currSlide],q=e[g.nextSlide];if(!(n.cycleStop!=g.stopCount||
n.cycleTimeout===0&&!k))if(!k&&!n.cyclePause&&!g.bounce&&(g.autostop&&--g.countdown<=0||g.nowrap&&!g.random&&g.nextSlide<g.currSlide))g.end&&g.end(g);else{var r=false;if((k||!n.cyclePause)&&g.nextSlide!=g.currSlide){r=true;var A=g.fx;f.cycleH=f.cycleH||b(f).height();f.cycleW=f.cycleW||b(f).width();q.cycleH=q.cycleH||b(q).height();q.cycleW=q.cycleW||b(q).width();if(g.multiFx){if(m&&(g.lastFx==undefined||++g.lastFx>=g.fxs.length))g.lastFx=0;else if(!m&&(g.lastFx==undefined||--g.lastFx<0))g.lastFx=g.fxs.length-
1;A=g.fxs[g.lastFx]}if(g.oneTimeFx){A=g.oneTimeFx;g.oneTimeFx=null}b.fn.cycle.resetState(g,A);g.before.length&&b.each(g.before,function(L,N){n.cycleStop==g.stopCount&&N.apply(q,[f,q,g,m])});var z=function(){g.busy=0;b.each(g.after,function(L,N){n.cycleStop==g.stopCount&&N.apply(q,[f,q,g,m])})};a("tx firing("+A+"); currSlide: "+g.currSlide+"; nextSlide: "+g.nextSlide);g.busy=1;if(g.fxFn)g.fxFn(f,q,g,z,m,k&&g.fastOnEvent);else b.isFunction(b.fn.cycle[g.fx])?b.fn.cycle[g.fx](f,q,g,z,m,k&&g.fastOnEvent):
b.fn.cycle.custom(f,q,g,z,m,k&&g.fastOnEvent)}if(r||g.nextSlide==g.currSlide){g.lastSlide=g.currSlide;if(g.random){g.currSlide=g.nextSlide;if(++g.randomIndex==e.length)g.randomIndex=0;g.nextSlide=g.randomMap[g.randomIndex];if(g.nextSlide==g.currSlide)g.nextSlide=g.currSlide==g.slideCount-1?0:g.currSlide+1}else if(g.backwards)if((k=g.nextSlide-1<0)&&g.bounce){g.backwards=!g.backwards;g.nextSlide=1;g.currSlide=0}else{g.nextSlide=k?e.length-1:g.nextSlide-1;g.currSlide=k?0:g.nextSlide+1}else if((k=g.nextSlide+
1==e.length)&&g.bounce){g.backwards=!g.backwards;g.nextSlide=e.length-2;g.currSlide=e.length-1}else{g.nextSlide=k?0:g.nextSlide+1;g.currSlide=k?e.length-1:g.nextSlide-1}}r&&g.pager&&g.updateActivePagerLink(g.pager,g.currSlide,g.activePagerClass);r=0;if(g.timeout&&!g.continuous)r=K(e[g.currSlide],e[g.nextSlide],g,m);else if(g.continuous&&n.cyclePause)r=10;if(r>0)n.cycleTimeout=setTimeout(function(){v(e,g,0,!g.backwards)},r)}}}function K(e,g,k,m){if(k.timeoutFn){for(e=k.timeoutFn.call(e,e,g,k,m);k.fx!=
"none"&&e-k.speed<250;)e+=k.speed;a("calculated timeout: "+e+"; speed: "+k.speed);if(e!==false)return e}return k.timeout}function O(e,g){var k=g?1:-1,m=e.elements,n=e.$cont[0],f=n.cycleTimeout;if(f){clearTimeout(f);n.cycleTimeout=0}if(e.random&&k<0){e.randomIndex--;if(--e.randomIndex==-2)e.randomIndex=m.length-2;else if(e.randomIndex==-1)e.randomIndex=m.length-1;e.nextSlide=e.randomMap[e.randomIndex]}else if(e.random)e.nextSlide=e.randomMap[e.randomIndex];else{e.nextSlide=e.currSlide+k;if(e.nextSlide<
0){if(e.nowrap)return false;e.nextSlide=m.length-1}else if(e.nextSlide>=m.length){if(e.nowrap)return false;e.nextSlide=0}}n=e.onPrevNextEvent||e.prevNextClick;b.isFunction(n)&&n(k>0,e.nextSlide,m[e.nextSlide]);v(m,e,1,g);return false}function X(e,g){var k=b(g.pager);b.each(e,function(m,n){b.fn.cycle.createPagerAnchor(m,n,k,e,g)});g.updateActivePagerLink(g.pager,g.startingSlide,g.activePagerClass)}function R(e){function g(m){m=parseInt(m,10).toString(16);return m.length<2?"0"+m:m}function k(m){for(;m&&
m.nodeName.toLowerCase()!="html";m=m.parentNode){var n=b.css(m,"background-color");if(n&&n.indexOf("rgb")>=0){m=n.match(/\d+/g);return"#"+g(m[0])+g(m[1])+g(m[2])}if(n&&n!="transparent")return n}return"#ffffff"}a("applying clearType background-color hack");e.each(function(){b(this).css("background-color",k(this))})}if(b.support==undefined)b.support={opacity:!b.browser.msie};b.expr[":"].paused=function(e){return e.cyclePause};b.fn.cycle=function(e,g){var k={s:this.selector,c:this.context};if(this.length===
0&&e!="stop"){if(!b.isReady&&k.s){d("DOM not ready, queuing slideshow");b(function(){b(k.s,k.c).cycle(e,g)});return this}d("terminating; zero elements found by selector"+(b.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var m=h(this,e,g);if(m!==false){m.updateActivePagerLink=m.updateActivePagerLink||b.fn.cycle.updateActivePagerLink;this.cycleTimeout&&clearTimeout(this.cycleTimeout);this.cycleTimeout=this.cyclePause=0;var n=b(this),f=m.slideExpr?b(m.slideExpr,this):n.children(),
q=f.get(),r=s(n,f,q,m,k);if(r!==false)if(q.length<2)d("terminating; too few slides: "+q.length);else if(n=r.continuous?10:K(q[r.currSlide],q[r.nextSlide],r,!r.backwards)){n+=r.delay||0;if(n<10)n=10;a("first timeout: "+n);this.cycleTimeout=setTimeout(function(){v(q,r,0,!m.backwards)},n)}}})};b.fn.cycle.resetState=function(e,g){g=g||e.fx;e.before=[];e.after=[];e.cssBefore=b.extend({},e.original.cssBefore);e.cssAfter=b.extend({},e.original.cssAfter);e.animIn=b.extend({},e.original.animIn);e.animOut=
b.extend({},e.original.animOut);e.fxFn=null;b.each(e.original.before,function(){e.before.push(this)});b.each(e.original.after,function(){e.after.push(this)});var k=b.fn.cycle.transitions[g];b.isFunction(k)&&k(e.$cont,b(e.elements),e)};b.fn.cycle.updateActivePagerLink=function(e,g,k){b(e).each(function(){b(this).children().removeClass(k).eq(g).addClass(k)})};b.fn.cycle.next=function(e){O(e,1)};b.fn.cycle.prev=function(e){O(e,0)};b.fn.cycle.createPagerAnchor=function(e,g,k,m,n){if(b.isFunction(n.pagerAnchorBuilder)){g=
n.pagerAnchorBuilder(e,g);a("pagerAnchorBuilder("+e+", el) returned: "+g)}else g='<a href="#">'+(e+1)+"</a>";if(g){var f=b(g);if(f.parents("body").length===0){var q=[];if(k.length>1){k.each(function(){var z=f.clone(true);b(this).append(z);q.push(z[0])});f=b(q)}else f.appendTo(k)}n.pagerAnchors=n.pagerAnchors||[];n.pagerAnchors.push(f);k=function(z){z.preventDefault();n.nextSlide=e;z=n.$cont[0];var L=z.cycleTimeout;if(L){clearTimeout(L);z.cycleTimeout=0}z=n.onPagerEvent||n.pagerClick;b.isFunction(z)&&
z(n.nextSlide,m[n.nextSlide]);v(m,n,1,n.currSlide<e)};/mouseenter|mouseover/i.test(n.pagerEvent)?f.hover(k,function(){}):f.bind(n.pagerEvent,k);!/^click/.test(n.pagerEvent)&&!n.allowPagerClickBubble&&f.bind("click.cycle",function(){return false});var r=n.$cont[0],A=false;n.pauseOnPagerHover&&f.hover(function(){A=true;r.cyclePause++;c(r,true,true)},function(){A&&r.cyclePause--;c(r,true,true)})}};b.fn.cycle.hopsFromLast=function(e,g){var k=e.lastSlide,m=e.currSlide;return g?m>k?m-k:e.slideCount-k:m<
k?k-m:k+e.slideCount-m};b.fn.cycle.commonReset=function(e,g,k,m,n,f){b(k.elements).not(e).hide();if(typeof k.cssBefore.opacity=="undefined")k.cssBefore.opacity=1;k.cssBefore.display="block";if(k.slideResize&&m!==false&&g.cycleW>0)k.cssBefore.width=g.cycleW;if(k.slideResize&&n!==false&&g.cycleH>0)k.cssBefore.height=g.cycleH;k.cssAfter=k.cssAfter||{};k.cssAfter.display="none";b(e).css("zIndex",k.slideCount+(f===true?1:0));b(g).css("zIndex",k.slideCount+(f===true?0:1))};b.fn.cycle.custom=function(e,
g,k,m,n,f){var q=b(e),r=b(g),A=k.speedIn;e=k.speedOut;var z=k.easeIn;g=k.easeOut;r.css(k.cssBefore);if(f){A=typeof f=="number"?e=f:e=1;z=g=null}var L=function(){r.animate(k.animIn,A,z,function(){m()})};q.animate(k.animOut,e,g,function(){q.css(k.cssAfter);k.sync||L()});k.sync&&L()};b.fn.cycle.transitions={fade:function(e,g,k){g.not(":eq("+k.currSlide+")").css("opacity",0);k.before.push(function(m,n,f){b.fn.cycle.commonReset(m,n,f);f.cssBefore.opacity=0});k.animIn={opacity:1};k.animOut={opacity:0};
k.cssBefore={top:0,left:0}}};b.fn.cycle.ver=function(){return"2.9995"};b.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:false,animIn:null,animOut:null,aspect:false,autostop:0,autostopCount:0,backwards:false,before:null,center:null,cleartype:!b.support.opacity,cleartypeNoBg:false,containerResize:1,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:true,
metaAttr:"cycle",next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:true,requeueTimeout:250,rev:0,shuffle:null,skipInitializationCallbacks:false,slideExpr:null,slideResize:1,speed:1E3,speedIn:null,speedOut:null,startingSlide:0,sync:1,timeout:4E3,timeoutFn:null,updateActivePagerLink:null,width:null}})(jQuery);
(function(b){b.fn.cycle.transitions.none=function(a,d,c){c.fxFn=function(h,j,i,s){b(j).show();b(h).hide();s()}};b.fn.cycle.transitions.fadeout=function(a,d,c){d.not(":eq("+c.currSlide+")").css({display:"block",opacity:1});c.before.push(function(h,j,i,s,y,x){b(h).css("zIndex",i.slideCount+(!x===true?1:0));b(j).css("zIndex",i.slideCount+(!x===true?0:1))});c.animIn.opacity=1;c.animOut.opacity=0;c.cssBefore.opacity=1;c.cssBefore.display="block";c.cssAfter.zIndex=0};b.fn.cycle.transitions.scrollUp=function(a,
d,c){a.css("overflow","hidden");c.before.push(b.fn.cycle.commonReset);a=a.height();c.cssBefore.top=a;c.cssBefore.left=0;c.cssFirst.top=0;c.animIn.top=0;c.animOut.top=-a};b.fn.cycle.transitions.scrollDown=function(a,d,c){a.css("overflow","hidden");c.before.push(b.fn.cycle.commonReset);a=a.height();c.cssFirst.top=0;c.cssBefore.top=-a;c.cssBefore.left=0;c.animIn.top=0;c.animOut.top=a};b.fn.cycle.transitions.scrollLeft=function(a,d,c){a.css("overflow","hidden");c.before.push(b.fn.cycle.commonReset);a=
a.width();c.cssFirst.left=0;c.cssBefore.left=a;c.cssBefore.top=0;c.animIn.left=0;c.animOut.left=0-a};b.fn.cycle.transitions.scrollRight=function(a,d,c){a.css("overflow","hidden");c.before.push(b.fn.cycle.commonReset);a=a.width();c.cssFirst.left=0;c.cssBefore.left=-a;c.cssBefore.top=0;c.animIn.left=0;c.animOut.left=a};b.fn.cycle.transitions.scrollHorz=function(a,d,c){a.css("overflow","hidden").width();c.before.push(function(h,j,i,s){if(i.rev)s=!s;b.fn.cycle.commonReset(h,j,i);i.cssBefore.left=s?j.cycleW-
1:1-j.cycleW;i.animOut.left=s?-h.cycleW:h.cycleW});c.cssFirst.left=0;c.cssBefore.top=0;c.animIn.left=0;c.animOut.top=0};b.fn.cycle.transitions.scrollVert=function(a,d,c){a.css("overflow","hidden");c.before.push(function(h,j,i,s){if(i.rev)s=!s;b.fn.cycle.commonReset(h,j,i);i.cssBefore.top=s?1-j.cycleH:j.cycleH-1;i.animOut.top=s?h.cycleH:-h.cycleH});c.cssFirst.top=0;c.cssBefore.left=0;c.animIn.top=0;c.animOut.left=0};b.fn.cycle.transitions.slideX=function(a,d,c){c.before.push(function(h,j,i){b(i.elements).not(h).hide();
b.fn.cycle.commonReset(h,j,i,false,true);i.animIn.width=j.cycleW});c.cssBefore.left=0;c.cssBefore.top=0;c.cssBefore.width=0;c.animIn.width="show";c.animOut.width=0};b.fn.cycle.transitions.slideY=function(a,d,c){c.before.push(function(h,j,i){b(i.elements).not(h).hide();b.fn.cycle.commonReset(h,j,i,true,false);i.animIn.height=j.cycleH});c.cssBefore.left=0;c.cssBefore.top=0;c.cssBefore.height=0;c.animIn.height="show";c.animOut.height=0};b.fn.cycle.transitions.shuffle=function(a,d,c){a=a.css("overflow",
"visible").width();d.css({left:0,top:0});c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i,true,true,true)});if(!c.speedAdjusted){c.speed/=2;c.speedAdjusted=true}c.random=0;c.shuffle=c.shuffle||{left:-a,top:15};c.els=[];for(a=0;a<d.length;a++)c.els.push(d[a]);for(a=0;a<c.currSlide;a++)c.els.push(c.els.shift());c.fxFn=function(h,j,i,s,y){if(i.rev)y=!y;var x=y?b(h):b(j);b(j).css(i.cssBefore);var F=i.slideCount;x.animate(i.shuffle,i.speedIn,i.easeIn,function(){for(var v=b.fn.cycle.hopsFromLast(i,
y),K=0;K<v;K++)y?i.els.push(i.els.shift()):i.els.unshift(i.els.pop());if(y){v=0;for(K=i.els.length;v<K;v++)b(i.els[v]).css("z-index",K-v+F)}else{v=b(h).css("z-index");x.css("z-index",parseInt(v,10)+1+F)}x.animate({left:0,top:0},i.speedOut,i.easeOut,function(){b(y?this:h).hide();s&&s()})})};b.extend(c.cssBefore,{display:"block",opacity:1,top:0,left:0})};b.fn.cycle.transitions.turnUp=function(a,d,c){c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i,true,false);i.cssBefore.top=j.cycleH;i.animIn.height=
j.cycleH;i.animOut.width=j.cycleW});c.cssFirst.top=0;c.cssBefore.left=0;c.cssBefore.height=0;c.animIn.top=0;c.animOut.height=0};b.fn.cycle.transitions.turnDown=function(a,d,c){c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i,true,false);i.animIn.height=j.cycleH;i.animOut.top=h.cycleH});c.cssFirst.top=0;c.cssBefore.left=0;c.cssBefore.top=0;c.cssBefore.height=0;c.animOut.height=0};b.fn.cycle.transitions.turnLeft=function(a,d,c){c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i,false,
true);i.cssBefore.left=j.cycleW;i.animIn.width=j.cycleW});c.cssBefore.top=0;c.cssBefore.width=0;c.animIn.left=0;c.animOut.width=0};b.fn.cycle.transitions.turnRight=function(a,d,c){c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i,false,true);i.animIn.width=j.cycleW;i.animOut.left=h.cycleW});b.extend(c.cssBefore,{top:0,left:0,width:0});c.animIn.left=0;c.animOut.width=0};b.fn.cycle.transitions.zoom=function(a,d,c){c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i,false,false,true);
i.cssBefore.top=j.cycleH/2;i.cssBefore.left=j.cycleW/2;b.extend(i.animIn,{top:0,left:0,width:j.cycleW,height:j.cycleH});b.extend(i.animOut,{width:0,height:0,top:h.cycleH/2,left:h.cycleW/2})});c.cssFirst.top=0;c.cssFirst.left=0;c.cssBefore.width=0;c.cssBefore.height=0};b.fn.cycle.transitions.fadeZoom=function(a,d,c){c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i,false,false);i.cssBefore.left=j.cycleW/2;i.cssBefore.top=j.cycleH/2;b.extend(i.animIn,{top:0,left:0,width:j.cycleW,height:j.cycleH})});
c.cssBefore.width=0;c.cssBefore.height=0;c.animOut.opacity=0};b.fn.cycle.transitions.blindX=function(a,d,c){a=a.css("overflow","hidden").width();c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i);i.animIn.width=j.cycleW;i.animOut.left=h.cycleW});c.cssBefore.left=a;c.cssBefore.top=0;c.animIn.left=0;c.animOut.left=a};b.fn.cycle.transitions.blindY=function(a,d,c){a=a.css("overflow","hidden").height();c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i);i.animIn.height=j.cycleH;i.animOut.top=
h.cycleH});c.cssBefore.top=a;c.cssBefore.left=0;c.animIn.top=0;c.animOut.top=a};b.fn.cycle.transitions.blindZ=function(a,d,c){d=a.css("overflow","hidden").height();a=a.width();c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i);i.animIn.height=j.cycleH;i.animOut.top=h.cycleH});c.cssBefore.top=d;c.cssBefore.left=a;c.animIn.top=0;c.animIn.left=0;c.animOut.top=d;c.animOut.left=a};b.fn.cycle.transitions.growX=function(a,d,c){c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i,false,true);
i.cssBefore.left=this.cycleW/2;i.animIn.left=0;i.animIn.width=this.cycleW;i.animOut.left=0});c.cssBefore.top=0;c.cssBefore.width=0};b.fn.cycle.transitions.growY=function(a,d,c){c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i,true,false);i.cssBefore.top=this.cycleH/2;i.animIn.top=0;i.animIn.height=this.cycleH;i.animOut.top=0});c.cssBefore.height=0;c.cssBefore.left=0};b.fn.cycle.transitions.curtainX=function(a,d,c){c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i,false,true,true);
i.cssBefore.left=j.cycleW/2;i.animIn.left=0;i.animIn.width=this.cycleW;i.animOut.left=h.cycleW/2;i.animOut.width=0});c.cssBefore.top=0;c.cssBefore.width=0};b.fn.cycle.transitions.curtainY=function(a,d,c){c.before.push(function(h,j,i){b.fn.cycle.commonReset(h,j,i,true,false,true);i.cssBefore.top=j.cycleH/2;i.animIn.top=0;i.animIn.height=j.cycleH;i.animOut.top=h.cycleH/2;i.animOut.height=0});c.cssBefore.height=0;c.cssBefore.left=0};b.fn.cycle.transitions.cover=function(a,d,c){var h=c.direction||"left",
j=a.css("overflow","hidden").width(),i=a.height();c.before.push(function(s,y,x){b.fn.cycle.commonReset(s,y,x);if(h=="right")x.cssBefore.left=-j;else if(h=="up")x.cssBefore.top=i;else if(h=="down")x.cssBefore.top=-i;else x.cssBefore.left=j});c.animIn.left=0;c.animIn.top=0;c.cssBefore.top=0;c.cssBefore.left=0};b.fn.cycle.transitions.uncover=function(a,d,c){var h=c.direction||"left",j=a.css("overflow","hidden").width(),i=a.height();c.before.push(function(s,y,x){b.fn.cycle.commonReset(s,y,x,true,true,
true);if(h=="right")x.animOut.left=j;else if(h=="up")x.animOut.top=-i;else if(h=="down")x.animOut.top=i;else x.animOut.left=-j});c.animIn.left=0;c.animIn.top=0;c.cssBefore.top=0;c.cssBefore.left=0};b.fn.cycle.transitions.toss=function(a,d,c){var h=a.css("overflow","visible").width(),j=a.height();c.before.push(function(i,s,y){b.fn.cycle.commonReset(i,s,y,true,true,true);if(!y.animOut.left&&!y.animOut.top)b.extend(y.animOut,{left:h*2,top:-j/2,opacity:0});else y.animOut.opacity=0});c.cssBefore.left=
0;c.cssBefore.top=0;c.animIn.left=0};b.fn.cycle.transitions.wipe=function(a,d,c){var h=a.css("overflow","hidden").width(),j=a.height();c.cssBefore=c.cssBefore||{};var i;if(c.clip)if(/l2r/.test(c.clip))i="rect(0px 0px "+j+"px 0px)";else if(/r2l/.test(c.clip))i="rect(0px "+h+"px "+j+"px "+h+"px)";else if(/t2b/.test(c.clip))i="rect(0px "+h+"px 0px 0px)";else if(/b2t/.test(c.clip))i="rect("+j+"px "+h+"px "+j+"px 0px)";else if(/zoom/.test(c.clip)){a=parseInt(j/2,10);d=parseInt(h/2,10);i="rect("+a+"px "+
d+"px "+a+"px "+d+"px)"}c.cssBefore.clip=c.cssBefore.clip||i||"rect(0px 0px 0px 0px)";a=c.cssBefore.clip.match(/(\d+)/g);var s=parseInt(a[0],10),y=parseInt(a[1],10),x=parseInt(a[2],10),F=parseInt(a[3],10);c.before.push(function(v,K,O){if(v!=K){var X=b(v),R=b(K);b.fn.cycle.commonReset(v,K,O,true,true,false);O.cssAfter.display="block";var e=1,g=parseInt(O.speedIn/13,10)-1;(function k(){var m=s?s-parseInt(e*(s/g),10):0,n=F?F-parseInt(e*(F/g),10):0,f=x<j?x+parseInt(e*((j-x)/g||1),10):j,q=y<h?y+parseInt(e*
((h-y)/g||1),10):h;R.css({clip:"rect("+m+"px "+q+"px "+f+"px "+n+"px)"});e++<=g?setTimeout(k,13):X.css("display","none")})()}});b.extend(c.cssBefore,{display:"block",opacity:1,top:0,left:0});c.animIn={left:0};c.animOut={left:0}}})(jQuery);
(function(b,a){var d=function(c){return new d.prototype.init(c)};d.prototype={q:{},apiEndPoint:"/hifi/api",about:"HiFi API Version 1.0",init:function(c){this.q=$.extend(true,{},c);return this},setup:function(c){$.extend(true,d.prototype,c);return this},query:function(){return this.q},find:function(c){this.q=$.extend(true,this.q,c);return this},children:function(c){this.q=$.extend({parent:this.q},c);return this},orderBy:function(c){if(c===a)return this.q.orderBy;this.q.orderBy=c;return this},count:function(c){if(c===
a)return this.q.count;this.q.count=c;return this},versions:function(){this.q.fresh=[0,1];this.q.orderBy="-node";return this},request:function(c,h,j){if(j===a)j=this.q;if(h===a)h="GET";j=JSON.stringify(j);var i={},s=this;if(h=="GET")i.q=j;else i.data=j;$.ajax({url:this.apiEndPoint,type:h,data:i,dataType:"json",cache:false,success:function(y){s.s=true;$.isFunction(c)&&c(y.results,y.success)}});return this},each:function(c,h){return this.request(function(j){for(var i=0;i<j.length;i++){var s=j[i];$.isFunction(c)&&
c(s)}$.isFunction(h)&&h(j)})},get:function(c){this.request(c)},remove:function(c){this.update({fresh:0},c)},append:function(c,h){var j=this;return this.each(function(i){c.parent=i.id;j.create(c,h)})},promote:function(){var c=this;return this.each(function(h){c.q={id:h.id,node:h.node,fresh:1};c.update()})},create:function(c,h){$.isArray(c)||(c=[c]);for(var j=0;j<c.length;j++){var i=c[j];if(i.parent===a)throw"A parent is required for a create.";if(i.type===a)throw"A type is required for a create.";
}return this.request(h,"POST",c)},update:function(c,h){if($.isArray(c))this.request(h,"POST",c);else{var j=this;return this.request(function(i){i=$.map(i,function(s){return $.extend({id:s.id},c)});j.request(h,"POST",i)})}},destroy:function(c){this.q.fresh=0;if(this.q.id===a){console.log("An id is required for a destroy");return this}this.request(c,"POST")}};d.prototype.init.prototype=d.prototype;b.hifi=d})(window);
$(function(){$("a[rel=colorbox]").colorbox();$("#gallery").cycle({fx:"scrollHorz",speed:"2000",timeout:0,next:"#portnext",prev:"#portprev",pager:"#nav",pagerAnchorBuilder:function(a){return"#nav li:eq("+a+") a"}});$("#direct").click(function(){$("#nav li:eq(2) a").trigger("click");return false});var b=$("#rotation");b.length&&b.cycle({timeout:6E3,pagerAnchorBuilder:function(a){return"<a href='#'>"+(a+1)+"</a>"}});b=$("#brands");b.length&&b.cycle({fx:"scrollHorz",timeout:0,pagerAnchorBuilder:function(a){return"<a href='#'>"+
(a+1)+"</a>"},next:"#next",prev:"#prev"});$(".generated-form, #comment-form").validate()});

