(function(a){a.fn.sDrop=function(){return this.each(function(){a(this).find("li.doit").mouseover(function(){a(this).addClass("hover")});a(this).find("li.doit").mouseout(function(){a(this).removeClass("hover")})})}})(jQuery);
(function(c){c.extend(c.fn,{validate:function(a){if(this.length){var b=c.data(this[0],"validator");if(b)return b;b=new c.validator(a,this[0]);c.data(this[0],"validator",b);b.settings.onsubmit&&(this.find("input, button").filter(".cancel").click(function(){b.cancelSubmit=!0}),b.settings.submitHandler&&this.find("input, button").filter(":submit").click(function(){b.submitButton=this}),this.submit(function(a){function e(){if(b.settings.submitHandler){if(b.submitButton)var a=c("<input type='hidden'/>").attr("name",
b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm);b.settings.submitHandler.call(b,b.currentForm);b.submitButton&&a.remove();return!1}return!0}b.settings.debug&&a.preventDefault();if(b.cancelSubmit)return b.cancelSubmit=!1,e();if(b.form()){if(b.pendingRequest)return b.formSubmitted=!0,!1;return e()}else return b.focusInvalid(),!1}));return b}else a&&a.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")},valid:function(){if(c(this[0]).is("form"))return this.validate().form();
else{var a=!0,b=c(this[0].form).validate();this.each(function(){a&=b.element(this)});return a}},removeAttrs:function(a){var b={},d=this;c.each(a.split(/\s/),function(a,c){b[c]=d.attr(c);d.removeAttr(c)});return b},rules:function(a,b){var d=this[0];if(a){var e=c.data(d.form,"validator").settings,f=e.rules,g=c.validator.staticRules(d);switch(a){case "add":c.extend(g,c.validator.normalizeRule(b));f[d.name]=g;b.messages&&(e.messages[d.name]=c.extend(e.messages[d.name],b.messages));break;case "remove":if(!b)return delete f[d.name],
g;var i={};c.each(b.split(/\s/),function(a,b){i[b]=g[b];delete g[b]});return i}}d=c.validator.normalizeRules(c.extend({},c.validator.metadataRules(d),c.validator.classRules(d),c.validator.attributeRules(d),c.validator.staticRules(d)),d);if(d.required)e=d.required,delete d.required,d=c.extend({required:e},d);return d}});c.extend(c.expr[":"],{blank:function(a){return!c.trim(""+a.value)},filled:function(a){return!!c.trim(""+a.value)},unchecked:function(a){return!a.checked}});c.validator=function(a,b){this.settings=
c.extend(!0,{},c.validator.defaults,a);this.currentForm=b;this.init()};c.validator.format=function(a,b){if(arguments.length==1)return function(){var b=c.makeArray(arguments);b.unshift(a);return c.validator.format.apply(this,b)};arguments.length>2&&b.constructor!=Array&&(b=c.makeArray(arguments).slice(1));b.constructor!=Array&&(b=[b]);c.each(b,function(b,c){a=a.replace(RegExp("\\{"+b+"\\}","g"),c)});return a};c.extend(c.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",
errorElement:"label",focusInvalid:!0,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:!0,ignore:[],ignoreTitle:!1,onfocusin:function(a){this.lastActive=a;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){!this.checkable(a)&&(a.name in this.submitted||!this.optional(a))&&this.element(a)},onkeyup:function(a){(a.name in this.submitted||
a==this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(a,b,d){c(a).addClass(b).removeClass(d)},unhighlight:function(a,b,d){c(a).removeClass(b).addClass(d)}},setDefaults:function(a){c.extend(c.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:c.validator.format("Please enter no more than {0} characters."),minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."),
range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function a(a){var b=c.data(this[0].form,"validator"),a="on"+a.type.replace(/^validate/,"");b.settings[a]&&b.settings[a].call(b,this[0])}this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&
this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=this.groups={};c.each(this.settings.groups,function(a,d){c.each(d.split(/\s/),function(c,d){b[d]=a})});var d=this.settings.rules;c.each(d,function(a,b){d[a]=c.validator.normalizeRule(b)});c(this.currentForm).validateDelegate(":text, :password, :file, select, textarea",
"focusin focusout keyup",a).validateDelegate(":radio, :checkbox, select, option","click",a);this.settings.invalidHandler&&c(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);this.valid()||c(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);
return this.valid()},element:function(a){this.lastElement=a=this.clean(a);this.prepareElement(a);this.currentElements=c(a);var b=this.check(a);b?delete this.invalid[a.name]:this.invalid[a.name]=!0;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return b},showErrors:function(a){if(a){c.extend(this.errorMap,a);this.errorList=[];for(var b in a)this.errorList.push({message:a[b],element:this.findByName(b)[0]});this.successList=c.grep(this.successList,function(b){return!(b.name in
a)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){c.fn.resetForm&&c(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 b=0,c;for(c in a)b++;return b},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{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var a=this.lastActive;return a&&c.grep(this.errorList,function(b){return b.element.name==a.name}).length==1&&a},elements:function(){var a=this,b={};return c([]).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 b||!a.objectLength(c(this).rules()))return!1;return b[this.name]=!0})},clean:function(a){return c(a)[0]},errors:function(){return c(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([]);this.currentElements=c([])},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);this.checkable(a)&&(a=this.findByName(a.name)[0]);var b=c(a).rules(),d=!1;for(method in b){var e={method:method,parameters:b[method]};try{var f=c.validator.methods[method].call(this,a.value.replace(/\r/g,""),a,e.parameters);if(f=="dependency-mismatch")d=!0;else{d=!1;if(f=="pending"){this.toHide=this.toHide.not(this.errorsFor(a));return}if(!f)return this.formatAndAdd(a,e),!1}}catch(g){throw this.settings.debug&&
window.console&&console.log("exception occured when checking element "+a.id+", check the '"+e.method+"' method",g),g;}}if(!d)return this.objectLength(b)&&this.successList.push(a),!0},customMetaMessage:function(a,b){if(c.metadata){var d=this.settings.meta?c(a).metadata()[this.settings.meta]:c(a).metadata();return d&&d.messages&&d.messages[b]}},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor==String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==
void 0)return arguments[a]},defaultMessage:function(a,b){return this.findDefined(this.customMessage(a.name,b),this.customMetaMessage(a,b),!this.settings.ignoreTitle&&a.title||void 0,c.validator.messages[b],"<strong>Warning: No message defined for "+a.name+"</strong>")},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b.method),e=/\$?\{(\d+)\}/g;typeof c=="function"?c=c.call(this,b.parameters,a):e.test(c)&&(c=jQuery.format(c.replace(e,"{$1}"),b.parameters));this.errorList.push({message:c,element:a});
this.errorMap[a.name]=c;this.submitted[a.name]=c},addWrapper:function(a){this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper)));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass);this.showLabel(b.element,b.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(b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[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 c(this.errorList).map(function(){return this.element})},showLabel:function(a,b){var d=this.errorsFor(a);d.length?(d.removeClass().addClass(this.settings.errorClass),
d.attr("generated")&&d.html(b)):(d=c("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(a),generated:!0}).addClass(this.settings.errorClass).html(b||""),this.settings.wrapper&&(d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,c(a)):d.insertAfter(a)));!b&&this.settings.success&&(d.text(""),typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d));
this.toShow=this.toShow.add(d)},errorsFor:function(a){var b=this.idOrName(a);return this.errors().filter(function(){return c(this).attr("for")==b})},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 b=this.currentForm;return c(document.getElementsByName(a)).map(function(c,e){return e.form==b&&e.name==a&&e||null})},getLength:function(a,b){switch(b.nodeName.toLowerCase()){case "select":return c("option:selected",
b).length;case "input":if(this.checkable(b))return this.findByName(b.name).filter(":checked").length}return a.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(a,b){return!!c(a,b.form).length},"function":function(a,b){return a(b)}},optional:function(a){return!c.validator.methods.required.call(this,c.trim(a.value),a)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,
this.pending[a.name]=!0)},stopRequest:function(a,b){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[a.name];if(b&&this.pendingRequest==0&&this.formSubmitted&&this.form())c(this.currentForm).submit(),this.formSubmitted=!1;else if(!b&&this.pendingRequest==0&&this.formSubmitted)c(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1},previousValue:function(a){return c.data(a,"previousValue")||c.data(a,"previousValue",{old:null,valid:!0,
message:this.defaultMessage(a,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},dateDE:{dateDE:!0},number:{number:!0},numberDE:{numberDE:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(a,b){a.constructor==String?this.classRuleSettings[a]=b:c.extend(this.classRuleSettings,a)},classRules:function(a){var b={};(a=c(a).attr("class"))&&c.each(a.split(" "),function(){this in c.validator.classRuleSettings&&c.extend(b,
c.validator.classRuleSettings[this])});return b},attributeRules:function(a){var b={},a=c(a);for(method in c.validator.methods){var d=a.attr(method);d&&(b[method]=d)}b.maxlength&&/-1|2147483647|524288/.test(b.maxlength)&&delete b.maxlength;return b},metadataRules:function(a){if(!c.metadata)return{};var b=c.data(a.form,"validator").settings.meta;return b?c(a).metadata()[b]:c(a).metadata()},staticRules:function(a){var b={},d=c.data(a.form,"validator");d.settings.rules&&(b=c.validator.normalizeRule(d.settings.rules[a.name])||
{});return b},normalizeRules:function(a,b){c.each(a,function(d,e){if(e===!1)delete a[d];else if(e.param||e.depends){var f=!0;switch(typeof e.depends){case "string":f=!!c(e.depends,b.form).length;break;case "function":f=e.depends.call(b,b)}f?a[d]=e.param!==void 0?e.param:!0:delete a[d]}});c.each(a,function(d,e){a[d]=c.isFunction(e)?e(b):e});c.each(["minlength","maxlength","min","max"],function(){a[this]&&(a[this]=Number(a[this]))});c.each(["rangelength","range"],function(){a[this]&&(a[this]=[Number(a[this][0]),
Number(a[this][1])])});if(c.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 b={};c.each(a.split(/\s/),function(){b[this]=!0});a=b}return a},addMethod:function(a,b,d){c.validator.methods[a]=b;c.validator.messages[a]=d!=void 0?d:c.validator.messages[a];b.length<
3&&c.validator.addClassRules(a,c.validator.normalizeRule(a))},methods:{required:function(a,b,d){if(!this.depend(d,b))return"dependency-mismatch";switch(b.nodeName.toLowerCase()){case "select":return(a=c(b).val())&&a.length>0;case "input":if(this.checkable(b))return this.getLength(a,b)>0;default:return c.trim(a).length>0}},remote:function(a,b,d){if(this.optional(b))return"dependency-mismatch";var e=this.previousValue(b);this.settings.messages[b.name]||(this.settings.messages[b.name]={});e.originalMessage=
this.settings.messages[b.name].remote;this.settings.messages[b.name].remote=e.message;d=typeof d=="string"&&{url:d}||d;if(e.old!==a){e.old=a;var f=this;this.startRequest(b);var g={};g[b.name]=a;c.ajax(c.extend(!0,{url:d,mode:"abort",port:"validate"+b.name,dataType:"json",data:g,success:function(d){f.settings.messages[b.name].remote=e.originalMessage;var g=d===!0;if(g){var h=f.formSubmitted;f.prepareElement(b);f.formSubmitted=h;f.successList.push(b);f.showErrors()}else h={},d=e.message=d||f.defaultMessage(b,
"remote"),h[b.name]=c.isFunction(d)?d(a):d,f.showErrors(h);e.valid=g;f.stopRequest(b,g)}},d));return"pending"}else if(this.pending[b.name])return"pending";return e.valid},minlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)>=d},maxlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)<=d},rangelength:function(a,b,d){a=this.getLength(c.trim(a),b);return this.optional(b)||a>=d[0]&&a<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,
b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},email:function(a,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(a)},
url:function(a,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(a)},
date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9-]+/.test(a))return!1;for(var c=0,e=0,f=!1,a=a.replace(/\D/g,""),g=a.length-1;g>=0;g--){e=
a.charAt(g);e=parseInt(e,10);if(f&&(e*=2)>9)e-=9;c+=e;f=!f}return c%10==0},accept:function(a,b,c){c=typeof c=="string"?c.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||a.match(RegExp(".("+c+")$","i"))},equalTo:function(a,b,d){d=c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){c(b).valid()});return a==d.val()}}});c.format=c.validator.format})(jQuery);
(function(c){var a=c.ajax,b={};c.ajax=function(d){var d=c.extend(d,c.extend({},c.ajaxSettings,d)),e=d.port;if(d.mode=="abort")return b[e]&&b[e].abort(),b[e]=a.apply(this,arguments);return a.apply(this,arguments)}})(jQuery);
(function(c){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(a){a=c.event.fix(a);a.type=b;return c.event.handle.call(this,a)}c.event.special[b]={setup:function(){this.addEventListener(a,d,!0)},teardown:function(){this.removeEventListener(a,d,!0)},handler:function(a){arguments[0]=c.event.fix(a);arguments[0].type=b;return c.event.handle.apply(this,arguments)}}});c.extend(c.fn,{validateDelegate:function(a,
b,d){return this.bind(b,function(b){var f=c(b.target);if(f.is(a))return d.apply(f,arguments)})}})})(jQuery);
(function(e){e.fn.hoverIntent=function(l,m){var d={sensitivity:7,interval:100,timeout:0},d=e.extend(d,m?{over:l,out:m}:l),f,h,i,j,k=function(c){f=c.pageX;h=c.pageY},n=function(c,a){a.hoverIntent_t=clearTimeout(a.hoverIntent_t);if(Math.abs(i-f)+Math.abs(j-h)<d.sensitivity)return e(a).unbind("mousemove",k),a.hoverIntent_s=1,d.over.apply(a,[c]);else i=f,j=h,a.hoverIntent_t=setTimeout(function(){n(c,a)},d.interval)},o=function(c){for(var a=(c.type=="mouseover"?c.fromElement:c.toElement)||c.relatedTarget;a&&
a!=this;)try{a=a.parentNode}catch(f){a=this}if(a==this)return!1;var g=jQuery.extend({},c),b=this;if(b.hoverIntent_t)b.hoverIntent_t=clearTimeout(b.hoverIntent_t);if(c.type=="mouseover"){if(i=g.pageX,j=g.pageY,e(b).bind("mousemove",k),b.hoverIntent_s!=1)b.hoverIntent_t=setTimeout(function(){n(g,b)},d.interval)}else if(e(b).unbind("mousemove",k),b.hoverIntent_s==1)b.hoverIntent_t=setTimeout(function(){b.hoverIntent_t=clearTimeout(b.hoverIntent_t);b.hoverIntent_s=0;d.out.apply(b,[g])},d.timeout)};return this.mouseover(o).mouseout(o)}})(jQuery);
(function(a){function g(a,g){var a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),l=RegExp("[\\?&]"+a+"=([^&#]*)").exec(g);return l==null?"":l[1]}a.prettyPhoto={version:"3.0"};a.fn.prettyPhoto=function(i){function s(c){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){a(".pp_loaderIcon").show();c()})}function l(c){set_position==c-1?($pp_pic_holder.find("a.pp_next").css("visibility","hidden"),
$pp_pic_holder.find("a.pp_next").addClass("disabled").unbind("click")):($pp_pic_holder.find("a.pp_next").css("visibility","visible"),$pp_pic_holder.find("a.pp_next.disabled").removeClass("disabled").bind("click",function(){a.prettyPhoto.changePage("next");return!1}));set_position==0?$pp_pic_holder.find("a.pp_previous").css("visibility","hidden").addClass("disabled").unbind("click"):$pp_pic_holder.find("a.pp_previous.disabled").css("visibility","visible").removeClass("disabled").bind("click",function(){a.prettyPhoto.changePage("previous");
return!1});c>1?a(".pp_nav").show():a(".pp_nav").hide()}function f(a,b){resized=!1;t(a,b);imageWidth=a;imageHeight=b;if((j>d||k>e)&&doresize&&settings.allow_resize&&!n){resized=!0;for(fitting=!1;!fitting;)j>d?(imageWidth=d-200,imageHeight=b/a*imageWidth):k>e?(imageHeight=e-200,imageWidth=a/b*imageHeight):fitting=!0,k=imageHeight,j=imageWidth;t(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(k),containerWidth:Math.floor(j)+40,contentHeight:Math.floor(o),
contentWidth:Math.floor(u),resized:resized}}function t(c,b){c=parseFloat(c);b=parseFloat(b);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(c);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().appendTo(a("body")).css({position:"absolute",top:-1E4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;a.browser.msie&&a.browser.version==7&&(detailsHeight+=8);$pp_details.remove();
o=b+detailsHeight;u=c;k=o+$ppt.height()+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();j=c}function p(a){return a.match(/youtube\.com\/watch/i)?"youtube":a.match(/vimeo\.com/i)?"vimeo":a.indexOf(".mov")!=-1?"quicktime":a.indexOf(".swf")!=-1?"flash":a.indexOf("iframe")!=-1?"iframe":a.indexOf("custom")!=-1?"custom":a.substr(0,1)=="#"?"inline":"image"}function m(){doresize&&typeof $pp_pic_holder!="undefined"&&(scroll_pos=v(),titleHeight=$ppt.height(),contentHeight=
$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width(),projectedTop=e/2+scroll_pos.scrollTop-contentHeight/2,$pp_pic_holder.css({top:projectedTop,left:d/2+scroll_pos.scrollLeft-contentwidth/2}))}function v(){if(self.pageYOffset)return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};else if(document.documentElement&&document.documentElement.scrollTop)return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};else if(document.body)return{scrollTop:document.body.scrollTop,
scrollLeft:document.body.scrollLeft}}function w(b){theRel=a(b).attr("rel");galleryRegExp=/\[(?:.*)\]/;pp_images=(isSet=galleryRegExp.exec(theRel)?!0:!1)?jQuery.map(q,function(b){if(a(b).attr("rel").indexOf(theRel)!=-1)return a(b).attr("href")}):a.makeArray(a(b).attr("href"));pp_titles=isSet?jQuery.map(q,function(b){if(a(b).attr("rel").indexOf(theRel)!=-1)return a(b).find("img").attr("alt")?a(b).find("img").attr("alt"):""}):a.makeArray(a(b).find("img").attr("alt"));pp_descriptions=isSet?jQuery.map(q,
function(b){if(a(b).attr("rel").indexOf(theRel)!=-1)return a(b).attr("title")?a(b).attr("title"):""}):a.makeArray(a(b).attr("title"));a("body").append(settings.markup);$pp_pic_holder=a(".pp_pic_holder");$ppt=a(".ppt");$pp_overlay=a("div.pp_overlay");if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(b=0;b<pp_images.length;b++)classname=/(.*?).(jpg|jpeg|png|gif)$/.exec(pp_images[b])?"":"default",toInject+="<li class='"+classname+"'><a href='#'><img src='"+pp_images[b]+"' width='50' alt='' /></a></li>";
toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find("#pp_full_res").after(toInject);$pp_pic_holder.find(".pp_gallery .pp_arrow_next").click(function(){a.prettyPhoto.changeGalleryPage("next");a.prettyPhoto.stopSlideshow();return!1});$pp_pic_holder.find(".pp_gallery .pp_arrow_previous").click(function(){a.prettyPhoto.changeGalleryPage("previous");a.prettyPhoto.stopSlideshow();return!1});$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},
function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()});itemWidth=57;$pp_pic_holder.find(".pp_gallery ul li").each(function(b){a(this).css({position:"absolute",left:b*itemWidth});a(this).find("a").unbind("click").click(function(){a.prettyPhoto.changePage(b);a.prettyPhoto.stopSlideshow();return!1})})}settings.slideshow&&($pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>'),$pp_pic_holder.find(".pp_nav .pp_play").click(function(){a.prettyPhoto.startSlideshow();
return!1}));$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:a(document).height(),width:a(document).width()}).bind("click",function(){settings.modal||a.prettyPhoto.close()});a("a.pp_close").bind("click",function(){a.prettyPhoto.close();return!1});a("a.pp_expand").bind("click",function(){a(this).hasClass("pp_expand")?(a(this).removeClass("pp_expand").addClass("pp_contract"),doresize=!1):(a(this).removeClass("pp_contract").addClass("pp_expand"),doresize=
!0);s(function(){a.prettyPhoto.open()});return!1});$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){a.prettyPhoto.changePage("previous");a.prettyPhoto.stopSlideshow();return!1});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){a.prettyPhoto.changePage("next");a.prettyPhoto.stopSlideshow();return!1});m()}var i=jQuery.extend({animation_speed:"fast",slideshow:!1,autoplay_slideshow:!1,opacity:0.8,show_title:!0,allow_resize:!0,default_width:500,
default_height:344,counter_separator_label:"/",theme:"facebook",hideflash:!1,wmode:"opaque",autoplay:!0,modal:!1,overlay_gallery:!0,keyboard_shortcuts:!0,changepicturecallback:function(){},callback:function(){},markup:'<div class="pp_pic_holder"><div class="ppt">&nbsp;</div><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content_container"><div class="pp_left"><div class="pp_right"><div class="pp_content"><div class="pp_loaderIcon"></div><div class="pp_fade"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details clearfix"><p class="pp_description"></p><a class="pp_close" href="#">Close</a><div class="pp_nav"><a href="#" class="pp_arrow_previous">Previous</a><p class="currentTextHolder">0/0</p><a href="#" class="pp_arrow_next">Next</a></div></div></div></div></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div><div class="pp_overlay"></div>',
gallery_markup:'<div class="pp_gallery"><a href="#" class="pp_arrow_previous">Previous</a><ul>{gallery}</ul><a href="#" class="pp_arrow_next">Next</a></div>',image_markup:'<img id="fullResImage" src="" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
inline_markup:'<div class="pp_inline clearfix">{content}</div>',custom_markup:""},i),q=this,n=!1,b,r,o,u,k,j,e=a(window).height(),d=a(window).width(),h;doresize=!0;scroll_pos=v();a(window).unbind("resize").resize(function(){m();e=a(window).height();d=a(window).width();typeof $pp_overlay!="undefined"&&$pp_overlay.height(a(document).height())});i.keyboard_shortcuts&&a(document).unbind("keydown").keydown(function(b){if(typeof $pp_pic_holder!="undefined"&&$pp_pic_holder.is(":visible")){switch(b.keyCode){case 37:a.prettyPhoto.changePage("previous");
break;case 39:a.prettyPhoto.changePage("next");break;case 27:settings.modal||a.prettyPhoto.close()}return!1}});a.prettyPhoto.initialize=function(){settings=i;if(a.browser.msie&&parseInt(a.browser.version)==6)settings.theme="light_square";w(this);settings.allow_resize&&a(window).scroll(function(){m()});m();set_position=jQuery.inArray(a(this).attr("href"),pp_images);a.prettyPhoto.open();return!1};a.prettyPhoto.open=function(c,d,e){if(typeof settings=="undefined"){settings=i;if(a.browser.msie&&a.browser.version==
6)settings.theme="light_square";w(this);pp_images=a.makeArray(c);pp_titles=d?a.makeArray(d):a.makeArray("");pp_descriptions=e?a.makeArray(e):a.makeArray("");isSet=pp_images.length>1?!0:!1;set_position=0}a.browser.msie&&a.browser.version==6&&a("select").css("visibility","hidden");settings.hideflash&&a("object,embed").css("visibility","hidden");l(a(pp_images).size());a(".pp_loaderIcon").show();$ppt.is(":hidden")&&$ppt.css("opacity",0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);
$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+a(pp_images).size());$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]));settings.show_title&&pp_titles[set_position]!=""?$ppt.html(unescape(pp_titles[set_position])):$ppt.html("&nbsp;");movie_width=parseFloat(g("width",pp_images[set_position]))?g("width",pp_images[set_position]):settings.default_width.toString();movie_height=parseFloat(g("height",pp_images[set_position]))?
g("height",pp_images[set_position]):settings.default_height.toString();movie_width.indexOf("%")!=-1||movie_height.indexOf("%")!=-1?(movie_height=parseFloat(a(window).height()*parseFloat(movie_height)/100-150),movie_width=parseFloat(a(window).width()*parseFloat(movie_width)/100-150),n=!0):n=!1;$pp_pic_holder.fadeIn(function(){imgPreloader="";switch(p(pp_images[set_position])){case "image":imgPreloader=new Image;nextImage=new Image;if(isSet&&set_position>a(pp_images).size())nextImage.src=pp_images[set_position+
1];prevImage=new Image;if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find("#pp_full_res")[0].innerHTML=settings.image_markup;$pp_pic_holder.find("#fullResImage").attr("src",pp_images[set_position]);imgPreloader.onload=function(){b=f(imgPreloader.width,imgPreloader.height);_showContent()};imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist.");a.prettyPhoto.close()};imgPreloader.src=pp_images[set_position];
break;case "youtube":b=f(movie_width,movie_height);movie="https://www.youtube.com/v/"+g("v",pp_images[set_position]);settings.autoplay&&(movie+="&autoplay=1");toInject=settings.flash_markup.replace(/{width}/g,b.width).replace(/{height}/g,b.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case "vimeo":b=f(movie_width,movie_height);movie_id=pp_images[set_position];movie="http://player.vimeo.com/video/"+movie_id.match(/http:\/\/(www\.)?vimeo.com\/(\d+)/)[2]+"?title=0&amp;byline=0&amp;portrait=0";
settings.autoplay&&(movie+="&autoplay=1;");vimeo_width=b.width+"/embed/?moog_width="+b.width;toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,b.height).replace(/{path}/g,movie);break;case "quicktime":b=f(movie_width,movie_height);b.height+=15;b.contentHeight+=15;b.containerHeight+=15;toInject=settings.quicktime_markup.replace(/{width}/g,b.width).replace(/{height}/g,b.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,
settings.autoplay);break;case "flash":b=f(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf("?"));toInject=settings.flash_markup.replace(/{width}/g,b.width).replace(/{height}/g,b.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case "iframe":b=f(movie_width,
movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=settings.iframe_markup.replace(/{width}/g,b.width).replace(/{height}/g,b.height).replace(/{path}/g,frame_url);break;case "custom":b=f(movie_width,movie_height);toInject=settings.custom_markup;break;case "inline":myClone=a(pp_images[set_position]).clone().css({width:settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo(a("body")),
b=f(a(myClone).width(),a(myClone).height()),a(myClone).remove(),toInject=settings.inline_markup.replace(/{content}/g,a(pp_images[set_position]).html())}if(!imgPreloader)$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,_showContent()});return!1};a.prettyPhoto.changePage=function(b){currentGalleryPage=0;if(b=="previous"){if(set_position--,set_position<0){set_position=0;return}}else b=="next"?(set_position++,set_position>a(pp_images).size()-1&&(set_position=0)):set_position=b;doresize||(doresize=
!0);a(".pp_contract").removeClass("pp_contract").addClass("pp_expand");s(function(){a.prettyPhoto.open()})};a.prettyPhoto.changeGalleryPage=function(b){b=="next"?(currentGalleryPage++,currentGalleryPage>totalPage&&(currentGalleryPage=0)):b=="previous"?(currentGalleryPage--,currentGalleryPage<0&&(currentGalleryPage=totalPage)):currentGalleryPage=b;itemsToSlide=currentGalleryPage==totalPage?pp_images.length-totalPage*itemsPerPage:itemsPerPage;$pp_pic_holder.find(".pp_gallery li").each(function(b){a(this).animate({left:b*
itemWidth-itemsToSlide*itemWidth*currentGalleryPage})})};a.prettyPhoto.startSlideshow=function(){typeof h=="undefined"?($pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){a.prettyPhoto.stopSlideshow();return!1}),h=setInterval(a.prettyPhoto.startSlideshow,settings.slideshow)):a.prettyPhoto.changePage("next")};a.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){a.prettyPhoto.startSlideshow();
return!1});clearInterval(h);h=void 0};a.prettyPhoto.close=function(){clearInterval(h);$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");a("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){a(this).remove()});$pp_overlay.fadeOut(settings.animation_speed,function(){a.browser.msie&&a.browser.version==6&&a("select").css("visibility","visible");settings.hideflash&&a("object,embed").css("visibility","visible");a(this).remove();a(window).unbind("scroll");
settings.callback();doresize=!0;r=!1;delete settings})};_showContent=function(){a(".pp_loaderIcon").hide();$ppt.fadeTo(settings.animation_speed,1);projectedTop=scroll_pos.scrollTop+(e/2-b.containerHeight/2);projectedTop<0&&(projectedTop=0);$pp_pic_holder.find(".pp_content").animate({height:b.contentHeight},settings.animation_speed);$pp_pic_holder.animate({top:projectedTop,left:d/2-b.containerWidth/2,width:b.containerWidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(b.height).width(b.width);
$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);isSet&&p(pp_images[set_position])=="image"?$pp_pic_holder.find(".pp_hoverContainer").show():$pp_pic_holder.find(".pp_hoverContainer").hide();b.resized&&a("a.pp_expand,a.pp_contract").fadeIn(settings.animation_speed);settings.autoplay_slideshow&&!h&&!r&&a.prettyPhoto.startSlideshow();settings.changepicturecallback();r=!0});isSet&&settings.overlay_gallery&&p(pp_images[set_position])=="image"?(itemWidth=57,navWidth=settings.theme=="facebook"?
58:38,itemsPerPage=Math.floor((b.containerWidth-100-navWidth)/itemWidth),itemsPerPage=itemsPerPage<pp_images.length?itemsPerPage:pp_images.length,totalPage=Math.ceil(pp_images.length/itemsPerPage)-1,totalPage==0?(navWidth=0,$pp_pic_holder.find(".pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous").hide()):$pp_pic_holder.find(".pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous").show(),galleryWidth=itemsPerPage*itemWidth+navWidth,$pp_pic_holder.find(".pp_gallery").width(galleryWidth).css("margin-left",
-(galleryWidth/2)),$pp_pic_holder.find(".pp_gallery ul").width(itemsPerPage*itemWidth).find("li.selected").removeClass("selected"),goToPage=Math.floor(set_position/itemsPerPage)<=totalPage?Math.floor(set_position/itemsPerPage):totalPage,itemsPerPage?$pp_pic_holder.find(".pp_gallery").hide().show().removeClass("disabled"):$pp_pic_holder.find(".pp_gallery").hide().addClass("disabled"),a.prettyPhoto.changeGalleryPage(goToPage),$pp_pic_holder.find(".pp_gallery ul li:eq("+set_position+")").addClass("selected")):
($pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave"),$pp_pic_holder.find(".pp_gallery").hide())};return this.unbind("click").click(a.prettyPhoto.initialize)}})(jQuery);
(function(b){var j=b.browser.msie&&parseInt(b.browser.version)===6&&typeof window.XMLHttpRequest!=="object",l=b.browser.msie&&parseInt(b.browser.version)===7,k=null,c=[];b.modal=function(a,e){return b.modal.impl.init(a,e)};b.modal.close=function(){b.modal.impl.close()};b.modal.focus=function(a){b.modal.impl.focus(a)};b.modal.setContainerDimensions=function(){b.modal.impl.setContainerDimensions()};b.modal.setPosition=function(){b.modal.impl.setPosition()};b.modal.update=function(a,e){b.modal.impl.update(a,
e)};b.fn.modal=function(a){return b.modal.impl.init(this,a)};b.modal.defaults={appendTo:"body",focus:!0,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:!1,autoPosition:!0,zIndex:1E3,close:!0,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:!0,overlayClose:!1,position:null,persist:!1,modal:!0,
onOpen:null,onShow:null,onClose:null};b.modal.impl={d:{},init:function(a,e){if(this.d.data)return!1;k=b.browser.msie&&!b.boxModel;this.o=b.extend({},b.modal.defaults,e);this.zIndex=this.o.zIndex;this.occb=!1;if(typeof a==="object"){if(a=a instanceof jQuery?a:b(a),this.d.placeholder=!1,a.parent().parent().size()>0&&(a.before(b("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"})),this.d.placeholder=!0,this.display=a.css("display"),!this.o.persist))this.d.orig=a.clone(!0)}else if(typeof a===
"string"||typeof a==="number")a=b("<div></div>").html(a);else return alert("SimpleModal Error: Unsupported data type: "+typeof a),this;this.create(a);this.open();b.isFunction(this.o.onShow)&&this.o.onShow.apply(this,[this.d]);return this},create:function(a){c=this.getDimensions();if(this.o.modal&&j)this.d.iframe=b('<iframe src="javascript:false;"></iframe>').css(b.extend(this.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:c[0],width:c[1],zIndex:this.o.zIndex,top:0,left:0})).appendTo(this.o.appendTo);
this.d.overlay=b("<div></div>").attr("id",this.o.overlayId).addClass("simplemodal-overlay").css(b.extend(this.o.overlayCss,{display:"none",opacity:this.o.opacity/100,height:this.o.modal?c[0]:0,width:this.o.modal?c[1]:0,position:"fixed",left:0,top:0,zIndex:this.o.zIndex+1})).appendTo(this.o.appendTo);this.d.container=b("<div></div>").attr("id",this.o.containerId).addClass("simplemodal-container").css(b.extend(this.o.containerCss,{display:"none",position:"fixed",zIndex:this.o.zIndex+2})).append(this.o.close&&
this.o.closeHTML?b(this.o.closeHTML).addClass(this.o.closeClass):"").appendTo(this.o.appendTo);this.d.wrap=b("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(this.d.container);this.d.data=a.attr("id",a.attr("id")||this.o.dataId).addClass("simplemodal-data").css(b.extend(this.o.dataCss,{display:"none"})).appendTo("body");this.setContainerDimensions();this.d.data.appendTo(this.d.wrap);(j||k)&&this.fixIE()},bindEvents:function(){var a=
this;b("."+a.o.closeClass).bind("click.simplemodal",function(b){b.preventDefault();a.close()});a.o.modal&&a.o.close&&a.o.overlayClose&&a.d.overlay.bind("click.simplemodal",function(b){b.preventDefault();a.close()});b(document).bind("keydown.simplemodal",function(b){a.o.modal&&b.keyCode===9?a.watchTab(b):a.o.close&&a.o.escClose&&b.keyCode===27&&(b.preventDefault(),a.close())});b(window).bind("resize.simplemodal",function(){c=a.getDimensions();a.o.autoResize?a.setContainerDimensions():a.o.autoPosition&&
a.setPosition();j||k?a.fixIE():a.o.modal&&(a.d.iframe&&a.d.iframe.css({height:c[0],width:c[1]}),a.d.overlay.css({height:c[0],width:c[1]}))})},unbindEvents:function(){b("."+this.o.closeClass).unbind("click.simplemodal");b(document).unbind("keydown.simplemodal");b(window).unbind("resize.simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var a=this.o.position;b.each([this.d.iframe||null,!this.o.modal?null:this.d.overlay,this.d.container],function(b,c){if(c){var f=c[0].style;f.position=
"absolute";if(b<2)f.removeExpression("height"),f.removeExpression("width"),f.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'),f.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"');else{var d;a&&a.constructor===Array?(b=a[0]?typeof a[0]==="number"?a[0].toString():a[0].replace(/px/,""):c.css("top").replace(/px/,""),
b=b.indexOf("%")===-1?b+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(b.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',a[1]&&(d=typeof a[1]==="number"?a[1].toString():a[1].replace(/px/,""),d=d.indexOf("%")===-1?d+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':
parseInt(d.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')):(b='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',d='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"');
f.removeExpression("top");f.removeExpression("left");f.setExpression("top",b);f.setExpression("left",d)}}})},focus:function(a){var e=this,a=a&&b.inArray(a,["first","last"])!==-1?a:"first",c=b(":input:enabled:visible:"+a,e.d.wrap);setTimeout(function(){c.length>0?c.focus():e.d.wrap.focus()},10)},getDimensions:function(){var a=b(window);return[b.browser.opera&&b.browser.version>"9.5"&&b.fn.jquery<"1.3"||b.browser.opera&&b.browser.version<"9.5"&&b.fn.jquery>"1.2.6"?a[0].innerHeight:a.height(),a.width()]},
getVal:function(a,b){return a?typeof a==="number"?a:a==="auto"?0:a.indexOf("%")>0?parseInt(a.replace(/%/,""))/100*(b==="h"?c[0]:c[1]):parseInt(a.replace(/px/,"")):null},update:function(a,b){if(!this.d.data)return!1;this.d.origHeight=this.getVal(a,"h");this.d.origWidth=this.getVal(b,"w");this.d.data.hide();a&&this.d.container.css("height",a);b&&this.d.container.css("width",b);this.setContainerDimensions();this.d.data.show();this.o.focus&&this.focus();this.unbindEvents();this.bindEvents()},setContainerDimensions:function(){var a=
j||l,e=this.d.origHeight?this.d.origHeight:b.browser.opera?this.d.container.height():this.getVal(a?this.d.container[0].currentStyle.height:this.d.container.css("height"),"h"),a=this.d.origWidth?this.d.origWidth:b.browser.opera?this.d.container.width():this.getVal(a?this.d.container[0].currentStyle.width:this.d.container.css("width"),"w"),i=this.d.data.outerHeight(!0),f=this.d.data.outerWidth(!0);this.d.origHeight=this.d.origHeight||e;this.d.origWidth=this.d.origWidth||a;var d=this.o.maxHeight?this.getVal(this.o.maxHeight,
"h"):null,g=this.o.maxWidth?this.getVal(this.o.maxWidth,"w"):null,d=d&&d<c[0]?d:c[0],g=g&&g<c[1]?g:c[1],h=this.o.minHeight?this.getVal(this.o.minHeight,"h"):"auto",e=e?this.o.autoResize&&e>d?d:e<h?h:e:i?i>d?d:this.o.minHeight&&h!=="auto"&&i<h?h:i:h,d=this.o.minWidth?this.getVal(this.o.minWidth,"w"):"auto",a=a?this.o.autoResize&&a>g?g:a<d?d:a:f?f>g?g:this.o.minWidth&&d!=="auto"&&f<d?d:f:d;this.d.container.css({height:e,width:a});this.d.wrap.css({overflow:i>e||f>a?"auto":"visible"});this.o.autoPosition&&
this.setPosition()},setPosition:function(){var a,b;a=c[0]/2-this.d.container.outerHeight(!0)/2;b=c[1]/2-this.d.container.outerWidth(!0)/2;this.o.position&&Object.prototype.toString.call(this.o.position)==="[object Array]"&&(a=this.o.position[0]||a,b=this.o.position[1]||b);this.d.container.css({left:b,top:a})},watchTab:function(a){if(b(a.target).parents(".simplemodal-container").length>0){if(this.inputs=b(":input:enabled:visible:first, :input:enabled:visible:last",this.d.data[0]),!a.shiftKey&&a.target===
this.inputs[this.inputs.length-1]||a.shiftKey&&a.target===this.inputs[0]||this.inputs.length===0)a.preventDefault(),this.focus(a.shiftKey?"last":"first")}else a.preventDefault(),this.focus()},open:function(){this.d.iframe&&this.d.iframe.show();b.isFunction(this.o.onOpen)?this.o.onOpen.apply(this,[this.d]):(this.d.overlay.show(),this.d.container.show(),this.d.data.show());this.o.focus&&this.focus();this.bindEvents()},close:function(){var a=this;if(!a.d.data)return!1;a.unbindEvents();if(b.isFunction(a.o.onClose)&&
!a.occb)a.occb=!0,a.o.onClose.apply(a,[a.d]);else{if(a.d.placeholder){var c=b("#simplemodal-placeholder");a.o.persist?c.replaceWith(a.d.data.removeClass("simplemodal-data").css("display",a.display)):(a.d.data.hide().remove(),c.replaceWith(a.d.orig))}else a.d.data.hide().remove();a.d.container.hide().remove();a.d.overlay.hide();a.d.iframe&&a.d.iframe.hide().remove();setTimeout(function(){a.d.overlay.remove();a.d={}},10)}}}})(jQuery);
var months=["January","February","March","April","May","June","July","August","September","October","November","December"],filters=["provider","plantype","price","coinsurance","deductible","rx","maternity"],validForm=!1,returnVar={},formElement=null,InsureMonkey={},addtlMessage="";
InsureMonkey.Quote=function(){return{dependentCount:3,maxDependentCount:5,geocode_api_url:function(a){return"/api/geocode/?zip="+a+"&apikey=5f87ef9355cee37e79d0fbf316e10a7a"},validateDemoForm:function(a){var b=!0;addtlMessage="";var c=a.find(".val input[type=text].month"),d=a.find(".val input[type=text].day"),e=a.find(".val input[type=text].year"),f=a.find(".val .gender select");a.find(".child input[name=age]").each(function(){parseInt($(this).attr("value"))>25&&(b=!1,addtlMessage="Ah, shucks. Your kids are too old. Feel free to add children under the age of 25 to your plan. Please quote older children separately.")});
c.each(function(){/^(0?[1-9]{1}|1[0-2]{1})$/.test($(this).attr("value"))?$(this).removeClass("invalid"):($(this).addClass("invalid"),b=!1)});d.each(function(){/^(0?[1-9]{1}|[1-2]{1}\d{1}|3[0-1]{1})$/.test($(this).attr("value"))?$(this).removeClass("invalid"):($(this).addClass("invalid"),b=!1)});e.each(function(){/^(19\d{2}|20\d{2})$/.test($(this).attr("value"))?$(this).removeClass("invalid"):($(this).addClass("invalid"),b=!1)});f.each(function(){/^[MF]{1}$/.test($(this).attr("value"))?$(this).removeClass("invalid"):
($(this).addClass("invalid"),b=!1)});a.find("select[name=county] option:selected").attr("value")=="none"?(b=!1,a.find("select[name=county]").addClass("invalid")):a.find("select[name=county]").removeClass("invalid");c=a.find("#state");c.length==0&&(c=a.find("#id_state"));state=c.attr("value").split(",")[0];c=new Date(parseInt(a.find("#startdate").attr("value")));a.find("input[name=age]").attr("value")<19&&state!="CA"&&(state!="KY"||c.getMonth()!=0)&&(state!="AR"||c.getMonth()!=9)?(addtlMessage=state==
"UT"?"You are young and the world is your oyster.  For health insurance quotes for those of us under 19, please call (800) 771-3739.":"You are young and the world is your oyster.  Unfortunately at this time, carriers are not offering health insurance to those of us 18 and younger unless a parent is the primary applicant.  Please call us at (800) 771-3739 for more information.",b=!1,a.find(".ageout").addClass("invalid")):$(".applicant input[name=age]",a).attr("value")>64?(addtlMessage="You are wiser...and older.  Unfortunately, private health insurance only covers us at age 64 and younger.  To review your Medicare Advantage options, please call us at (800) 771-3739.",
b=!1,$(".applicant .ageout",a).addClass("invalid")):$(".spouse input[name=age]",a).attr("value")>64?(addtlMessage="You spouse is wiser...and older.  Unfortunately, private health insurance only covers us at age 64 and younger.  To review your Medicare Advantage options, please call us at (800) 771-3739.",b=!1,$(".spouse .ageout",a).addClass("invalid")):a.find(".ageout").removeClass("invalid");a.find(".val2").each(function(){var a=$(this).find(".day"),c=$(this).find(".month"),g=$(this).find(".year"),
h=$(this).find(".genderselect");(a.attr("value")!="dd"||c.attr("value")!="mm"||g.attr("value")!="yyyy"||h.attr("value")!="-")&&(a.attr("value")=="dd"||c.attr("value")=="mm"||g.attr("value")=="yyyy"||h.attr("value")=="-")?(a.attr("value")=="dd"&&a.addClass("invalid"),c.attr("value")=="mm"&&c.addClass("invalid"),g.attr("value")=="yyyy"&&g.addClass("invalid"),h.attr("value")=="-"&&h.addClass("invalid"),b=!1):(a.removeClass("invalid"),c.removeClass("invalid"),g.removeClass("invalid"),h.removeClass("invalid"))});
return b},showDemographics:function(a,b,c){a.length==5?(zipValidatorUrl=InsureMonkey.Quote.geocode_api_url(a),$.getJSON(zipValidatorUrl,function(d){if(d.error)InsureMonkey.Quote.validZip=!1,$("#home-top-content .zipform .go").show(),$("#demographics").hide(),alert("You must insert a valid zip code");else{InsureMonkey.Quote.validZip=!0;$("#home-top-content .zipform .go").hide();$("#demographics").css("marginLeft",c+"px");$("#demographics").css("marginTop",b+"px");$("#demographics input[name=zipcode]").attr("value",
a);$("#demographics").show();$("#home-top-content .zipform .go").hide();$("#demographics input[name=zipcode]").attr("value",a);$("#demographics").show();$("#demographics .applicant .genderselect").focus();$("#demographics #county select option").remove();if(d.counties.length>1){$("#demographics #county select").append('<option value="none">Select County</option>');for(var e=0;e<d.counties.length;e++)$("#demographics #county select").append('<option value="'+d.counties[e]+'">'+d.counties[e]+"</option>");
$("#demographics #county").show()}else $("#demographics #county select").prepend('<option selected="true" value="'+d.counties[0]+'">'+d.counties[0]+"</option>"),$("#demographics #county select").attr("value",d.counties[0]),$("#demographics #county").hide();$("#demographics #state").attr("value",d.state)}})):(InsureMonkey.Quote.validZip=!1,$("#home-top-content .zipform .go").show(),$("#demographics").hide(),alert("You must insert a valid zip code"))},addDependent:function(){InsureMonkey.Quote.dependentCount++;
var a=5*InsureMonkey.Quote.dependentCount+6,b=$("#demographics .template").clone();b.find(".gender select").attr("tabindex",a++);b.find(".month").attr("tabindex",a++);b.find(".day").attr("tabindex",a++);b.find(".year").attr("tabindex",a++);b.find(".tobacco input").attr("tabindex",a++);b.removeClass("template");b.addClass("dependent");$("#demographics .template").before(b);InsureMonkey.Quote.dependentCount>=InsureMonkey.Quote.maxDependentCount&&$("#demographics #addchild").remove();InsureMonkey.Quote.setDemographicEvents()},
calcAge:function(a){var a=a.parent(),b=a.children(".day").attr("value"),c=a.children(".month").attr("value"),d=a.children(".year").attr("value");if(b!=""&&b!="dd"&&b!==void 0&&c!=""&&c!="mm"&&c!==void 0&&d!=""&&d!="yyyy"&&d!==void 0&&d.length>=4){var e=new Date,e=e.getTime(),f=new Date;f.setFullYear(d,c-1,b);f=f.getTime();b=parseInt((e-f)/31556926E3);a.siblings(".ageout").html(b);a.siblings("input[name=age]").attr("value",b)}else a.siblings(".ageout").html("&nbsp;"),a.siblings("input[name=age]").attr("value",
"")},setDemographicEvents:function(a){typeof a==="undefined"&&(a="#demographics");$(a+" .dob input").live("click",function(a){a.preventDefault();InsureMonkey.Quote.calcAge($(this))});$(a+" .dob input").keyup(function(a){a.preventDefault();InsureMonkey.Quote.calcAge($(this))});$(a+" .dob input").focus(function(a){a.preventDefault();($(this).attr("class")=="day"&&$(this).attr("value")=="dd"||$(this).attr("class")=="month"&&$(this).attr("value")=="mm"||$(this).attr("class")=="year"&&$(this).attr("value")==
"yyyy")&&$(this).attr("value","")});$(a+" .dob input").blur(function(a){a.preventDefault();$(this).attr("value")==""&&($(this).attr("class")=="day"?$(this).attr("value","dd"):$(this).attr("class")=="month"?$(this).attr("value","mm"):$(this).attr("class")=="year"&&$(this).attr("value","yyyy"))});$(a+" input[name=tobaccotf]").change(function(){$(this).attr("checked")!=!1?$(this).siblings("input[name=tobacco]").attr("value","Y"):$(this).siblings("input[name=tobacco]").attr("value","N")});$(a+" input").blur(function(a){a.preventDefault();
$(this).parent(".row").hasClass("applicant")||$(this).parent(".row").hasClass("val")||$(this).parent(".row").find("input, select").each(function(){($(this).attr("class")=="day"&&$(this).attr("value")=="dd"||$(this).attr("class")=="month"&&$(this).attr("value")=="mm"||$(this).attr("class")=="year"&&$(this).attr("value")=="yyyy"||$(this).attr("class")=="genderselect"&&$(this).attr("value")=="-")&&$(this).parent(".row").addClass("val")})});$(a+" img.doclose").click(function(){$("#home-top-content .zipform .go").show();
$("#demographics").hide()});a=function(a){$(this).attr("value")==a&&$(this).attr("value","")};$(".val input.month").focus(a("mm"));$(".val input.year").focus(a("yyyy"));$(".val input.day").focus(a("dd"))},doCompare:function(){if($(".quote:visible .docompare").length<=1)return alert("You must choose at least two plans to compare."),!1;else{var a="";$(".quote:visible input[type=checkbox][name=compare]:checked").each(function(){a+="/"+$(this).attr("value")});var b="quote";$("#compareurl").length>0&&
$("#compareurl").attr("value").length>0&&(b=$("#compareurl").attr("value"));window.location="/"+b+"/compare/"+$("#quoteid").attr("value")+a}},handle_modal_demographics:function(a){a.status=="success"?window.location.href=a.data:$.modal(a.data,{closeClass:"demographics-modal-close",onShow:function(b){var c=$(b.data).find("#demographics-modal-form"),b=c.find("#id_zipcode"),d=c.find("input[type=text]"),e,f,j=c.find("#id_county"),k=c.find("#id_state"),g=c.find(".dob input");c.find(".row.child");var h;
c.find("#addchild").click(function(a){a.preventDefault();a=c.find(".row.child.hidden:first");a.length>0?a.removeClass("hidden"):$(this).hide();a=c.find(".row.child.hidden:first");a.length==0&&$(this).hide()});b.bind("focus",function(){$(this).attr("value")=="Enter Zip Code"&&$(this).attr("value","")});b.bind("blur",function(){$(this).attr("value")==""&&$(this).attr("value","Enter Zip Code")});b.bind("change",function(){j.find(".county-value").remove();var a=$(this).attr("value");a.length==5?(a=InsureMonkey.Quote.geocode_api_url(a),
$.ajax({type:"GET",url:a,dataType:"json",success:function(a){var g,b;if(a.error)k.attr("value",""),alert("You must insert a valid zip code");else{g=0;for(b=a.counties.length;g<b;g++)j.append('<option value="'+a.counties[g]+'" class="county-value">'+a.counties[g]+"</option>");j.find(".county-value:first").attr("selected","selected");k.attr("value",a.state.split(",")[0])}}})):k.attr("value","")}).trigger("change");b=0;for(h=d.length;b<h;b++)e=$(d[b]),f=e.attr("default"),typeof f!=="undefined"&&f!==
!1&&(e.bind("focus",function(){var a=$(this).attr("default");$(this).attr("value")==a&&$(this).attr("value","")}),e.bind("blur",function(){var a=$(this).attr("default");$(this).attr("value")==""&&$(this).attr("value",a)}));g.bind("keyup",function(){var a,g,b,c,h=Date();a=$(this).parent();g=a.children("input[default=DD]").attr("value");b=a.children("input[default=MM]").attr("value");c=a.children("input[default=YYYY]").attr("value");if(g!=""&&g!="DD"&&typeof g!=="undefined"&&b!=""&&b!="MM"&&typeof b!==
"undefined"&&c!=""&&c!="YYYY"&&typeof c!=="undefined"&&c.length>=4){var h=new Date,h=h.getTime(),d=new Date;d.setFullYear(c,b-1,g);d=d.getTime();g=parseInt((h-d)/31556926E3);a.siblings(".ageout").html(g)}else a.siblings(".ageout").html("&nbsp;")}).trigger("keyup");if(a.status=="invalid"&&a.errors.length>0){b=0;for(h=a.errors.length;b<h;b++)d="#id_"+a.errors[b],d=c.find(d),d.length>0&&d.addClass("invalid")}c.submit(function(a){a.preventDefault();InsureMonkey.Quote.validateDemoForm(c)&&($.ajax({type:"POST",
url:"/quote/update_demographics/",data:c.serialize(),dataType:"json",success:InsureMonkey.Quote.handle_modal_demographics}),$.modal.close())})}})},initEvents:function(){$("#applicationcontainer").length>0&&InsureMonkey.Quote.initApplication();$("form[name=zipform]").submit(function(a){a.preventDefault();zip=$("#home-top-content .zipform input").attr("value");InsureMonkey.Quote.showDemographics(zip,218,303)});$("#home-top-content .zipform .go").click(function(){zip=$("#home-top-content .zipform input").attr("value");
InsureMonkey.Quote.showDemographics(zip,218,303)});($.browser.msie&&parseInt($.browser.version)==8||parseInt($.browser.version)==7)&&$("#demographics form").keypress(function(a){a.keyCode==13&&$(this).submit()});$(".information a.i-link").click(function(){$("#updateform").submit()});var a=$(".demographics-update-form"),b;a.length>0&&(b=a.find("a.submit-link"),b.click(function(){$.ajax({type:"POST",url:"/quote/update_demographics/",data:a.serialize(),dataType:"json",success:InsureMonkey.Quote.handle_modal_demographics})}));
$(".checkbox-item > input[type=checkbox][name!=All]:checked").click();$("#home-top-content .zipform input").length!=0&&$("#home-top-content .zipform input").attr("value").length==5&&$("#home-top-content .zipform .go").click();$("#demographics #addchild").click(function(a){a.preventDefault();InsureMonkey.Quote.addDependent()});$("#demographics").length!=0&&(InsureMonkey.Quote.setDemographicEvents(),$("#demographics .dob input").keyup());$("#demographicsform").submit(function(a){validForm=InsureMonkey.Quote.validateDemoForm($(this));
validForm||(a.preventDefault(),alert("Please enter the required information in the form.\n\n"+addtlMessage))});$("#demographics select[name=startdate]").each(function(){var a=new Date,b=a.getDate(),c=a.getMonth(),d=a.getFullYear(),f=0,e=parseInt($("input[name=month_count]").attr("value"));a.getDate()>=27?f=1:a.getDate()<=3&&(e-=1);a.setDate(b+5);a.getMonth()==c&&a.setDate(b+2);b="";orig_baseyear=d;for(i=f;i<e;i++)year_diff=a.getFullYear()+i-orig_baseyear,year_diff>1?(a.setYear(d),a.setMonth(c+i)):
(a.setMonth(c+i),d=a.getFullYear()),i>0&&a.setDate(1),b+='<option value="'+a.getTime()+'">'+months[a.getMonth()]+"</option>";$(this).html(b)});$("input[name=tsortby]").click(function(){$("div#sortbyprice, div#sortbydeductible, div#sortbyoffice").hide();$("div#sortby"+$(this).attr("value")).show();$("input[value="+$(this).attr("id")+"]").attr("checked",!0)});$("input[name=bsortby]").click(function(){$("#"+$(this).attr("value")).click()});b=function(a){$(this).attr("checked")?$(this).parents(".planlist").find(".docompare:visible").length<=
4?($(this).siblings("label").html("Click to Compare").addClass("docompare").bind("click",function(){InsureMonkey.Quote.doCompare()}),$(this).parents(".planlist").find("input[type=checkbox]:checked:visible").length==4&&$(this).parents(".planlist").find("input[type=checkbox][name=compare][checked!=true]").each(function(){$(this).attr("disabled",!0);$(this).siblings("label").html("Please deselect a plan to compare this one")})):(a.preventDefault(),alert("You may compare up to four plans."),$(this).attr("checked",
!1),$(this).change()):($(this).siblings("label").html("Compare").removeClass("docompare").unbind("click"),$(this).parents(".planlist").find("input[type=checkbox][name=compare]:disabled").each(function(){$(this).attr("disabled",!1);$(this).siblings("label").html("Compare")}))};$("input[name=compare]:checked").each(b);$("input[name=compare]").change(b);$("input[name=compare]").click(function(){$(this).change()});tooltipOver=function(){$("div.rolloverpopup").css("display","none");if(!$(this).siblings(".rolloverpopup").attr("moved")){var a=
$(this).position();$(this).siblings(".rolloverpopup").css("left",a.left).css("top",a.top);$(this).siblings(".rolloverpopup").attr("moved","true")}$(this).siblings(".rolloverpopup").show()};tooltipOut=function(){$(this).siblings(".rolloverpopup").css("display","none")};$("div.rolloverpopup").siblings("img").hoverIntent({timeout:100,over:tooltipOver,out:tooltipOut});$("div.rolloverpopup").siblings("label").find("img").hide();$(".checkbox-item label").click(function(){var a=$(this).siblings("input[type=checkbox]");
a.click();a.change()});$("#countshowing").html($("div.planlist:visible div.quote:visible").length);$(".nav-section input[type=checkbox]").each(function(){$(this).attr("data")=="all"?($(this).attr("checked",!0),$(this).attr("disabled",!0)):($(this).attr("checked",!1),$(this).attr("disabled",!1))});var c=function(){if($(".bestseller.top img.showbutton:visible:first").length!=0)var a=parseInt($(".bestseller.top img.showbutton:visible:first").attr("maskval")),b=parseInt($(".bestseller.top img.showbutton:visible:first").attr("maskval"));
else b=a=parseInt($("#bestseller-all").attr("maskval"));$(".nav-section input[tmpchecked=checked]").each(function(){$(this).parents(".nav-section").hasClass("provider")?b+=parseInt($(this).attr("maskval")):a+=parseInt($(this).attr("maskval"))});var c=[],d=[];$("div.quote").each(function(){var f=parseInt($(this).attr("data")),e=parseInt($(this).attr("carrierdata")),f=parseInt(a&f)==parseInt(f),e=parseInt(b&e)==parseInt(e);f&&e?c.push($(this)):d.push($(this))});if(c.length<=0)return!1;else{for(key in c)c[key].show();
for(key in d)d[key].hide();$("#countshowing").html($("div.planlist:visible div.quote:visible").length);return!0}},d=0,e=!1,f=function(a,b){e=!1;b?$("#no-result-filter-popup p").css({"background-image":"url(/media/images/im_web_tool_tips_right_arrow.png)","margin-left":"8px"}):$("#no-result-filter-popup p").css({"background-image":"url(/media/images/im_web_tool_tips.png)","margin-left":"0px"});$("#no-result-filter-popup").css({left:a.left,top:a.top}).show();$(document).bind("mousemove",j)},j=function(){d++!==
0&&(e=!0,$(document).unbind("mousemove",j),d=0,setTimeout(function(){e&&$("#no-result-filter-popup").hide()},2E3))},k=function(a){var b=a.parents(".nav-section"),a=b.find(":checked"),b=b.find(":disabled");a.length==1?a.attr("disabled",!0):b.attr("disabled",!1)};$(".nav-section input[type=checkbox][data=all]").click(function(){$(".bestseller[show=all]").hide();$(".bestseller[show=top]").show();$(".nav-section input:checked").attr("tmpchecked","checked");$(".nav-section input:unchecked").attr("tmpchecked",
"unchecked");$(this).attr("checked")&&$(this).parents(".nav-section").find("input[type=checkbox][data!=all]").attr("tmpchecked","unchecked");var a=c();if(a)k($(this)),$(this).attr("checked")&&($(this).parents(".nav-section").find("input[type=checkbox][data!=all]").attr("checked",!1),$(this).attr("disabled",!0));else{$(this).attr("checked",!$(this).attr("checked"));var b=$(this).offset(),d=$("#no-result-filter-popup").parent().offset();b.left=b.left-d.left+100;b.top=b.top-d.top+135;$.browser.msie&&
(b.top+=10);f(b)}$(".nav-section input[type=checkbox]").removeAttr("tmpchecked");return a});$(".nav-section input[type=checkbox][data!=all]").click(function(){$(".bestseller[show=all]").hide();$(".bestseller[show=top]").show();$(".nav-section input:checked").attr("tmpchecked","checked");$(".nav-section input:unchecked").attr("tmpchecked","unchecked");var a=$(this).parents(".nav-section").find("input[type=checkbox][data=all]");$(this).attr("checked")&&a.attr("checked")&&a.attr("tmpchecked","unchecked");
var b=c();if(b)k($(this)),$(this).attr("checked")&&a.attr("checked")&&(a.attr("checked",!1),$(this).parents(".nav-section").find(":checked").length==1&&$(this).attr("disabled",!0));else{$(this).attr("checked",!$(this).attr("checked"));var a=$(this).offset(),d=$("#no-result-filter-popup").parent().offset();a.left=a.left-d.left+100;a.top=a.top-d.top+135;$.browser.msie&&(a.top+=10);f(a)}$(".nav-section input[type=checkbox]").removeAttr("tmpchecked");return b});$(".bestseller img.showbutton").bind("click",
function(){$(".nav-section input[type=checkbox][data=all]").attr("checked",!0);$(".nav-section input[type=checkbox][data=all]").attr("disabled",!0);$(".nav-section input[type=checkbox][data!=all]").attr("checked",!1);$(".nav-section input[type=checkbox][data!=all]").attr("disabled",!1);$(".bestseller").hide();$(this).parents(".bestseller").attr("show")=="all"?$(".bestseller[show=top]").show():$(this).parents(".bestseller").attr("show")=="top"&&$(".bestseller[show=all]").show();$(".nav-section input:checked").attr("tmpchecked",
"checked");$(".nav-section input:unchecked").attr("tmpchecked","unchecked");if(!c()){$(".bestseller").hide();$(this).parents(".bestseller").attr("show")=="all"?$(".bestseller[show=all]").show():$(this).parents(".bestseller").attr("show")=="top"&&$(".bestseller[show=top]").show();var a={left:280,top:180};$.browser.msie&&(a.top+=10);f(a,!0)}$(".nav-section input[type=checkbox]").removeAttr("tmpchecked")});$("#vertical-tabs").find("div.tab").each(function(){RegExp(".*/"+$(this).attr("data")+"/?").test(location.href)&&
$(this).addClass("selected")});$("#right-vertical-tabs").find("div.tab").each(function(){RegExp(".*/"+$(this).attr("data")).test(location.href)&&$(this).addClass("selected")});$("#home-top-content img.go").mousedown(function(){$(this).addClass("mousedown")});$("#home-top-content img.go").bind("mouseleave mouseout mouseup",function(){$(this).removeClass("mousedown")});$("#home-top-content .zipform input").keypress(function(a){a.keyCode=="13"&&$(this).siblings(".go").click()});InsureMonkey.Quote.homePageInit();
InsureMonkey.Quote.GAInit();$("#left-vertical-tabs .tab-content .tab-content-section").each(function(){$(this).html().replace(/^\s*/,"").replace(/\s*$/,"").length<=0&&$(this).hide()});$("#demographics input").blur();$("#zipform input[name=zip],.zipform input[name=zipcode]").click(function(){$(this).attr("value")=="Enter Zip Code"&&$(this).attr("value","")});$("#zipform input[name=zip],.zipform input[name=zipcode]").blur(function(){$(this).attr("value")==""&&$(this).attr("value","Enter Zip Code")}).blur();
$("[hook_bind][hook_action][hook_target]").each(function(){$(this).bind($(this).attr("hook_bind"),function(a){a.preventDefault();$(this).attr("hook_action")=="hide"?$($(this).attr("hook_target")).hide():$(this).attr("hook_action")=="show"&&$($(this).attr("hook_target")).show()})})},initApplication:function(){$(".selectquestion select").change(function(){var a=$(this).attr("value");$(this).siblings(".answerquestion").hide();$(this).siblings(".infoitem").hide();$(this).siblings(".answerquestion[answer="+
a+"]").show();$(this).siblings(".infoitem[answer="+a+"]").show();$(this).siblings(".answerquestion[answer="+a+"]").find(".formquestion :input:visible").attr("disabled",!1);$(this).siblings(".answerquestion").find(".formquestion :input:hidden").attr("disabled",!0)});$(".selectquestion select").change();$(".selectquestion input[type=radio]").change(function(){var a=$(this).attr("value");$(this).attr("checked")&&($(this).closest("ul").siblings(".answerquestion").hide(),$(this).closest("ul").siblings(".infoitem").hide(),
$(this).closest("ul").siblings(".answerquestion[answer="+a+"]").show(),$(this).closest("ul").siblings(".infoitem[answer="+a+"]").show(),$(this).closest("ul").siblings(".answerquestion[answer="+a+"]").find(".formquestion :input:visible").attr("disabled",!1),$(this).closest("ul").siblings(".answerquestion").find(".formquestion :input:hidden").attr("disabled",!0))});$(".selectquestion input[type=radio]").change();$(".selectquestion input[type=checkbox]").change(function(){$(this).attr("checked")?val=
"checked":val="unchecked";$(this).siblings(".answerquestion").hide();$(this).siblings(".answerquestion[answer="+val+"]").show();$(this).siblings(".answerquestion[answer="+val+"]").find(".formquestion :input:visible").attr("disabled",!1);$(this).siblings(".answerquestion").find(".formquestion :input:hidden").attr("disabled",!0)});$(".selectquestion input[type=checkbox]").change();$(".multicheck > .multicheck-table input[type=checkbox]").change(function(){$(this).closest(".multicheck").find(".multicheck-table:first input[type=checkbox][value!=none]:checked").length>
0&&$(this).attr("value")!="none"?($(this).attr("value"),$(this).closest(".multicheck").find(".multicheck-table:first input[type=checkbox][value=none]").attr("checked",!1),$(this).closest(".multicheck").children(".answerquestion").hide(),$(this).closest(".multicheck").children(".answerquestion:not([answer])").show(),$(this).closest(".multicheck").children(".answerquestion:not([answer])").find(".formquestion :input:visible").attr("disabled",!1),$(this).closest(".multicheck-table").find("input[type=checkbox][value!=none]:checked").each(function(){var a=
$(this).attr("value");$(this).closest(".multicheck").children(".answerquestion[answer="+a+"]").show();$(this).closest(".multicheck").children(".answerquestion[answer="+a+"]").find(".formquestion :input:visible").attr("disabled",!1)})):($(this).closest(".multicheck").find(".multicheck-table:first input[type=checkbox][value!=none]:checked").attr("checked",!1),$(this).closest(".multicheck").find(".multicheck-table:first input[type=checkbox][value=none]").attr("checked",!0),$(this).closest(".multicheck").children(".answerquestion").hide(),
$(this).closest(".multicheck").children(".answerquestion[answer=none]").show(),$(this).closest(".multicheck").children(".answerquestion[answer=none]").find(".formquestion :input:visible").attr("disabled",!1));$(this).closest(".multicheck").find(".formquestion :input:hidden").attr("disabled",!0)});$(".multicheck").each(function(){$(this).children(".multicheck-table").find("input[type=checkbox][value!=none]:checked").length>0&&($(this).find(".multicheck-table:first input[type=checkbox][value=none]").attr("checked",
!1),$(this).children(".answerquestion").show(),$(this).children(".answerquestion").find(".formquestion :input:visible").attr("disabled",!1))});$(".additembutton").click(function(){$(this).siblings(".answerquestion:hidden:first").show();$(this).siblings(".answerquestion:hidden").length==0&&$(this).hide();$(this).siblings(".answerquestion").find(":input:hidden").attr("disabled",!0);$(this).siblings(".answerquestion").find(":input:visible").attr("disabled",!1)});$(".addquestion > .answerquestion > .removeitembutton").click(function(){$(this).closest(".answerquestion").find(":input").attr("disabled",
!0);$(this).closest(".answerquestion").hide();$(this).closest(".answerquestion").siblings(".additembutton").show()});$(".addquestion > .answerquestion").each(function(){$(this).find(".formquestion:first :input[value!='']").length>0?($(this).closest(".answerquestion").show(),child_questions=$(this).children(".compound-question").children(".formquestion"),child_questions.children(":input:visible").attr("disabled",!1),child_questions.children("ul").find(":input:visible").attr("disabled",!1),$(this).children(".formquestion").children(":input:visible").attr("disabled",
!1)):$(this).children(".formquestion").children(":input").attr("disabled",!0)});$(".formquestion :input:hidden").attr("disabled",!0);var a,b,c="",d="";b=$.parseJSON($("#formerrors").attr("errors"));for(var e in b)a=$(":input[name="+e+"]"),a.addClass("error"),d=a.attr("error_label"),typeof d==="undefined"&&(d=a.is("input[type=radio]")?a.closest("ul").siblings("label").html():a.siblings("label").html()),d==null&&(d=e),c+="<li><b>"+d+":</b> "+b[e];$("#formerrors").html(c)},homePageInit:function(){$.browser.msie&&
parseInt($.browser.version)==8||parseInt($.browser.version)==7?($(".home-top-navi .tab").mouseenter(function(){$(this).siblings(".tab").removeClass("selected");$(".hero:visible").css("display","none");$("#"+$(this).attr("data")).css("display","block");$(this).addClass("selected")}),$("#hero-0").length>0?($("#hero-0").css("display","block"),$(".home-top-navi .tab").mouseout(function(){$(".home-top-navi .tab").removeClass("selected");$(".hero:visible").css("display","none");$("#hero-0").css("display",
"block")})):($("#hero-1").css("display","block"),$(".home-top-navi .tab[data=hero-1]").addClass("selected"))):($(".home-top-navi .tab").hoverIntent(function(){$(this).siblings(".tab").removeClass("selected");$(".hero:visible").stop().fadeTo(300,0);$("#"+$(this).attr("data")).stop().fadeTo(600,1);$(this).addClass("selected")},function(){}),$("#hero-0").length>0?($("#hero-0").css("display","block"),$(".home-top-navi .tab").mouseleave(function(){$(".home-top-navi .tab").removeClass("selected");$(".hero:visible").stop().fadeTo(300,
0);$("#hero-0").stop().fadeTo(600,1)})):($("#hero-1").css("display","block"),$(".home-top-navi .tab[data=hero-1]").addClass("selected")));$("#readmore").click(function(a){a.preventDefault();$("#readmorecontent").show("fast");$("#readmore").hide()});$("#collapsecontent").click(function(a){a.preventDefault();$("#readmorecontent").hide("fast");$("#readmore").show()});$("a#loginsubmitbutton").click(function(){formElement=$(this).parents("form")});$("a#registersubmitbutton").click(function(){formElement=
$(this).parents("form")});$("button#loginsubmitbutton").click(function(){formElement=$(this).parents("form")});$("button#registersubmitbutton").click(function(){formElement=$(this).parents("form")})},GAInit:function(){$("[gatrack]").each(function(){var a=$(this).attr("gatrack").split(",");$(this).bind(a[0],function(){_gaq.push(a.slice(1,-1))})})}}}();
$(document).ready(function(){$.prettyPhoto&&($("a[rel='prettyPhoto']").prettyPhoto(),$("a[rel='prettyPhotoCallbackSubmit']").prettyPhoto({modal:!0,callback:function(){_gaq.push(["_trackEvent","button","go","planapply"]);$("#form_register, #form_login").each(function(){$(this).submit()})}}),$("button[rel='prettyPhoto']").prettyPhoto(),$("button[rel='prettyPhotoCallbackSubmit']").prettyPhoto({modal:!0,callback:function(){_gaq.push(["_trackEvent","button","go","planapply"]);$("#form_register, #form_login").each(function(){$(this).submit()})}}))});
$("body").append('<div id="pxl" style="display:none;"></div>');$("#pxl").load("/pixels");
