(function($){$.fn.validationEngineLanguage=function(){};$.validationEngineLanguage={newLang:function(){$.validationEngineLanguage.allRules={"required":{"regex":"none","alertText":"* This field is required","alertTextCheckboxMultiple":"* Please select an option","alertTextCheckboxe":"* This checkbox is required","alertTextDateRange":"* Both date range fields are required"},"requiredInFunction":{"func":function(field,rules,i,options){return(field.val()=="test")?true:false;},"alertText":"* Field must equal test"},"dateRange":{"regex":"none","alertText":"* Invalid ","alertText2":"Date Range"},"dateTimeRange":{"regex":"none","alertText":"* Invalid ","alertText2":"Date Time Range"},"minSize":{"regex":"none","alertText":"* Minimum ","alertText2":" characters allowed"},"maxSize":{"regex":"none","alertText":"* Maximum ","alertText2":" characters allowed"},"groupRequired":{"regex":"none","alertText":"* You must fill one of the following fields"},"min":{"regex":"none","alertText":"* Minimum value is "},"max":{"regex":"none","alertText":"* Maximum value is "},"past":{"regex":"none","alertText":"* Date prior to "},"future":{"regex":"none","alertText":"* Date past "},"maxCheckbox":{"regex":"none","alertText":"* Maximum ","alertText2":" options allowed"},"minCheckbox":{"regex":"none","alertText":"* Please select ","alertText2":" options"},"equals":{"regex":"none","alertText":"* Please match the previous control content."},"creditCard":{"regex":"none","alertText":"* Invalid credit card number"},"phone":{"regex":/^([\+][0-9]{1,3}[\ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9\ \.\-\/]{3,20})((x|ext|extension)[\ ]?[0-9]{1,4})?$/,"alertText":"* Invalid phone number"},"email":{"regex":/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/,"alertText":"* Invalid email address"},"integer":{"regex":/^[\-\+]?\d+$/,"alertText":"* Not a valid integer"},"number":{"regex":/^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/,"alertText":"* Invalid floating decimal number"},"date":{"func":function(field){var pattern=new RegExp(/^(\d{4})[\/\-\.](0?[1-9]|1[012])[\/\-\.](0?[1-9]|[12][0-9]|3[01])$/);var match=pattern.exec(field.val());if(match==null) return false;var year=match[1];var month=match[2]*1;var day=match[3]*1;var date=new Date(year,month-1,day);return(date.getFullYear()==year&&date.getMonth()==(month-1)&&date.getDate()==day);},"alertText":"* Invalid date, must be in YYYY-MM-DD format"},"ipv4":{"regex":/^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,"alertText":"* Invalid IP address"},"url":{"regex":/^(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,"alertText":"* Invalid URL"},"onlyNumberSp":{"regex":/^[0-9\ ]+$/,"alertText":"* Numbers only"},"onlyLetterSp":{"regex":/^[a-zA-Z\ \']+$/,"alertText":"* Letters only"},"onlyLetterNumber":{"regex":/^[0-9a-zA-Z]+$/,"alertText":"* No special characters allowed"},"ajaxFieldName":{"extraData":"type=FieldName","alertTextOk":"* This field name is available","alertTextLoad":"* Validating, please wait","alertText":"* This field name is already taken"},"ajaxUpload":{"extraData":"type=Upload","alertTextOk":"* uploading the file is allowed.","alertTextLoad":"* Validating, please wait","alertText":"* uploading the file is not allowed"},"ajaxUserCall":{"url":"ajaxValidateFieldUser","extraData":"name=eric","alertText":"* This user is already taken","alertTextLoad":"* Validating, please wait"},"ajaxUserCallPhp":{"url":"phpajax/ajaxValidateFieldUser.php","extraData":"name=eric","alertTextOk":"* This username is available","alertText":"* This user is already taken","alertTextLoad":"* Validating, please wait"},"ajaxNameCall":{"url":"ajaxValidateFieldName","alertText":"* This name is already taken","alertTextOk":"* This name is available","alertTextLoad":"* Validating, please wait"},"ajaxNameCallPhp":{"url":"phpajax/ajaxValidateFieldName.php","alertText":"* This name is already taken","alertTextLoad":"* Validating, please wait"},"validate2fields":{"alertText":"* Please input HELLO"},"dateFormat":{"regex":/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/,"alertText":"* Invalid Date"},"dateTimeFormat":{"regex":/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/,"alertText":"* Invalid Date or Date Format","alertText2":"Expected Format: ","alertText3":"mm/dd/yyyy hh:mm:ss AM|PM or ","alertText4":"yyyy-mm-dd hh:mm:ss AM|PM"}};}};$.validationEngineLanguage.newLang();})(jQuery); ;;;(function($){"use strict";var methods={init:function(options){var form=this;if(!form.data('jqv')||form.data('jqv')==null){options=methods._saveOptions(form,options);if(!options.isWCAG){$(document).on("click",".formError",function(){$(this).fadeOut(150,function(){$(this).parent('.formErrorOuter').remove();$(this).remove();});});}} return this;},attach:function(userOptions){var form=this;var options;if(userOptions) options=methods._saveOptions(form,userOptions);else options=form.data('jqv');options.validateAttribute=(form.find("[data-validation-engine*=validate]").length)?"data-validation-engine":"class";if(options.binded){form.on(options.validationEventTrigger,"["+options.validateAttribute+"*=validate]:not([type=checkbox]):not([type=radio]):not(.datepicker)",methods._onFieldEvent);form.on("click","["+options.validateAttribute+"*=validate][type=checkbox],["+options.validateAttribute+"*=validate][type=radio]",methods._onFieldEvent);form.on(options.validationEventTrigger,"["+options.validateAttribute+"*=validate][class*=datepicker]",{"delay":300},methods._onFieldEvent);} if(options.autoPositionUpdate){$(window).bind("resize",{"noAnimation":true,"formElem":form},methods.updatePromptsPosition);} form.on("click","a[data-validation-engine-skip], a[class*='validate-skip'], button[data-validation-engine-skip], button[class*='validate-skip'], input[data-validation-engine-skip], input[class*='validate-skip']",methods._submitButtonClick);form.removeData('jqv_submitButton');form.on("submit",methods._onSubmitEvent);return this;},detach:function(){var form=this;var options=form.data('jqv');form.find("["+options.validateAttribute+"*=validate]").not("[type=checkbox]").off(options.validationEventTrigger,methods._onFieldEvent);form.find("["+options.validateAttribute+"*=validate][type=checkbox],[class*=validate][type=radio]").off("click",methods._onFieldEvent);form.off("submit",methods._onSubmitEvent);form.removeData('jqv');form.off("click","a[data-validation-engine-skip], a[class*='validate-skip'], button[data-validation-engine-skip], button[class*='validate-skip'], input[data-validation-engine-skip], input[class*='validate-skip']",methods._submitButtonClick);form.removeData('jqv_submitButton');if(options.autoPositionUpdate) $(window).off("resize",methods.updatePromptsPosition);return this;},validate:function(){var element=$(this);var valid=null;if(element.is("form")||element.hasClass("validationEngineContainer")){if(element.hasClass('validating')){return false;}else{element.addClass('validating');var options=element.data('jqv');var valid=methods._validateFields(this);setTimeout(function(){element.removeClass('validating');},100);if(valid&&options.onSuccess){options.onSuccess();}else if(!valid&&options.onFailure){options.onFailure();}}}else if(element.is('form')||element.hasClass('validationEngineContainer')){element.removeClass('validating');}else{var form=element.closest('form, .validationEngineContainer'),options=(form.data('jqv'))?form.data('jqv'):$.validationEngine.defaults,valid=methods._validateField(element,options);if(valid&&options.onFieldSuccess) options.onFieldSuccess();else if(options.onFieldFailure&&options.InvalidFields.length>0){options.onFieldFailure();}} if(options.onValidationComplete){return!!options.onValidationComplete(form,valid);} return valid;},updatePromptsPosition:function(event){if(event&&this==window){var form=event.data.formElem;var noAnimation=event.data.noAnimation;}else var form=$(this.closest('form, .validationEngineContainer'));var options=form.data('jqv');form.find('['+options.validateAttribute+'*=validate]').not(":disabled").each(function(){var field=$(this);if(options.prettySelect&&field.is(":hidden")) field=form.find("#"+options.usePrefix+field.attr('id')+options.useSuffix);var prompt=methods._getPrompt(field);var promptText=$(prompt).find(".formErrorContent").html();if(prompt) methods._updatePrompt(field,$(prompt),promptText,undefined,false,options,noAnimation);});return this;},showPrompt:function(promptText,type,promptPosition,showArrow){var form=this.closest('form, .validationEngineContainer');var options=form.data('jqv');if(!options) options=methods._saveOptions(this,options);if(promptPosition) options.promptPosition=promptPosition;options.showArrow=showArrow==true;methods._showPrompt(this,promptText,type,false,options);return this;},hide:function(){var form=$(this).closest('form, .validationEngineContainer');var options=form.data('jqv');var fadeDuration=(options&&options.fadeDuration)?options.fadeDuration:0.3;var closingtag;if($(this).is("form")||$(this).hasClass("validationEngineContainer")){closingtag="parentForm"+methods._getClassName($(this).attr("id"));}else{closingtag=methods._getClassName($(this).attr("id"))+"formError";} $('.'+closingtag).fadeTo(fadeDuration,0.3,function(){$(this).parent('.formErrorOuter').remove();$(this).remove();});return this;},hideAll:function(){var form=this;var options=form.data('jqv');var duration=options?options.fadeDuration:300;$('.formError').fadeTo(duration,300,function(){$(this).parent('.formErrorOuter').remove();$(this).remove();});return this;},_onFieldEvent:function(event){var field=$(this);var form=field.closest('form, .validationEngineContainer');var options=form.data('jqv');options.eventTrigger="field";if(options.isWCAG&&!field.parent(".hasErrorMsg").length&&event.type!="submit"){}else{window.setTimeout(function(){methods._validateField(field,options);if(options.InvalidFields.length==0&&options.onFieldSuccess){options.onFieldSuccess();}else if(options.InvalidFields.length>0&&options.onFieldFailure){options.onFieldFailure();}},(event.data)?event.data.delay:0);}},_onSubmitEvent:function(){var form=$(this);var options=form.data('jqv');if(form.data("jqv_submitButton")){var submitButton=$("#"+form.data("jqv_submitButton"));if(submitButton){if(submitButton.length>0){if(submitButton.hasClass("validate-skip")||submitButton.attr("data-validation-engine-skip")=="true") return true;}}} options.eventTrigger="submit";var r=methods._validateFields(form);if(r&&options.ajaxFormValidation){methods._validateFormWithAjax(form,options);return false;} if(options.onValidationComplete){return!!options.onValidationComplete(form,r);} return r;},_checkAjaxStatus:function(options){var status=true;$.each(options.ajaxValidCache,function(key,value){if(!value){status=false;return false;}});return status;},_checkAjaxFieldStatus:function(fieldid,options){return options.ajaxValidCache[fieldid]==true;},_validateFields:function(form){var options=form.data('jqv');var errorFound=false;form.trigger("jqv.form.validating");var first_err=null;form.find('['+options.validateAttribute+'*=validate]').not(":disabled").each(function(){var field=$(this);var names=[];if($.inArray(field.attr('name'),names)<0){errorFound|=methods._validateField(field,options);if(errorFound&&first_err==null) if(field.is(":hidden")&&options.prettySelect) first_err=field=form.find("#"+options.usePrefix+methods._jqSelector(field.attr('id'))+options.useSuffix);else{if(field.data('jqv-prompt-at')instanceof jQuery){field=field.data('jqv-prompt-at');}else if(field.data('jqv-prompt-at')){field=$(field.data('jqv-prompt-at'));} first_err=field;} if(options.doNotShowAllErrosOnSubmit) return false;names.push(field.attr('name'));if(options.showOneMessage==true&&errorFound){return false;}}});form.trigger("jqv.form.result",[errorFound]);if(errorFound){if(options.scroll){var destination=first_err.offset().top;var fixleft=first_err.offset().left;var positionType=options.promptPosition;if(typeof(positionType)=='string'&&positionType.indexOf(":")!=-1) positionType=positionType.substring(0,positionType.indexOf(":"));if(positionType!="bottomRight"&&positionType!="bottomLeft"){var prompt_err=methods._getPrompt(first_err);if(prompt_err){destination=prompt_err.offset().top;}} if(options.scrollOffset){destination-=options.scrollOffset;} if(options.isOverflown){var overflowDIV=$(options.overflownDIV);if(!overflowDIV.length)return false;var scrollContainerScroll=overflowDIV.scrollTop();var scrollContainerPos=-parseInt(overflowDIV.offset().top);destination+=scrollContainerScroll+scrollContainerPos-5;var scrollContainer=$(options.overflownDIV+":not(:animated)");if(typeof floatingOffset!="undefined"){destination-=floatingOffset} scrollContainer.animate({scrollTop:destination},0,function(){if(options.focusFirstField)first_err.focus();});}else{if(typeof floatingOffset!="undefined"){destination-=floatingOffset} $("html, body").animate({scrollTop:destination-100},0,function(){if(options.focusFirstField)first_err.focus();});}}else if(options.focusFirstField) first_err.focus();return false;} return true;},_validateFormWithAjax:function(form,options){var data=form.serialize();var type=(options.ajaxFormValidationMethod)?options.ajaxFormValidationMethod:"GET";var url=(options.ajaxFormValidationURL)?options.ajaxFormValidationURL:form.attr("action");var dataType=(options.dataType)?options.dataType:"json";$.ajax({type:type,url:url,cache:false,dataType:dataType,data:data,form:form,methods:methods,options:options,beforeSend:function(){return options.onBeforeAjaxFormValidation(form,options);},error:function(data,transport){methods._ajaxError(data,transport);},success:function(json){if((dataType=="json")&&(json!==true)){var errorInForm=false;for(var i=0;i0){limitErrors=true;} var form=$(field.closest("form, .validationEngineContainer"));for(var i=0;i=options.maxErrorsPerField){if(!required){var have_required=$.inArray('required',rules);required=(have_required!=-1&&have_required>=i);} break;} var errorMsg=undefined;switch(rules[i]){case"required":required=true;errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._required);break;case"custom":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._custom);break;case"groupRequired":var classGroup="["+options.validateAttribute+"*="+rules[i+1]+"]";var firstOfGroup=form.find(classGroup).eq(0);if(firstOfGroup[0]!=field[0]){methods._validateField(firstOfGroup,options,skipAjaxValidation);options.showArrow=true;} errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._groupRequired);if(errorMsg)required=true;options.showArrow=false;break;case"ajax":errorMsg=methods._ajax(field,rules,i,options);if(errorMsg){promptType="load";} break;case"minSize":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._minSize);break;case"maxSize":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._maxSize);break;case"min":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._min);break;case"max":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._max);break;case"past":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._past);break;case"future":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._future);break;case"dateRange":var classGroup="["+options.validateAttribute+"*="+rules[i+1]+"]";options.firstOfGroup=form.find(classGroup).eq(0);options.secondOfGroup=form.find(classGroup).eq(1);if(options.firstOfGroup[0].value||options.secondOfGroup[0].value){errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._dateRange);} if(errorMsg)required=true;options.showArrow=false;break;case"dateTimeRange":var classGroup="["+options.validateAttribute+"*="+rules[i+1]+"]";options.firstOfGroup=form.find(classGroup).eq(0);options.secondOfGroup=form.find(classGroup).eq(1);if(options.firstOfGroup[0].value||options.secondOfGroup[0].value){errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._dateTimeRange);} if(errorMsg)required=true;options.showArrow=false;break;case"maxCheckbox":field=$(form.find("input[name='"+fieldName+"']"));errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._maxCheckbox);break;case"minCheckbox":field=$(form.find("input[name='"+fieldName+"']"));errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._minCheckbox);break;case"equals":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._equals);break;case"funcCall":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._funcCall);break;case"creditCard":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._creditCard);break;case"condRequired":errorMsg=methods._getErrorMessage(form,field,rules[i],rules,i,options,methods._condRequired);if(errorMsg!==undefined){required=true;} break;default:} var end_validation=false;if(typeof errorMsg=="object"){switch(errorMsg.status){case"_break":end_validation=true;break;case"_error":errorMsg=errorMsg.message;break;case"_error_no_prompt":return true;break;default:break;}} if(end_validation){break;} if(typeof errorMsg=='string'){promptText+=errorMsg+"
";options.isError=true;field_errors++;}} if(!required&&!(field.val())&&field.val().length<1)options.isError=false;var fieldType=field.prop("type");var positionType=field.data("promptPosition")||options.promptPosition;if((fieldType=="radio"||fieldType=="checkbox")&&form.find("input[name='"+fieldName+"']").size()>1){if(positionType==='inline'){field=$(form.find("input[name='"+fieldName+"'][type!=hidden]:last"));}else{field=$(form.find("input[name='"+fieldName+"'][type!=hidden]:first"));} options.showArrow=false;} if(field.is(":hidden")&&options.prettySelect){field=form.find("#"+options.usePrefix+methods._jqSelector(field.attr('id'))+options.useSuffix);} if(options.isError&&options.showPrompts){methods._showPrompt(field,promptText,promptType,false,options);}else{if(!isAjaxValidator)methods._closePrompt(field);} if(!isAjaxValidator){field.trigger("jqv.field.result",[field,options.isError,promptText]);} var errindex=$.inArray(field[0],options.InvalidFields);if(errindex==-1){if(options.isError) options.InvalidFields.push(field[0]);}else if(!options.isError){options.InvalidFields.splice(errindex,1);} methods._handleStatusCssClasses(field,options);if(options.isError&&options.onFieldFailure) options.onFieldFailure(field);if(!options.isError&&options.onFieldSuccess) options.onFieldSuccess(field);return options.isError;},_handleStatusCssClasses:function(field,options){if(options.addSuccessCssClassToField) field.removeClass(options.addSuccessCssClassToField);if(options.addFailureCssClassToField) field.removeClass(options.addFailureCssClassToField);if(options.addSuccessCssClassToField&&!options.isError) field.addClass(options.addSuccessCssClassToField);if(options.addFailureCssClassToField&&options.isError) field.addClass(options.addFailureCssClassToField);},_getErrorMessage:function(form,field,rule,rules,i,options,originalValidationMethod){var rule_index=jQuery.inArray(rule,rules);if(rule==="custom"||rule==="funcCall"){var custom_validation_type=rules[rule_index+1];rule=rule+"["+custom_validation_type+"]";delete(rules[rule_index]);} var alteredRule=rule;var element_classes=(field.attr("data-validation-engine"))?field.attr("data-validation-engine"):field.attr("class");var element_classes_array=element_classes.split(" ");var errorMsg;if(rule=="future"||rule=="past"||rule=="maxCheckbox"||rule=="minCheckbox"){errorMsg=originalValidationMethod(form,field,rules,i,options);}else{errorMsg=originalValidationMethod(field,rules,i,options);} if(errorMsg!=undefined){var custom_message=methods._getCustomErrorMessage($(field),element_classes_array,alteredRule,options);if(custom_message)errorMsg=custom_message;} return errorMsg;},_getCustomErrorMessage:function(field,classes,rule,options){var custom_message=false;var validityProp=/^custom\[.*\]$/.test(rule)?methods._validityProp["custom"]:methods._validityProp[rule];if(validityProp!=undefined){custom_message=field.attr("data-errormessage-"+validityProp);if(custom_message!=undefined) return custom_message;} custom_message=field.attr("data-errormessage");if(custom_message!=undefined) return custom_message;var id='#'+field.attr("id");if(typeof options.custom_error_messages[id]!="undefined"&&typeof options.custom_error_messages[id][rule]!="undefined"){custom_message=options.custom_error_messages[id][rule]['message'];}else if(classes.length>0){for(var i=0;i0;i++){var element_class="."+classes[i];if(typeof options.custom_error_messages[element_class]!="undefined"&&typeof options.custom_error_messages[element_class][rule]!="undefined"){custom_message=options.custom_error_messages[element_class][rule]['message'];break;}}} if(!custom_message&&typeof options.custom_error_messages[rule]!="undefined"&&typeof options.custom_error_messages[rule]['message']!="undefined"){custom_message=options.custom_error_messages[rule]['message'];} return custom_message;},_validityProp:{"required":"value-missing","custom":"custom-error","groupRequired":"value-missing","ajax":"custom-error","minSize":"range-underflow","maxSize":"range-overflow","min":"range-underflow","max":"range-overflow","past":"type-mismatch","future":"type-mismatch","dateRange":"type-mismatch","dateTimeRange":"type-mismatch","maxCheckbox":"range-overflow","minCheckbox":"range-underflow","equals":"pattern-mismatch","funcCall":"custom-error","creditCard":"pattern-mismatch","condRequired":"value-missing"},_required:function(field,rules,i,options,condRequired){switch(field.prop("type")){case"text":case"password":case"textarea":case"file":case"select-one":case"select-multiple":default:var field_val=$.trim(field.val());var dv_placeholder=$.trim(field.attr("data-validation-placeholder"));var placeholder=$.trim(field.attr("placeholder"));if((!field_val)||(dv_placeholder&&field_val==dv_placeholder)||(placeholder&&field_val==placeholder)){return options.allrules[rules[i]].alertText;} break;case"radio":case"checkbox":if(condRequired){if(!field.attr('checked')){return options.allrules[rules[i]].alertTextCheckboxMultiple;} break;} var form=field.closest("form, .validationEngineContainer");var name=field.attr("name");if(form.find("input[name='"+name+"']:checked").size()==0){if(form.find("input[name='"+name+"']:visible").size()==1) return options.allrules[rules[i]].alertTextCheckboxe;else return options.allrules[rules[i]].alertTextCheckboxMultiple;} break;}},_groupRequired:function(field,rules,i,options){var classGroup="["+options.validateAttribute+"*="+rules[i+1]+"]";var isValid=false;field.closest("form, .validationEngineContainer").find(classGroup).each(function(){if(!methods._required($(this),rules,i,options)){isValid=true;return false;}});if(!isValid){return options.allrules[rules[i]].alertText;}},_custom:function(field,rules,i,options){var customRule=rules[i+1];var rule=options.allrules[customRule];var fn;if(!rule){alert("jqv:custom rule not found - "+customRule);return;} if(rule["regex"]){var ex=rule.regex;if(!ex){alert("jqv:custom regex not found - "+customRule);return;} var pattern=new RegExp(ex);if(!pattern.test(field.val()))return options.allrules[customRule].alertText;}else if(rule["func"]){fn=rule["func"];if(typeof(fn)!=="function"){alert("jqv:custom parameter 'function' is no function - "+customRule);return;} if(!fn(field,rules,i,options)) return options.allrules[customRule].alertText;}else{alert("jqv:custom type not allowed "+customRule);return;}},_funcCall:function(field,rules,i,options){var functionName=rules[i+1];var fn;if(functionName.indexOf('.')>-1){var namespaces=functionName.split('.');var scope=window;while(namespaces.length){scope=scope[namespaces.shift()];} fn=scope;}else fn=window[functionName]||options.customFunctions[functionName];if(typeof(fn)=='function') return fn(field,rules,i,options);},_equals:function(field,rules,i,options){var equalsField=rules[i+1];if(field.val()!=$("#"+equalsField).val()) return options.allrules.equals.alertText;},_maxSize:function(field,rules,i,options){var max=rules[i+1];var len=field.val().length;if(len>max){var rule=options.allrules.maxSize;return rule.alertText+max+rule.alertText2;}},_minSize:function(field,rules,i,options){var min=rules[i+1];var len=field.val().length;if(lenmax){var rule=options.allrules.max;if(rule.alertText2)return rule.alertText+max+rule.alertText2;return rule.alertText+max;}},_past:function(form,field,rules,i,options){var p=rules[i+1];var fieldAlt=$(form.find("input[name='"+p.replace(/^#+/,'')+"']"));var pdate;if(p.toLowerCase()=="now"){pdate=new Date();}else if(undefined!=fieldAlt.val()){if(fieldAlt.is(":disabled")) return;pdate=methods._parseDate(fieldAlt.val());}else{pdate=methods._parseDate(p);} var vdate=methods._parseDate(field.val());if(vdate>pdate){var rule=options.allrules.past;if(rule.alertText2)return rule.alertText+methods._dateToString(pdate)+rule.alertText2;return rule.alertText+methods._dateToString(pdate);}},_future:function(form,field,rules,i,options){var p=rules[i+1];var fieldAlt=$(form.find("input[name='"+p.replace(/^#+/,'')+"']"));var pdate;if(p.toLowerCase()=="now"){pdate=new Date();}else if(undefined!=fieldAlt.val()){if(fieldAlt.is(":disabled")) return;pdate=methods._parseDate(fieldAlt.val());}else{pdate=methods._parseDate(p);} var vdate=methods._parseDate(field.val());if(vdatenbCheck){options.showArrow=false;if(options.allrules.maxCheckbox.alertText2) return options.allrules.maxCheckbox.alertText+" "+nbCheck+" "+options.allrules.maxCheckbox.alertText2;return options.allrules.maxCheckbox.alertText;}},_minCheckbox:function(form,field,rules,i,options){var nbCheck=rules[i+1];var groupname=field.attr("name");var groupSize=form.find("input[name='"+groupname+"']:checked").size();if(groupSize=14&&numDigits<=16&&parseInt(cardNumber)>0){var sum=0,i=numDigits-1,pos=1,digit,luhn=new String();do{digit=parseInt(cardNumber.charAt(i));luhn+=(pos++%2==0)?digit*2:digit;}while(--i>=0) for(i=0;i');prompt.addClass(methods._getClassName(field.attr("id"))+"formError");prompt.addClass("parentForm"+methods._getClassName(field.closest('form, .validationEngineContainer').attr("id")));if(options.isWCAG){prompt.addClass("formErrorWCAG");prompt.attr("id",methods._getClassName(field.attr("id"))+"formError");field.attr("aria-describedby",methods._getClassName(field.attr("id"))+"formError");var promptContent=$('
').addClass("formErrorContent").html(promptText).appendTo(prompt);field.parent().addClass("hasErrorMsg").after(prompt);return prompt;}else{prompt.addClass("formError");prompt.attr("id",methods._getClassName(field.attr("id"))+"formError");field.attr("aria-describedby",methods._getClassName(field.attr("id"))+"formError");switch(type){case"pass":prompt.addClass("greenPopup");break;case"load":prompt.addClass("blackPopup");break;default:} if(ajaxed) prompt.addClass("ajaxed");var promptContent=$('
').addClass("formErrorContent").html(promptText).appendTo(prompt);var positionType=field.data("promptPosition")||options.promptPosition;if(options.showArrow){var arrow=$('
').addClass("formErrorArrow");if(typeof(positionType)=='string'){var pos=positionType.indexOf(":");if(pos!=-1) positionType=positionType.substring(0,pos);} switch(positionType){case"bottomLeft":case"bottomRight":prompt.find(".formErrorContent").before(arrow);arrow.addClass("formErrorArrowBottom").html('
');break;case"topLeft":case"topRight":arrow.html('
');prompt.append(arrow);break;}} if(options.addPromptClass) prompt.addClass(options.addPromptClass);var requiredOverride=field.attr('data-required-class');if(requiredOverride!==undefined){prompt.addClass(requiredOverride);}else{if(options.prettySelect){if($('#'+field.attr('id')).next().is('select')){var prettyOverrideClass=$('#'+field.attr('id').substr(options.usePrefix.length).substring(options.useSuffix.length)).attr('data-required-class');if(prettyOverrideClass!==undefined){prompt.addClass(prettyOverrideClass);}}}} prompt.css({"opacity":0});if(positionType==='inline'){prompt.addClass("inline");if(typeof field.attr('data-prompt-target')!=='undefined'&&$('#'+field.attr('data-prompt-target')).length>0){prompt.appendTo($('#'+field.attr('data-prompt-target')));}else{field.after(prompt);}}else{field.before(prompt);} var pos=methods._calculatePosition(field,prompt,options);prompt.css({'position':positionType==='inline'?'relative':'absolute',"top":pos.callerTopPosition,"left":pos.callerleftPosition,"marginTop":pos.marginTopSize,"opacity":0}).data("callerField",field);if(options.autoHidePrompt){setTimeout(function(){prompt.animate({"opacity":0},function(){prompt.closest('.formErrorOuter').remove();prompt.remove();});},options.autoHideDelay);} return prompt.animate({"opacity":0.87});}},_updatePrompt:function(field,prompt,promptText,type,ajaxed,options,noAnimation){if(prompt){if(typeof type!=="undefined"){if(type=="pass") prompt.addClass("greenPopup");else prompt.removeClass("greenPopup");if(type=="load") prompt.addClass("blackPopup");else prompt.removeClass("blackPopup");} if(ajaxed) prompt.addClass("ajaxed");else prompt.removeClass("ajaxed");prompt.find(".formErrorContent").html(promptText);if(!options.isWCAG){var pos=methods._calculatePosition(field,prompt,options);var css={"top":pos.callerTopPosition,"left":pos.callerleftPosition,"marginTop":pos.marginTopSize};if(noAnimation) prompt.css(css);else prompt.animate(css);}}},_closePrompt:function(field){var prompt=methods._getPrompt(field);if(prompt){if(prompt.siblings(".hasErrorMsg").length){prompt.siblings(".hasErrorMsg").removeClass("hasErrorMsg");prompt.stop().slideUp(function(){prompt.parent('.formErrorOuter').remove();field.removeAttr("aria-describedby");prompt.remove();});}else{field.removeAttr("aria-describedby");prompt.fadeTo("fast",0,function(){prompt.parent('.formErrorOuter').remove();prompt.remove();});}}},closePrompt:function(field){return methods._closePrompt(field);},_getPrompt:function(field){var formId=$(field).closest('form, .validationEngineContainer').attr('id');var className=methods._getClassName(field.attr("id"))+"formError";var match=$("."+methods._escapeExpression(className)+'.parentForm'+methods._getClassName(formId))[0];if(match) return $(match);},_escapeExpression:function(selector){return selector.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/g,"\\$1");},isRTL:function(field){var $document=$(document);var $body=$('body');var rtl=(field&&field.hasClass('rtl'))||(field&&(field.attr('dir')||'').toLowerCase()==='rtl')||$document.hasClass('rtl')||($document.attr('dir')||'').toLowerCase()==='rtl'||$body.hasClass('rtl')||($body.attr('dir')||'').toLowerCase()==='rtl';return Boolean(rtl);},_calculatePosition:function(field,promptElmt,options){var promptTopPosition,promptleftPosition,marginTopSize;var fieldWidth=field.width();var fieldLeft=field.position().left;var fieldTop=field.position().top;var fieldHeight=field.height();var promptHeight=promptElmt.height();promptTopPosition=promptleftPosition=0;marginTopSize=-promptHeight;var positionType=field.data("promptPosition")||options.promptPosition;var shift1="";var shift2="";var shiftX=0;var shiftY=0;if(typeof(positionType)=='string'){if(positionType.indexOf(":")!=-1){shift1=positionType.substring(positionType.indexOf(":")+1);positionType=positionType.substring(0,positionType.indexOf(":"));if(shift1.indexOf(",")!=-1){shift2=shift1.substring(shift1.indexOf(",")+1);shift1=shift1.substring(0,shift1.indexOf(","));shiftY=parseInt(shift2);if(isNaN(shiftY))shiftY=0;};shiftX=parseInt(shift1);if(isNaN(shift1))shift1=0;};};switch(positionType){default:case"topRight":promptleftPosition+=fieldLeft+fieldWidth-30;promptTopPosition+=fieldTop;break;case"topLeft":promptTopPosition+=fieldTop;promptleftPosition+=fieldLeft;break;case"centerRight":promptTopPosition=fieldTop+4;marginTopSize=0;promptleftPosition=fieldLeft+field.outerWidth(true)+5;break;case"centerLeft":promptleftPosition=fieldLeft-(promptElmt.width()+2);promptTopPosition=fieldTop+4;marginTopSize=0;break;case"bottomLeft":promptTopPosition=fieldTop+field.height()+5;marginTopSize=0;promptleftPosition=fieldLeft;break;case"bottomRight":promptleftPosition=fieldLeft+fieldWidth-30;promptTopPosition=fieldTop+field.height()+5;marginTopSize=0;break;case"inline":promptleftPosition=0;promptTopPosition=0;marginTopSize=0;};promptleftPosition+=shiftX;promptTopPosition+=shiftY;return{"callerTopPosition":promptTopPosition+"px","callerleftPosition":promptleftPosition+"px","marginTopSize":marginTopSize+"px"};},_saveOptions:function(form,options){if($.validationEngineLanguage) var allRules=$.validationEngineLanguage.allRules;else $.error("jQuery.validationEngine rules are not loaded, plz add localization files to the page");$.validationEngine.defaults.allrules=allRules;var userOptions=$.extend(true,{},$.validationEngine.defaults,options);form.data('jqv',userOptions);return userOptions;},_getClassName:function(className){if(className) return className.replace(/:/g,"_").replace(/\./g,"_");},_jqSelector:function(str){return str.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,'\\$1');},_condRequired:function(field,rules,i,options){var idx,dependingField;for(idx=(i+1);idx-1){Sys.Browser.agent=Sys.Browser.Chrome;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Chrome\/(\d+\.\d+)/)[1]);Sys.Browser.name="Chrome";Sys.Browser.hasDebuggerStatement=true}}else{if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version>10){HTMLAnchorElement.prototype.attachEvent=function(a,b){if(a.substr(0,2)=="on"){a=a.substr(2)}this.addEventListener(a,b,false)};HTMLAnchorElement.prototype.detachEvent=function(a,b){if(a.substr(0,2)=="on"){a=a.substr(2)}this.removeEventListener(a,b,false)}}}var DNN_HIGHLIGHT_COLOR="#9999FF";var COL_DELIMITER=String.fromCharCode(18);var ROW_DELIMITER=String.fromCharCode(17);var QUOTE_REPLACEMENT=String.fromCharCode(19);var KEY_LEFT_ARROW=37;var KEY_UP_ARROW=38;var KEY_RIGHT_ARROW=39;var KEY_DOWN_ARROW=40;var KEY_RETURN=13;var KEY_ESCAPE=27;Type.registerNamespace("dnn");dnn.extend=function(a,b){for(s in b){a[s]=b[s]}return a};dnn.extend(dnn,{apiversion:new Number("04.02"),pns:"",ns:"dnn",diagnostics:null,vars:null,dependencies:new Array(),isLoaded:false,delay:[],_delayedSet:null,getVars:function(){if(this.vars==null){var a=dnn.dom.getById("__dnnVariable");if(a!=null){if(a.value.indexOf("`")==0){a.value=a.value.substring(1).replace(/`/g,'"')}if(a.value.indexOf("__scdoff")!=-1){COL_DELIMITER="~|~";ROW_DELIMITER="~`~";QUOTE_REPLACEMENT="~!~"}}if(a!=null&&a.value.length>0){this.vars=Sys.Serialization.JavaScriptSerializer.deserialize(a.value)}else{this.vars=[]}}return this.vars},getVar:function(key,def){if(this.getVars()[key]!=null){var re=new RegExp(QUOTE_REPLACEMENT,"g");return this.getVars()[key].replace(re,'"')}return def},setVar:function(b,c){if(this.vars==null){this.getVars()}this.vars[b]=c;var a=dnn.dom.getById("__dnnVariable");if(a==null){a=dnn.dom.createElement("INPUT");a.type="hidden";a.id="__dnnVariable";dnn.dom.appendChild(dnn.dom.getByTagName("body")[0],a)}if(dnn.isLoaded){a.value=Sys.Serialization.JavaScriptSerializer.serialize(this.vars)}else{dnn._delayedSet={key:b,val:c}}return true},callPostBack:function(action){var postBack=dnn.getVar("__dnn_postBack");var data="";if(postBack.length>0){data+=action;for(var i=1;i").replace(/"/g,'"')},encode:function(a,c){var b=a;if(encodeURIComponent){b=encodeURIComponent(b)}else{b=escape(b)}if(c==false){return b}return b.replace(/%/g,"%25")},encodeHTML:function(a){return a.toString().replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/\"/g,""")},encodeJSON:function(a){return a.toString().replace(/&/g,"&").replace(//g,">").replace(/'/g,"\u0027").replace(/\"/g,""").replace(/\\/g,"\\\\")},evalJSON:function(a){return Sys.Serialization.JavaScriptSerializer.deserialize(a)},escapeForEval:function(a){return a.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\r/g,"").replace(/\n/g,"\\n").replace(/\./,"\\.")},getEnumByValue:function(a,b){for(var c in a){if(typeof(a[c])=="number"&&a[c]==b){return c}}},_onload:function(){dnn.isLoaded=true;if(dnn._delayedSet){dnn.setVar(dnn._delayedSet.key,dnn._delayedSet.val)}},addIframeMask:function(c){if(dnn.dom.browser.isType("ie")&&(c.previousSibling==null||c.previousSibling.nodeName.toLowerCase()!="iframe")){var a=document.createElement("iframe");c.parentNode.insertBefore(a,c);var b=c.getBoundingClientRect();a.style.position="absolute";a.style.left=c.offsetLeft+"px";a.style.top=c.offsetTop+"px";a.style.width=(b.right-b.left)+"px";a.style.height=(b.bottom-b.top)+"px";a.style.opacity="0";a.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";a.style.zIndex="-1";return a}return null},removeIframeMask:function(a){if(dnn.dom.browser.isType("ie")&&(a.previousSibling!=null&&a.previousSibling.nodeName.toLowerCase()=="iframe")){a.parentNode.removeChild(a.previousSibling)}}});dnn.delayObject=function(c,a,b){this.num=null;this.pfunc=c;this.context=a;this.type=b};dnn.delayObject.prototype={complete:function(){dnn.delay[this.type]=null;this.pfunc(this.context)}};dnn.delayObject.registerClass("dnn.delayObject");dnn.ScriptRequest=function(e,d,c){this.ctl=null;this.xmlhttp=null;this.src=null;this.text=null;if(e!=null&&e.length>0){var b=dnn.dom.scriptFile(e);var a=dnn.getVar(b+".resx","");if(a.length>0){this.src=a}else{this.src=e}}if(d!=null&&d.length>0){this.text=d}this.callBack=c;this.status="init";this.timeOut=5000;this._xmlhttpStatusChangeDelegate=dnn.createDelegate(this,this.xmlhttpStatusChange);this._statusChangeDelegate=dnn.createDelegate(this,this.statusChange);this._completeDelegate=dnn.createDelegate(this,this.complete);this._reloadDelegate=dnn.createDelegate(this,this.reload)};dnn.ScriptRequest.prototype={load:function(){this.status="loading";this.ctl=document.createElement("script");this.ctl.type="text/javascript";if(this.src!=null){if(dnn.dom.browser.isType(dnn.dom.browser.Safari)){this.xmlhttp=new XMLHttpRequest();this.xmlhttp.open("GET",this.src,true);this.xmlhttp.onreadystatechange=this._xmlhttpStatusChangeDelegate;this.xmlhttp.send(null);return}else{if(dnn.dom.browser.isType(dnn.dom.browser.InternetExplorer)){this.ctl.onreadystatechange=this._statusChangeDelegate}else{if(dnn.dom.browser.isType(dnn.dom.browser.Opera)==false){this.ctl.onload=this._completeDelegate}}this.ctl.src=this.src}dnn.dom.scriptElements[this.src]=this.ctl}else{if(dnn.dom.browser.isType(dnn.dom.browser.Safari)){this.ctl.innerHTML=dnn.encodeHTML(this.text)}else{this.ctl.text=this.text}}var a=dnn.dom.getByTagName("HEAD");if(a){if(dnn.dom.browser.isType(dnn.dom.browser.Opera)==false||this.src!=null){a[0].appendChild(this.ctl)}}else{alert("Cannot load dynamic script, no HEAD tag present.")}if(this.src==null||dnn.dom.browser.isType(dnn.dom.browser.Opera)){this.complete()}else{if(this.timeOut){dnn.doDelay("loadScript_"+this.src,this.timeOut,this._reloadDelegate,null)}}},xmlhttpStatusChange:function(){if(this.xmlhttp.readyState!=4){return}this.src=null;this.text=this.xmlhttp.responseText;this.load()},statusChange:function(){if((this.ctl.readyState=="loaded"||this.ctl.readyState=="complete")&&this.status!="complete"){this.complete()}},reload:function(){if(dnn.dom.scriptStatus(this.src)=="complete"){this.complete()}else{this.load()}},complete:function(){dnn.cancelDelay("loadScript_"+this.src);this.status="complete";if(typeof(this.callBack)!="undefined"){this.callBack(this)}this.dispose()},dispose:function(){this.callBack=null;if(this.ctl){if(this.ctl.onreadystatechange){this.ctl.onreadystatechange=new function(){}}else{if(this.ctl.onload){this.ctl.onload=null}}this.ctl=null}this.xmlhttp=null;this._xmlhttpStatusChangeDelegate=null;this._statusChangeDelegate=null;this._completeDelegate=null;this._reloadDelegate=null}};dnn.ScriptRequest.registerClass("dnn.ScriptRequest");Type.registerNamespace("dnn.dom");dnn.extend(dnn.dom,{pns:"dnn",ns:"dom",browser:null,__leakEvts:[],scripts:[],scriptElements:[],tweens:[],attachEvent:function(a,c,d){if(a.addEventListener){var b=c.substring(2);a.addEventListener(b,function(e){dnn.dom.event=new dnn.dom.eventObject(e,e.target);return d()},false)}else{a.attachEvent(c,function(){dnn.dom.event=new dnn.dom.eventObject(window.event,window.event.srcElement);return d()})}return true},cursorPos:function(b){if(b.value.length==0){return 0}var h=-1;if(b.selectionStart){h=b.selectionStart}else{if(b.createTextRange){var f=window.document.selection.createRange();var a=b.createTextRange();if(a==null||f==null||((f.text!="")&&a.inRange(f)==false)){return-1}if(f.text==""){if(a.boundingLeft==f.boundingLeft){h=0}else{var d=b.tagName.toLowerCase();if(d=="input"){var g=a.text;var c=1;while(c0){b.style.height=(b.offsetHeight-d).toString()+"px";dnn.doDelay(b.id+"col",10,dnn.dom.__collapseElement,a)}else{b.style.display="none";if(a.pfunc!=null){a.pfunc()}}},cancelExpandElement:function(a){dnn.cancelDelay(a.id+"exp");a.style.overflow="";a.style.height=""},disableTextSelect:function(a){if(typeof a.onselectstart!="undefined"){a.onselectstart=function(){return false}}else{if(typeof a.style.MozUserSelect!="undefined"){a.style.MozUserSelect="none"}else{a.onmousedown=function(){return false}}}},expandElement:function(b,c,d){if(c==null){c=10}if(b.style.display=="none"&&b.origHeight==null){b.style.display="";b.style.overflow="";b.origHeight=b.offsetHeight;b.style.overflow="hidden";b.style.height="1px"}b.style.display="";var a=new Object();a.num=c;a.ctl=b;a.pfunc=d;dnn.dom.__expandElement(a)},__expandElement:function(a){var c=a.num;var b=a.ctl;var d=b.origHeight/c;if(b.offsetHeight+d=0;a--){var b=dnn.dom.__leakEvts[a];b.ctl.detachEvent(b.name,b.ptr);b.ctl[b.name]=null;dnn.dom.__leakEvts.length=dnn.dom.__leakEvts.length-1}},getObjMethref:function(b,a){return(function(c){c=c||window.event;return b[a](c,this)})},getSibling:function(a,c){if(a!=null&&a.parentNode!=null){for(var b=0;b-1){this.scriptElements[c]=a[b];return a[b]}}},getScriptSrc:function(b){var a=dnn.getVar(b+".resx","");if(a.length>0){return a}return b},getScriptPath:function(){var a=dnn.dom.getScript("dnn.js");if(a){var b=a.src;if(b.indexOf("?")>-1){b=b.substr(0,b.indexOf("?"))}return b.replace("dnn.js","")}var c=dnn.getVar("__sp");if(c){return c}return""},scriptFile:function(b){var a=b.split("/");return a[a.length-1]},loadScript:function(e,d,b){var c;if(e!=null&&e.length>0){c=this.scriptFile(e);if(this.scripts[c]!=null){return}}var a=new dnn.ScriptRequest(e,d,b);if(c){this.scripts[c]=a}a.load();return a},loadScripts:function(a,b,c){if(dnn.scripts==null){var e=function(f,g,h){return(function(){dnn.dom.loadScripts(f,g,h)})};dnn.dom.loadScript(dnn.dom.getScriptPath()+"dnn.scripts.js",null,e(a,b,c));return}var d=new dnn.scripts.ScriptBatchRequest(a,b,c);d.load()},scriptStatus:function(c){var b=this.scriptFile(c);if(this.scripts[b]){return this.scripts[b].status}var a=this.getScript(c);if(a!=null){return"complete"}else{return""}},setScriptLoaded:function(b){var a=this.scriptFile(b);if(this.scripts[a]&&dnn.dom.scripts[a].status!="complete"){dnn.dom.scripts[a].complete()}},navigate:function(b,a){if(a!=null&&a.length>0){if(a=="_blank"||a=="_new"){window.open(b)}else{document.frames[a].location.href=b}}else{if(Sys.Browser.agent===Sys.Browser.InternetExplorer){window.navigate(b)}else{window.location.href=b}}return false},setCookie:function(b,f,h,e,d,c,a){var g;if(h){g=new Date();g.setTime(g.getTime()+(h*24*60*60*1000))}if(a){g=new Date();g.setTime(g.getTime()+(a))}document.cookie=b+"="+escape(f)+((g)?"; expires="+g.toGMTString():"")+((e)?"; path="+e:"")+((d)?"; domain="+d:"")+((c)?"; secure":"");if(document.cookie.length>0){return true}},getCurrentStyle:function(b,c){var a=Sys.UI.DomElement._getCurrentStyle(b);if(a){return a[c]}return""},getFormPostString:function(a){var c="";if(a!=null){if(a.tagName&&a.tagName.toLowerCase()=="form"){for(var b=0;b-1},_attach:function(a,b){a=$(a);if(a.hasClass(this._getMarker())){return}a.addClass(this._getMarker());b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c);this._postAttach(a,c);this.option(a,b)},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||'';f=f.replace(/'/g,'"');f=f.replace(/([a-zA-Z0-9]+):/g,function(a,b,i){var c=f.substring(0,i).match(/"/g);return(!c||c.length%2===0?'"'+b+'":':b+':')});f=$.parseJSON('{'+f+'}');for(var g in f){var h=f[g];if(typeof h==='string'&&h.match(/^new Date\((.*)\)$/)){f[g]=eval(h)}}return f}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||(typeof b==='string'&&c==null)){var e=(d||{}).options;return(e&&b?e[b]:e)}if(!a.hasClass(this._getMarker())){return}var e=b||{};if(typeof b==='string'){e={};e[b]=c}this._optionsChanged(a,d,e);$.extend(d.options,e)},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}this._preDestroy(a,this._getInst(a));a.removeData(this.name).removeClass(this._getMarker())},_preDestroy:function(a,b){}});function camelCase(c){return c.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}$.JQPlugin={createPlugin:function(a,b){if(typeof a==='object'){b=a;a='JQPlugin'}a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b);new JQClass.classes[c]()}}})(jQuery); /* http://keith-wood.name/datepick.html Date picker for jQuery v5.0.1. Written by Keith Wood (kbwood{at}iinet.com.au) February 2010. Licensed under the MIT (http://keith-wood.name/licence.html) licence. Please attribute the author if you use it. */ (function($){var E='datepick';$.JQPlugin.createPlugin({name:E,defaultRenderer:{picker:'
'+'
{link:prev}{link:today}{link:next}
{months}'+'{popup:start}
{link:clear}{link:close}
{popup:end}'+'
',monthRow:'
{months}
',month:'
{monthHeader}
'+'{weekHeader}{weeks}
',weekHeader:'{days}',dayHeader:'{day}',week:'{days}',day:'{day}',monthSelector:'.datepick-month',daySelector:'td',rtlClass:'datepick-rtl',multiClass:'datepick-multi',defaultClass:'',selectedClass:'datepick-selected',highlightedClass:'datepick-highlight',todayClass:'datepick-today',otherMonthClass:'datepick-other-month',weekendClass:'datepick-weekend',commandClass:'datepick-cmd',commandButtonClass:'',commandLinkClass:'',disabledClass:'datepick-disabled'},commands:{prev:{text:'prevText',status:'prevStatus',keystroke:{keyCode:33},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),1-a.options.monthsToStep,'m'),a),1),-1,'d').getTime()>=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),-a.options.monthsToStep,'m'),a),1)},action:function(a){F.changeMonth(this,-a.options.monthsToStep)}},prevJump:{text:'prevJumpText',status:'prevJumpStatus',keystroke:{keyCode:33,ctrlKey:true},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),1-a.options.monthsToJump,'m'),a),1),-1,'d').getTime()>=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),-a.options.monthsToJump,'m'),a),1)},action:function(a){F.changeMonth(this,-a.options.monthsToJump)}},next:{text:'nextText',status:'nextStatus',keystroke:{keyCode:34},enabled:function(a){var b=a.get('maxDate');return(!b||F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToStep,'m'),a),1).getTime()<=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToStep,'m'),a),1)},action:function(a){F.changeMonth(this,a.options.monthsToStep)}},nextJump:{text:'nextJumpText',status:'nextJumpStatus',keystroke:{keyCode:34,ctrlKey:true},enabled:function(a){var b=a.get('maxDate');return(!b||F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToJump,'m'),a),1).getTime()<=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToJump,'m'),a),1)},action:function(a){F.changeMonth(this,a.options.monthsToJump)}},current:{text:'currentText',status:'currentStatus',keystroke:{keyCode:36,ctrlKey:true},enabled:function(a){var b=a.curMinDate();var c=a.get('maxDate');var d=a.selectedDates[0]||F.today();return(!b||d.getTime()>=b.getTime())&&(!c||d.getTime()<=c.getTime())},date:function(a){return a.selectedDates[0]||F.today()},action:function(a){var b=a.selectedDates[0]||F.today();F.showMonth(this,b.getFullYear(),b.getMonth()+1)}},today:{text:'todayText',status:'todayStatus',keystroke:{keyCode:36,ctrlKey:true},enabled:function(a){var b=a.curMinDate();var c=a.get('maxDate');return(!b||F.today().getTime()>=b.getTime())&&(!c||F.today().getTime()<=c.getTime())},date:function(a){return F.today()},action:function(a){F.showMonth(this)}},clear:{text:'clearText',status:'clearStatus',keystroke:{keyCode:35,ctrlKey:true},enabled:function(a){return true},date:function(a){return null},action:function(a){F.clear(this)}},close:{text:'closeText',status:'closeStatus',keystroke:{keyCode:27},enabled:function(a){return true},date:function(a){return null},action:function(a){F.hide(this)}},prevWeek:{text:'prevWeekText',status:'prevWeekStatus',keystroke:{keyCode:38,ctrlKey:true},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.newDate(a.drawDate),-7,'d').getTime()>=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),-7,'d')},action:function(a){F.changeDay(this,-7)}},prevDay:{text:'prevDayText',status:'prevDayStatus',keystroke:{keyCode:37,ctrlKey:true},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.newDate(a.drawDate),-1,'d').getTime()>=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),-1,'d')},action:function(a){F.changeDay(this,-1)}},nextDay:{text:'nextDayText',status:'nextDayStatus',keystroke:{keyCode:39,ctrlKey:true},enabled:function(a){var b=a.get('maxDate');return(!b||F.add(F.newDate(a.drawDate),1,'d').getTime()<=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),1,'d')},action:function(a){F.changeDay(this,1)}},nextWeek:{text:'nextWeekText',status:'nextWeekStatus',keystroke:{keyCode:40,ctrlKey:true},enabled:function(a){var b=a.get('maxDate');return(!b||F.add(F.newDate(a.drawDate),7,'d').getTime()<=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),7,'d')},action:function(a){F.changeDay(this,7)}}},defaultOptions:{pickerClass:'',showOnFocus:true,showTrigger:null,showAnim:'show',showOptions:{},showSpeed:'normal',popupContainer:null,alignment:'bottom',fixedWeeks:false,firstDay:0,calculateWeek:null,monthsToShow:1,monthsOffset:0,monthsToStep:1,monthsToJump:12,useMouseWheel:true,changeMonth:true,yearRange:'c-10:c+10',shortYearCutoff:'+10',showOtherMonths:false,selectOtherMonths:false,defaultDate:null,selectDefaultDate:false,minDate:null,maxDate:null,dateFormat:'mm/dd/yyyy',autoSize:false,rangeSelect:false,rangeSeparator:' - ',multiSelect:0,multiSeparator:',',onDate:null,onShow:null,onChangeMonthYear:null,onSelect:null,onClose:null,altField:null,altFormat:null,constrainInput:true,commandsAsDateFormat:false,commands:{}},regionalOptions:{'':{monthNames:['January','February','March','April','May','June','July','August','September','October','November','December'],monthNamesShort:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],dayNames:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],dayNamesShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],dayNamesMin:['Su','Mo','Tu','We','Th','Fr','Sa'],dateFormat:'mm/dd/yyyy',firstDay:0,renderer:{},prevText:'<Prev',prevStatus:'Show the previous month',prevJumpText:'<<',prevJumpStatus:'Show the previous year',nextText:'Next>',nextStatus:'Show the next month',nextJumpText:'>>',nextJumpStatus:'Show the next year',currentText:'Current',currentStatus:'Show the current month',todayText:'Today',todayStatus:'Show today\'s month',clearText:'Clear',clearStatus:'Clear all the dates',closeText:'Close',closeStatus:'Close the datepicker',yearStatus:'Change the year',earlierText:'  ▲',laterText:'  ▼',monthStatus:'Change the month',weekText:'Wk',weekStatus:'Week of the year',dayStatus:'Select DD, M d, yyyy',defaultStatus:'Select a date',isRTL:false}},_getters:['getDate','isDisabled','isSelectable','retrieveDate'],_disabled:[],_popupClass:E+'-popup',_triggerClass:E+'-trigger',_disableClass:E+'-disable',_monthYearClass:E+'-month-year',_curMonthClass:E+'-month-',_anyYearClass:E+'-any-year',_curDoWClass:E+'-dow-',_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*10000000),_msPerDay:24*60*60*1000,ATOM:'yyyy-mm-dd',COOKIE:'D, dd M yyyy',FULL:'DD, MM d, yyyy',ISO_8601:'yyyy-mm-dd',JULIAN:'J',RFC_822:'D, d M yy',RFC_850:'DD, dd-M-yy',RFC_1036:'D, d M yy',RFC_1123:'D, d M yyyy',RFC_2822:'D, d M yyyy',RSS:'D, d M yy',TICKS:'!',TIMESTAMP:'@',W3C:'yyyy-mm-dd',formatDate:function(f,g,h){if(typeof f!=='string'){h=g;g=f;f=''}if(!g){return''}f=f||this.defaultOptions.dateFormat;h=h||{};var i=h.dayNamesShort||this.defaultOptions.dayNamesShort;var j=h.dayNames||this.defaultOptions.dayNames;var k=h.monthNamesShort||this.defaultOptions.monthNamesShort;var l=h.monthNames||this.defaultOptions.monthNames;var m=h.calculateWeek||this.defaultOptions.calculateWeek;var n=function(a,b){var c=1;while(s+c1};var o=function(a,b,c,d){var e=''+b;if(n(a,d)){while(e.length1};var w=function(a,b){var c=v(a,b);var d=[2,3,c?4:2,11,20]['oy@!'.indexOf(a)+1];var e=new RegExp('^-?\\d{1,'+d+'}');var f=h.substring(z).match(e);if(!f){throw'Missing number at position {0}'.replace(/\{0\}/,z);}z+=f[0].length;return parseInt(f[0],10);};var x=function(a,b,c,d){var e=(v(a,d)?c:b);for(var i=0;i-1){q=1;r=s;for(var D=this.daysInMonth(p,q);r>D;D=this.daysInMonth(p,q)){q++;r-=D;}}var C=this.newDate(p,q,r);if(C.getFullYear()!==p||C.getMonth()+1!==q||C.getDate()!==r){throw'Invalid date';}return C;},determineDate:function(f,g,h,i,j){if(h&&typeof h!=='object'){j=i;i=h;h=null;}if(typeof i!=='string'){j=i;i='';}var k=function(a){try{return F.parseDate(i,a,j);}catch(e){}a=a.toLowerCase();var b=(a.match(/^c/)&&h?F.newDate(h):null)||F.today();var c=/([+-]?[0-9]+)\s*(d|w|m|y)?/g;var d=null;while(d=c.exec(a)){b=F.add(b,parseInt(d[1],10),d[2]||'d');}return b;};g=(g?F.newDate(g):null);f=(f==null?g:(typeof f==='string'?k(f):(typeof f==='number'?(isNaN(f)||f===Infinity||f===-Infinity?g:F.add(F.today(),f,'d')):F.newDate(f))));return f;},daysInMonth:function(a,b){b=(a.getFullYear?a.getMonth()+1:b);a=(a.getFullYear?a.getFullYear():a);return this.newDate(a,b+1,0).getDate();},dayOfYear:function(a,b,c){var d=(a.getFullYear?a:F.newDate(a,b,c));var e=F.newDate(d.getFullYear(),1,1);return Math.floor((d.getTime()-e.getTime())/F._msPerDay)+1;},iso8601Week:function(a,b,c){var d=(a.getFullYear?new Date(a.getTime()):F.newDate(a,b,c));d.setDate(d.getDate()+4-(d.getDay()||7));var e=d.getTime();d.setMonth(0,1);return Math.floor(Math.round((e-d)/F._msPerDay)/7)+1;},today:function(){return this._normaliseDate(new Date());},newDate:function(a,b,c){return(!a?null:(a.getFullYear?this._normaliseDate(new Date(a.getTime())):new Date(a,b-1,c,12)));},_normaliseDate:function(a){if(a){a.setHours(12,0,0,0);}return a;},year:function(a,b){a.setFullYear(b);return this._normaliseDate(a);},month:function(a,b){a.setMonth(b-1);return this._normaliseDate(a);},day:function(a,b){a.setDate(b);return this._normaliseDate(a);},add:function(a,b,c){if(c==='d'||c==='w'){this._normaliseDate(a);a.setDate(a.getDate()+b*(c==='w'?7:1));}else{var d=a.getFullYear()+(c==='y'?b:0);var e=a.getMonth()+(c==='m'?b:0);a.setTime(F.newDate(d,e+1,Math.min(a.getDate(),this.daysInMonth(d,e+1))).getTime());}return a;},_applyMonthsOffset:function(a,b){var c=b.options.monthsOffset;if($.isFunction(c)){c=c.apply(b.elem[0],[a]);}return F.add(a,-c,'m');},_init:function(){this.defaultOptions.commands=this.commands;this.defaultOptions.calculateWeek=this.iso8601Week;this.regionalOptions[''].renderer=this.defaultRenderer;this._super();},_instSettings:function(b,c){return{selectedDates:[],drawDate:null,pickingRange:false,inline:($.inArray(b[0].nodeName.toLowerCase(),['div','span'])>-1),get:function(a){if($.inArray(a,['defaultDate','minDate','maxDate'])>-1){return F.determineDate(this.options[a],null,this.selectedDates[0],this.options.dateFormat,this.getConfig());}return this.options[a];},curMinDate:function(){return(this.pickingRange?this.selectedDates[0]:this.get('minDate'));},getConfig:function(){return{dayNamesShort:this.options.dayNamesShort,dayNames:this.options.dayNames,monthNamesShort:this.options.monthNamesShort,monthNames:this.options.monthNames,calculateWeek:this.options.calculateWeek,shortYearCutoff:this.options.shortYearCutoff};}};},_postAttach:function(a,b){if(b.inline){b.drawDate=F._checkMinMax(F.newDate(b.selectedDates[0]||b.get('defaultDate')||F.today()),b);b.prevDate=F.newDate(b.drawDate);this._update(a[0]);if($.fn.mousewheel){a.mousewheel(this._doMouseWheel);}}else{this._attachments(a,b);a.on('keydown.'+b.name,this._keyDown).on('keypress.'+b.name,this._keyPress).on('keyup.'+b.name,this._keyUp);if(a.attr('disabled')){this.disable(a[0]);}}},_optionsChanged:function(b,c,d){if(d.calendar&&d.calendar!==c.options.calendar){var e=function(a){return(typeof c.options[a]==='object'?null:c.options[a]);};d=$.extend({defaultDate:e('defaultDate'),minDate:e('minDate'),maxDate:e('maxDate')},d);c.selectedDates=[];c.drawDate=null;}var f=c.selectedDates;$.extend(c.options,d);this.setDate(b[0],f,null,false,true);c.pickingRange=false;c.drawDate=F.newDate(this._checkMinMax((c.options.defaultDate?c.get('defaultDate'):c.drawDate)||c.get('defaultDate')||F.today(),c));if(!c.inline){this._attachments(b,c);}if(c.inline||c.div){this._update(b[0]);}},_attachments:function(a,b){a.off('focus.'+b.name);if(b.options.showOnFocus){a.on('focus.'+b.name,this.show);}if(b.trigger){b.trigger.remove();}var c=b.options.showTrigger;b.trigger=(!c?$([]):$(c).clone().removeAttr('id').addClass(this._triggerClass)[b.options.isRTL?'insertBefore':'insertAfter'](a).click(function(){if(!F.isDisabled(a[0])){F[F.curInst===b?'hide':'show'](a[0]);}}));this._autoSize(a,b);var d=this._extractDates(b,a.val());if(d){this.setDate(a[0],d,null,true);}var e=b.get('defaultDate');if(b.options.selectDefaultDate&&e&&b.selectedDates.length===0){this.setDate(a[0],F.newDate(e||F.today()));}},_autoSize:function(d,e){if(e.options.autoSize&&!e.inline){var f=F.newDate(2009,10,20);var g=e.options.dateFormat;if(g.match(/[DM]/)){var h=function(a){var b=0;var c=0;for(var i=0;ib){b=a[i].length;c=i;}}return c;};f.setMonth(h(e.options[g.match(/MM/)?'monthNames':'monthNamesShort']));f.setDate(h(e.options[g.match(/DD/)?'dayNames':'dayNamesShort'])+20-f.getDay());}e.elem.attr('size',F.formatDate(g,f,e.getConfig()).length);}},_preDestroy:function(a,b){if(b.trigger){b.trigger.remove();}a.empty().off('.'+b.name);if(b.inline&&$.fn.mousewheel){a.unmousewheel();}if(!b.inline&&b.options.autoSize){a.removeAttr('size');}},multipleEvents:function(b){var c=arguments;return function(a){for(var i=0;i
').find('button,select').prop('disabled',true).end().find('a').removeAttr('href');}else{b.prop('disabled',true);c.trigger.filter('button.'+this._triggerClass).prop('disabled',true).end().filter('img.'+this._triggerClass).css({opacity:'0.5',cursor:'default'});}this._disabled=$.map(this._disabled,function(a){return(a===b[0]?null:a);});this._disabled.push(b[0]);},isDisabled:function(a){return(a&&$.inArray(a,this._disabled)>-1);},show:function(a){a=$(a.target||a);var b=F._getInst(a);if(F.curInst===b){return;}if(F.curInst){F.hide(F.curInst,true);}if(!$.isEmptyObject(b)){b.lastVal=null;b.selectedDates=F._extractDates(b,a.val());b.pickingRange=false;b.drawDate=F._checkMinMax(F.newDate(b.selectedDates[0]||b.get('defaultDate')||F.today()),b);b.prevDate=F.newDate(b.drawDate);F.curInst=b;F._update(a[0],true);var c=F._checkOffset(b);b.div.css({left:c.left,top:c.top});var d=b.options.showAnim;var e=b.options.showSpeed;e=(e==='normal'&&$.ui&&parseInt($.ui.version.substring(2))>=8?'_default':e);if($.effects&&($.effects[d]||($.effects.effect&&$.effects.effect[d]))){var f=b.div.data();for(var g in f){if(g.match(/^ec\.storage\./)){f[g]=b._mainDiv.css(g.replace(/ec\.storage\./,''));}}b.div.data(f).show(d,b.options.showOptions,e);}else{b.div[d||'show'](d?e:0);}}},_extractDates:function(a,b){if(b===a.lastVal){return;}a.lastVal=b;b=b.split(a.options.multiSelect?a.options.multiSeparator:(a.options.rangeSelect?a.options.rangeSeparator:'\x00'));var c=[];for(var i=0;i
').addClass(this._popupClass).css({display:(b?'none':'static'),position:'absolute',left:a.offset().left,top:a.offset().top+a.outerHeight()}).appendTo($(c.options.popupContainer||'body'));if($.fn.mousewheel){c.div.mousewheel(this._doMouseWheel);}}c.div.html(this._generateContent(a[0],c));a.focus();}}},_updateInput:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)){var d='';var e='';var f=(c.options.multiSelect?c.options.multiSeparator:c.options.rangeSeparator);var g=c.options.altFormat||c.options.dateFormat;for(var i=0;i0?f:'')+F.formatDate(c.options.dateFormat,c.selectedDates[i],c.getConfig()));e+=(i>0?f:'')+F.formatDate(g,c.selectedDates[i],c.getConfig());}if(!c.inline&&!b){$(a).val(d);}$(c.options.altField).val(e);if($.isFunction(c.options.onSelect)&&!b&&!c.inSelect){c.inSelect=true;c.options.onSelect.apply(a,[c.selectedDates]);c.inSelect=false;}}},_getBorders:function(b){var c=function(a){return{thin:1,medium:3,thick:5}[a]||a;};return[parseFloat(c(b.css('border-left-width'))),parseFloat(c(b.css('border-top-width')))];},_checkOffset:function(a){var b=(a.elem.is(':hidden')&&a.trigger?a.trigger:a.elem);var c=b.offset();var d=$(window).width();var e=$(window).height();if(d===0){return c;}var f=false;$(a.elem).parents().each(function(){f|=$(this).css('position')==='fixed';return!f;});var g=document.documentElement.scrollLeft||document.body.scrollLeft;var h=document.documentElement.scrollTop||document.body.scrollTop;var i=c.top-(f?h:0)-a.div.outerHeight();var j=c.top-(f?h:0)+b.outerHeight();var k=c.left-(f?g:0);var l=c.left-(f?g:0)+b.outerWidth()-a.div.outerWidth();var m=(c.left-g+a.div.outerWidth())>d;var n=(c.top-h+a.elem.outerHeight()+a.div.outerHeight())>e;a.div.css('position',f?'fixed':'absolute');var o=a.options.alignment;if(o==='topLeft'){c={left:k,top:i};}else if(o==='topRight'){c={left:l,top:i};}else if(o==='bottomLeft'){c={left:k,top:j};}else if(o==='bottomRight'){c={left:l,top:j};}else if(o==='top'){c={left:(a.options.isRTL||m?l:k),top:i};}else{c={left:(a.options.isRTL||m?l:k),top:(n?i:j)};}c.left=Math.max((f?0:g),c.left);c.top=Math.max((f?0:h),c.top);return c;},_checkExternalClick:function(a){if(!F.curInst){return;}var b=$(a.target);if(b.closest('.'+F._popupClass+',.'+F._triggerClass).length===0&&!b.hasClass(F._getMarker())){F.hide(F.curInst);}},hide:function(a,b){if(!a){return;}var c=this._getInst(a);if($.isEmptyObject(c)){c=a;}if(c&&c===F.curInst){var d=(b?'':c.options.showAnim);var e=c.options.showSpeed;e=(e==='normal'&&$.ui&&parseInt($.ui.version.substring(2))>=8?'_default':e);var f=function(){if(!c.div){return;}c.div.remove();c.div=null;F.curInst=null;if($.isFunction(c.options.onClose)){c.options.onClose.apply(a,[c.selectedDates]);}};c.div.stop();if($.effects&&($.effects[d]||($.effects.effect&&$.effects.effect[d]))){c.div.hide(d,c.options.showOptions,e,f);}else{var g=(d==='slideDown'?'slideUp':(d==='fadeIn'?'fadeOut':'hide'));c.div[g]((d?e:''),f);}if(!d){f();}}},_keyDown:function(a){var b=(a.data&&a.data.elem)||a.target;var c=F._getInst(b);var d=false;if(c.inline||c.div){if(a.keyCode===9){F.hide(b);}else if(a.keyCode===13){F.selectDate(b,$('a.'+c.options.renderer.highlightedClass,c.div)[0]);d=true;}else{var e=c.options.commands;for(var f in e){var g=e[f];if(g.keystroke.keyCode===a.keyCode&&!!g.keystroke.ctrlKey===!!(a.ctrlKey||a.metaKey)&&!!g.keystroke.altKey===a.altKey&&!!g.keystroke.shiftKey===a.shiftKey){F.performAction(b,f);d=true;break;}}}}else{var g=c.options.commands.current;if(g.keystroke.keyCode===a.keyCode&&!!g.keystroke.ctrlKey===!!(a.ctrlKey||a.metaKey)&&!!g.keystroke.altKey===a.altKey&&!!g.keystroke.shiftKey===a.shiftKey){F.show(b);d=true;}}c.ctrlKey=((a.keyCode<48&&a.keyCode!==32)||a.ctrlKey||a.metaKey);if(d){a.preventDefault();a.stopPropagation();}return!d;},_keyPress:function(a){var b=F._getInst((a.data&&a.data.elem)||a.target);if(!$.isEmptyObject(b)&&b.options.constrainInput){var c=String.fromCharCode(a.keyCode||a.charCode);var d=F._allowedChars(b);return(a.metaKey||b.ctrlKey||c<' '||!d||d.indexOf(c)>-1);}return true;},_allowedChars:function(a){var b=(a.options.multiSelect?a.options.multiSeparator:(a.options.rangeSelect?a.options.rangeSeparator:''));var c=false;var d=false;var e=a.options.dateFormat;for(var i=0;i0){F.setDate(b,d,null,true);}}catch(a){}}return true;},_doMouseWheel:function(a,b){var c=(F.curInst&&F.curInst.elem[0])||$(a.target).closest('.'+F._getMarker())[0];if(F.isDisabled(c)){return;}var d=F._getInst(c);if(d.options.useMouseWheel){b=(b<0?-1:+1);F.changeMonth(c,-d.options[a.ctrlKey?'monthsToJump':'monthsToStep']*b);}a.preventDefault();},clear:function(a){var b=this._getInst(a);if(!$.isEmptyObject(b)){b.selectedDates=[];this.hide(a);var c=b.get('defaultDate');if(b.options.selectDefaultDate&&c){this.setDate(a,F.newDate(c||F.today()));}else{this._updateInput(a);}}},getDate:function(a){var b=this._getInst(a);return(!$.isEmptyObject(b)?b.selectedDates:[]);},setDate:function(a,b,c,d,e){var f=this._getInst(a);if(!$.isEmptyObject(f)){if(!$.isArray(b)){b=[b];if(c){b.push(c);}}var g=f.get('minDate');var h=f.get('maxDate');var k=f.selectedDates[0];f.selectedDates=[];for(var i=0;i=g.getTime())&&(!h||l.getTime()<=h.getTime())){var m=false;for(var j=0;jf.selectedDates[1].getTime()?f.selectedDates[0]:f.selectedDates[1]);break;}f.pickingRange=false;}f.prevDate=(f.drawDate?F.newDate(f.drawDate):null);f.drawDate=this._checkMinMax(F.newDate(f.selectedDates[0]||f.get('defaultDate')||F.today()),f);if(!e){this._update(a);this._updateInput(a,d);}}},isSelectable:function(a,b){var c=this._getInst(a);if($.isEmptyObject(c)){return false;}b=F.determineDate(b,c.selectedDates[0]||this.today(),null,c.options.dateFormat,c.getConfig());return this._isSelectable(a,b,c.options.onDate,c.get('minDate'),c.get('maxDate'));},_isSelectable:function(a,b,c,d,e){var f=(typeof c==='boolean'?{selectable:c}:(!$.isFunction(c)?{}:c.apply(a,[b,true])));return(f.selectable!==false)&&(!d||b.getTime()>=d.getTime())&&(!e||b.getTime()<=e.getTime());},performAction:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)&&!this.isDisabled(a)){var d=c.options.commands;if(d[b]&&d[b].enabled.apply(a,[c])){d[b].action.apply(a,[c]);}}},showMonth:function(a,b,c,d){var e=this._getInst(a);if(!$.isEmptyObject(e)&&(d!=null||(e.drawDate.getFullYear()!==b||e.drawDate.getMonth()+1!==c))){e.prevDate=F.newDate(e.drawDate);var f=this._checkMinMax((b!=null?F.newDate(b,c,1):F.today()),e);e.drawDate=F.newDate(f.getFullYear(),f.getMonth()+1,(d!=null?d:Math.min(e.drawDate.getDate(),F.daysInMonth(f.getFullYear(),f.getMonth()+1))));this._update(a);}},changeMonth:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)){var d=F.add(F.newDate(c.drawDate),b,'m');this.showMonth(a,d.getFullYear(),d.getMonth()+1);}},changeDay:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)){var d=F.add(F.newDate(c.drawDate),b,'d');this.showMonth(a,d.getFullYear(),d.getMonth()+1,d.getDate());}},_checkMinMax:function(a,b){var c=b.get('minDate');var d=b.get('maxDate');a=(c&&a.getTime()d.getTime()?F.newDate(d):a);return a;},retrieveDate:function(a,b){var c=this._getInst(a);return($.isEmptyObject(c)?null:this._normaliseDate(new Date(parseInt(b.className.replace(/^.*dp(-?\d+).*$/,'$1'),10))));},selectDate:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)&&!this.isDisabled(a)){var d=this.retrieveDate(a,b);if(c.options.multiSelect){var e=false;for(var i=0;i'+(g?F.formatDate(i.options[f.text],g,i.getConfig()):i.options[f.text])+'');};for(var r in i.options.commands){q('button','button type="button"','button',r,i.options.renderer.commandButtonClass);q('link','a href="javascript:void(0)"','a',r,i.options.renderer.commandLinkClass);}p=$(p);if(j[1]>1){var s=0;$(i.options.renderer.monthSelector,p).each(function(){var a=++s%j[1];$(this).addClass(a===1?'first':(a===0?'last':''));});}var t=this;function removeHighlight(){(i.inline?$(this).closest('.'+t._getMarker()):i.div).find(i.options.renderer.daySelector+' a').removeClass(i.options.renderer.highlightedClass);}p.find(i.options.renderer.daySelector+' a').hover(function(){removeHighlight.apply(this);$(this).addClass(i.options.renderer.highlightedClass);},removeHighlight).click(function(){t.selectDate(h,this);}).end().find('select.'+this._monthYearClass+':not(.'+this._anyYearClass+')').change(function(){var a=$(this).val().split('/');t.showMonth(h,parseInt(a[1],10),parseInt(a[0],10));}).end().find('select.'+this._anyYearClass).click(function(){$(this).css('visibility','hidden').next('input').css({left:this.offsetLeft,top:this.offsetTop,width:this.offsetWidth,height:this.offsetHeight}).show().focus();}).end().find('input.'+t._monthYearClass).change(function(){try{var a=parseInt($(this).val(),10);a=(isNaN(a)?i.drawDate.getFullYear():a);t.showMonth(h,a,i.drawDate.getMonth()+1,i.drawDate.getDate());}catch(e){alert(e);}}).keydown(function(a){if(a.keyCode===13){$(a.elem).change();}else if(a.keyCode===27){$(a.elem).hide().prev('select').css('visibility','visible');i.elem.focus();}});var u={elem:i.elem[0]};p.keydown(u,this._keyDown).keypress(u,this._keyPress).keyup(u,this._keyUp);p.find('.'+i.options.renderer.commandClass).click(function(){if(!$(this).hasClass(i.options.renderer.disabledClass)){var a=this.className.replace(new RegExp('^.*'+i.options.renderer.commandClass+'-([^ ]+).*$'),'$1');F.performAction(h,a);}});if(i.options.isRTL){p.addClass(i.options.renderer.rtlClass);}if(j[0]*j[1]>1){p.addClass(i.options.renderer.multiClass);}if(i.options.pickerClass){p.addClass(i.options.pickerClass);}$('body').append(p);var v=0;p.find(i.options.renderer.monthSelector).each(function(){v+=$(this).outerWidth();});p.width(v/j[0]);if($.isFunction(i.options.onShow)){i.options.onShow.apply(h,[p,i]);}return p;},_generateMonth:function(a,b,c,d,e,f){var g=F.daysInMonth(c,d);var h=b.options.monthsToShow;h=($.isArray(h)?h:[1,h]);var j=b.options.fixedWeeks||(h[0]*h[1]>1);var k=b.options.firstDay;var l=(F.newDate(c,d,1).getDay()-k+7)%7;var m=(j?6:Math.ceil((l+g)/7));var n=b.options.selectOtherMonths&&b.options.showOtherMonths;var o=(b.pickingRange?b.selectedDates[0]:b.get('minDate'));var p=b.get('maxDate');var q=e.week.indexOf('{weekOfYear}')>-1;var r=F.today();var s=F.newDate(c,d,1);F.add(s,-l-(j&&(s.getDay()===k)?7:0),'d');var t=s.getTime();var u='';for(var v=0;v'+($.isFunction(b.options.calculateWeek)?b.options.calculateWeek(s):0)+'');var x='';for(var y=0;y<7;y++){var z=false;if(b.options.rangeSelect&&b.selectedDates.length>0){z=(s.getTime()>=b.selectedDates[0]&&s.getTime()<=b.selectedDates[1]);}else{for(var i=0;i'+(b.options.showOtherMonths||(s.getMonth()+1)===d?A.content||s.getDate():' ')+(B?'':''));F.add(s,1,'d');t=s.getTime();}u+=this._prepare(e.week,b).replace(/\{days\}/g,x).replace(/\{weekOfYear\}/g,w);}var C=this._prepare(e.month,b).match(/\{monthHeader(:[^\}]+)?\}/);C=(C[0].length<=13?'MM yyyy':C[0].substring(13,C[0].length-1));C=(f?this._generateMonthSelection(b,c,d,o,p,C,e):F.formatDate(C,F.newDate(c,d,1),b.getConfig()));var D=this._prepare(e.weekHeader,b).replace(/\{days\}/g,this._generateDayHeaders(b,e));return this._prepare(e.month,b).replace(/\{monthHeader(:[^\}]+)?\}/g,C).replace(/\{weekHeader\}/g,D).replace(/\{weeks\}/g,u);},_generateDayHeaders:function(a,b){var c='';for(var d=0;d<7;d++){var e=(d+a.options.firstDay)%7;c+=this._prepare(b.dayHeader,a).replace(/\{day\}/g,''+a.options.dayNamesMin[e]+'');}return c;},_generateMonthSelection:function(b,c,d,e,f,g){if(!b.options.changeMonth){return F.formatDate(g,F.newDate(c,d,1),b.getConfig());}var h=b.options['monthNames'+(g.match(/mm/i)?'':'Short')];var i=g.replace(/m+/i,'\\x2E').replace(/y+/i,'\\x2F');var j='';i=i.replace(/\\x2E/,j);var k=b.options.yearRange;if(k==='any'){j=''+'';}else{k=k.split(':');var l=F.today().getFullYear();var n=(k[0].match('c[+-].*')?c+parseInt(k[0].substring(1),10):((k[0].match('[+-].*')?l:0)+parseInt(k[0],10)));var o=(k[1].match('c[+-].*')?c+parseInt(k[1].substring(1),10):((k[1].match('[+-].*')?l:0)+parseInt(k[1],10)));j='