function sack(file){this.xmlhttp=null,this.resetData=function(){this.method="POST",this.queryStringSeparator="?",this.argumentSeparator="&",this.URLString="",this.encodeURIString=!0,this.execute=!1,this.element=null,this.elementObj=null,this.requestFile=file,this.vars=new Object,this.responseStatus=new Array(2)},this.resetFunctions=function(){this.onLoading=function(){},this.onLoaded=function(){},this.onInteractive=function(){},this.onCompletion=function(){},this.onError=function(){},this.onFail=function(){}},this.reset=function(){this.resetFunctions(),this.resetData()},this.createAJAX=function(){try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){this.xmlhttp=null}}this.xmlhttp||("undefined"!=typeof XMLHttpRequest?this.xmlhttp=new XMLHttpRequest:this.failed=!0)},this.setVar=function(a,b){this.vars[a]=Array(b,!1)},this.encVar=function(a,b,c){return 1==c?Array(encodeURIComponent(a),encodeURIComponent(b)):(this.vars[encodeURIComponent(a)]=Array(encodeURIComponent(b),!0),void 0)},this.processURLString=function(a,b){for(encoded=encodeURIComponent(this.argumentSeparator),regexp=new RegExp(this.argumentSeparator+"|"+encoded),varArray=a.split(regexp),i=0;i1&&(callerType=="radio"||callerType=="checkbox")){caller=$("input[name='"+callerName+"'][type!=hidden]:first");$.validationEngine.showTriangle=false;}} function _required(caller,rules){callerType=$(caller).attr("type");if(callerType=="text"||callerType=="password"||callerType=="textarea"){if(!$(caller).val()){$.validationEngine.isError=true;promptText+=$.validationEngine.settings.allrules[rules[i]].alertText+"
";}} if(callerType=="radio"||callerType=="checkbox"){callerName=$(caller).attr("name");if($("input[name='"+callerName+"']:checked").size()==0){$.validationEngine.isError=true;if($("input[name='"+callerName+"']").size()==1){promptText+=$.validationEngine.settings.allrules[rules[i]].alertTextCheckboxe+"
";}else{promptText+=$.validationEngine.settings.allrules[rules[i]].alertTextCheckboxMultiple+"
";}}} if(callerType=="select-one"){if(!$(caller).val()){$.validationEngine.isError=true;promptText+=$.validationEngine.settings.allrules[rules[i]].alertText+"
";}} if(callerType=="select-multiple"){if(!$(caller).find("option:selected").val()){$.validationEngine.isError=true;promptText+=$.validationEngine.settings.allrules[rules[i]].alertText+"
";}}} function _customRegex(caller,rules,position){customRule=rules[position+1];pattern=eval($.validationEngine.settings.allrules[customRule].regex);if(!pattern.test($(caller).attr('value'))){$.validationEngine.isError=true;promptText+=$.validationEngine.settings.allrules[customRule].alertText+"
";}} function _exemptString(caller,rules,position){customString=rules[position+1];if(customString==$(caller).attr('value')){$.validationEngine.isError=true;promptText+=$.validationEngine.settings.allrules['required'].alertText+"
";}} function _funcCall(caller,rules,position){customRule=rules[position+1];funce=$.validationEngine.settings.allrules[customRule].nname;var fn=window[funce];if(typeof(fn)==='function'){var fn_result=fn();if(!fn_result){$.validationEngine.isError=true;} promptText+=$.validationEngine.settings.allrules[customRule].alertText+"
";}} function _ajax(caller,rules,position){customAjaxRule=rules[position+1];postfile=$.validationEngine.settings.allrules[customAjaxRule].file;fieldValue=$(caller).val();ajaxCaller=caller;fieldId=$(caller).attr("id");ajaxValidate=true;ajaxisError=$.validationEngine.isError;if($.validationEngine.settings.allrules[customAjaxRule].extraData){extraData=$.validationEngine.settings.allrules[customAjaxRule].extraData;}else{extraData="";} if(!ajaxisError){$.ajax({type:"POST",url:postfile,async:true,data:"validateValue="+fieldValue+"&validateId="+fieldId+"&validateError="+customAjaxRule+"&extraData="+extraData,beforeSend:function(){if($.validationEngine.settings.allrules[customAjaxRule].alertTextLoad){if(!$("div."+fieldId+"formError")[0]){return $.validationEngine.buildPrompt(ajaxCaller,$.validationEngine.settings.allrules[customAjaxRule].alertTextLoad,"load");}else{$.validationEngine.updatePromptText(ajaxCaller,$.validationEngine.settings.allrules[customAjaxRule].alertTextLoad,"load");}}},error:function(data,transport){$.validationEngine.debug("error in the ajax: "+data.status+" "+transport)},success:function(data){data=eval("("+data+")");ajaxisError=data.jsonValidateReturn[2];customAjaxRule=data.jsonValidateReturn[1];ajaxCaller=$("#"+data.jsonValidateReturn[0])[0];fieldId=ajaxCaller;ajaxErrorLength=$.validationEngine.ajaxValidArray.length;existInarray=false;if(ajaxisError=="false"){_checkInArray(false) if(!existInarray){$.validationEngine.ajaxValidArray[ajaxErrorLength]=new Array(2);$.validationEngine.ajaxValidArray[ajaxErrorLength][0]=fieldId;$.validationEngine.ajaxValidArray[ajaxErrorLength][1]=false;existInarray=false;} $.validationEngine.ajaxValid=false;promptText+=$.validationEngine.settings.allrules[customAjaxRule].alertText+"
";$.validationEngine.updatePromptText(ajaxCaller,promptText,"",true);}else{_checkInArray(true);$.validationEngine.ajaxValid=true;if(!customAjaxRule){$.validationEngine.debug("wrong ajax response, are you on a server or in xampp? if not delete de ajax[ajaxUser] validating rule from your form ")} if($.validationEngine.settings.allrules[customAjaxRule].alertTextOk){$.validationEngine.updatePromptText(ajaxCaller,$.validationEngine.settings.allrules[customAjaxRule].alertTextOk,"pass",true);}else{ajaxValidate=false;$.validationEngine.closePrompt(ajaxCaller);}} function _checkInArray(validate){for(x=0;x";}} function _length(caller,rules,position){startLength=eval(rules[position+1]);endLength=eval(rules[position+2]);feildLength=$(caller).attr('value').length;if(feildLengthendLength){$.validationEngine.isError=true;promptText+=$.validationEngine.settings.allrules["length"].alertText+startLength+$.validationEngine.settings.allrules["length"].alertText2+endLength+$.validationEngine.settings.allrules["length"].alertText3+"
"}} function _maxCheckbox(caller,rules,position){nbCheck=eval(rules[position+1]);groupname=$(caller).attr("name");groupSize=$("input[name='"+groupname+"']:checked").size();if(groupSize>nbCheck){$.validationEngine.showTriangle=false;$.validationEngine.isError=true;promptText+=$.validationEngine.settings.allrules["maxCheckbox"].alertText+"
";}} function _minCheckbox(caller,rules,position){nbCheck=eval(rules[position+1]);groupname=$(caller).attr("name");groupSize=$("input[name='"+groupname+"']:checked").size();if(groupSize";}} return($.validationEngine.isError)?$.validationEngine.isError:false;},submitForm:function(caller){if($.validationEngine.settings.ajaxSubmit){if($.validationEngine.settings.ajaxSubmitExtraData){extraData=$.validationEngine.settings.ajaxSubmitExtraData;}else{extraData="";} $.ajax({type:"POST",url:$.validationEngine.settings.ajaxSubmitFile,async:true,data:$(caller).serialize()+"&"+extraData,error:function(data,transport){$.validationEngine.debug("error in the ajax: "+data.status+" "+transport)},success:function(data){if(data=="true"){$(caller).css("opacity",1) $(caller).animate({opacity:0,height:0},function(){$(caller).css("display","none");$(caller).before("

"+$.validationEngine.settings.ajaxSubmitMessage+"
");$.validationEngine.closePrompt(".formError",true);$(".ajaxSubmit").show("slow");if($.validationEngine.settings.success){$.validationEngine.settings.success&&$.validationEngine.settings.success();return false;}})}else{data=eval("("+data+")");if(!data.jsonValidateReturn){$.validationEngine.debug("you are not going into the success fonction and jsonValidateReturn return nothing");} errorNumber=data.jsonValidateReturn.length for(index=0;index
');} if($.validationEngine.settings.promptPosition=="topLeft"||$.validationEngine.settings.promptPosition=="topRight"){$(divFormError).append(arrow);$(arrow).html('
');}} $(formErrorContent).html(promptText) var calculatedPosition=$.validationEngine.calculatePosition(caller,promptText,type,ajaxed,divFormError) calculatedPosition.callerTopPosition+="px";calculatedPosition.callerleftPosition+="px";calculatedPosition.marginTopSize+="px" $(divFormError).css({"top":calculatedPosition.callerTopPosition,"left":calculatedPosition.callerleftPosition,"marginTop":calculatedPosition.marginTopSize,"opacity":0}) return $(divFormError).animate({"opacity":0.87},function(){return true;});},updatePromptText:function(caller,promptText,type,ajaxed){linkTofield=$.validationEngine.linkTofield(caller);var updateThisPrompt="."+linkTofield;if(type=="pass"){$(updateThisPrompt).addClass("greenPopup")}else{$(updateThisPrompt).removeClass("greenPopup")};if(type=="load"){$(updateThisPrompt).addClass("blackPopup")}else{$(updateThisPrompt).removeClass("blackPopup")};if(ajaxed){$(updateThisPrompt).addClass("ajaxed")}else{$(updateThisPrompt).removeClass("ajaxed")};$(updateThisPrompt).find(".formErrorContent").html(promptText);var calculatedPosition=$.validationEngine.calculatePosition(caller,promptText,type,ajaxed,updateThisPrompt) calculatedPosition.callerTopPosition+="px";calculatedPosition.callerleftPosition+="px";calculatedPosition.marginTopSize+="px" $(updateThisPrompt).animate({"top":calculatedPosition.callerTopPosition,"marginTop":calculatedPosition.marginTopSize});},calculatePosition:function(caller,promptText,type,ajaxed,divFormError){if($.validationEngine.settings.containerOverflow){callerTopPosition=0;callerleftPosition=0;callerWidth=$(caller).width();inputHeight=$(divFormError).height();var marginTopSize="-"+inputHeight;}else{callerTopPosition=$(caller).offset().top;callerleftPosition=$(caller).offset().left;callerWidth=$(caller).width();inputHeight=$(divFormError).height();var marginTopSize=0;} if($.validationEngine.settings.promptPosition=="topRight"){if($.validationEngine.settings.containerOverflow){callerleftPosition+=callerWidth-30;}else{callerleftPosition+=callerWidth-30;callerTopPosition+=-inputHeight;}} if($.validationEngine.settings.promptPosition=="topLeft"){callerTopPosition+=-inputHeight-10;} if($.validationEngine.settings.promptPosition=="centerRight"){callerleftPosition+=callerWidth+13;} if($.validationEngine.settings.promptPosition=="bottomLeft"){callerHeight=$(caller).height();callerTopPosition=callerTopPosition+callerHeight+15;} if($.validationEngine.settings.promptPosition=="bottomRight"){callerHeight=$(caller).height();callerleftPosition+=callerWidth-30;callerTopPosition+=callerHeight+5;} return{"callerTopPosition":callerTopPosition,"callerleftPosition":callerleftPosition,"marginTopSize":marginTopSize}},linkTofield:function(caller){var linkTofield=$(caller).attr("id")+"formError";linkTofield=linkTofield.replace(/\[/g,"");linkTofield=linkTofield.replace(/\]/g,"");return linkTofield;},closePrompt:function(caller,outside){if(!$.validationEngine.settings){$.validationEngine.defaultSetting()} if(outside){$(caller).fadeTo("fast",0,function(){$(caller).remove();});return false;} if(typeof(ajaxValidate)=='undefined'){ajaxValidate=false} if(!ajaxValidate){linkTofield=$.validationEngine.linkTofield(caller);closingPrompt="."+linkTofield;$(closingPrompt).fadeTo("fast",0,function(){$(closingPrompt).remove();});}},debug:function(error){if(!$("#debugMode")[0]){$("body").append("
This is a debug mode, you got a problem with your form, it will try to help you, refresh when you think you nailed down the problem
");} $(".debugError").append("
"+error+"
");},submitValidation:function(caller){var stopForm=false;$.validationEngine.ajaxValid=true;var toValidateSize=$(caller).find("[class*=validate]").size();$(caller).find("[class*=validate]").each(function(){linkTofield=$.validationEngine.linkTofield(this);if(!$("."+linkTofield).hasClass("ajaxed")){var validationPass=$.validationEngine.loadValidation(this);return(validationPass)?stopForm=true:"";};});ajaxErrorLength=$.validationEngine.ajaxValidArray.length;for(x=0;xtestDestination)destination=$(this).offset().top;}) $("html:not(:animated),body:not(:animated)").animate({scrollTop:destination},1100);}else{var destination=$(".formError:not('.greenPopup'):first").offset().top;var scrollContainerScroll=$($.validationEngine.settings.containerOverflowDOM).scrollTop();var scrollContainerPos=-parseInt($($.validationEngine.settings.containerOverflowDOM).offset().top);var destination=scrollContainerScroll+destination+scrollContainerPos-5 var scrollContainer=$.validationEngine.settings.containerOverflowDOM+":not(:animated)" $(scrollContainer).animate({scrollTop:destination},1100);}} return true;}else{return false;}}}})(jQuery);;$(document).ready(function() {setLastColumnClass($(".postBlocks .blockItem"),2);setEqualHeight($(".postBlocks .blockItem .blockItemContent"),2);$('.footer_menu_block ul ul li:last-child').addClass('last');$('.commentList li').append("");$('.topNav li ul').parent().addClass('sub-menu-parent');var $activeItem=$('.topNav > .current-menu-ancestor').length?$('.topNav > .current-menu-ancestor'):$('.topNav > .current-menu-item');$(".topNav > li").hover(function(){if(!$(this).hasClass('current-menu-ancestor')&&!$(this).hasClass('current-menu-item')){$activeItem.removeClass('current-menu-ancestor');$activeItem.removeClass('current-menu-item');}},function(){if(!$(this).hasClass('current-menu-ancestor')&&!$(this).hasClass('current-menu-item')){$activeItem.addClass('current-menu-ancestor');}});});function setEqualHeight(columns,colCount) {var rowCount=Math.ceil(columns.length/colCount);for(var i=0;itallestcolumn){tallestcolumn=currentHeight;}} for(var j=i*colCount;j