var OE={},UrlVars,WEEdSiteCommon;$(document).ready(function(){OE.CssEvents.initialize();$.ajaxSetup({cache:!1})});$.fn.preloadImg=function(){var n=[];this.each(function(){n.push($("").attr("src",this))})};typeof jQuery.uaMatch=="undefined"&&(jQuery.uaMatch=function(n){n=n.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];return{browser:t[1]||"",version:t[2]||"0"}});jQuery.browser||(matched=jQuery.uaMatch(navigator.userAgent),browser={},matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0),jQuery.browser=browser);String.prototype.trim=function(){return this.replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,"")};String.prototype.startsWith=function(n){return this.match("^"+n)==n};String.prototype.endsWith=function(n){return this.match(n+"$")==n};UrlVars={};window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(n,t,i){i.indexOf("#")>0&&(i=i.substr(0,i.indexOf("#")));UrlVars[t]=i});OE.Common={getLocString:function(n){var t=WEInfoPage.Culture;for(var i in n.Items)if(t&&i.toLowerCase()==t.toLowerCase())return n.Items[i];return n.Items.DEFAULT},setLocString:function(n,t){var i=WEInfoPage.Culture;for(var r in n.Items)if(i&&r.toLowerCase()==i.toLowerCase()){n.Items[r]=t;return}n.Items.DEFAULT=t},stopPrpg:function(n){return n=n||window.event,n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation(),!1},htmlEncode:function(n){return n?$("
").text(n).html():""},htmlDecode:function(n){return n?$("
").html(n).text():""}};OE.Common.Link={getPath:function(n){var t=OE.Common.getLocString(n.Links);return OE.Common.Link._convertToRelative(t)},getHref:function(n,t){var i="_top",r;t!=null&&(i=t.Target);switch(i){case"_popup":return r="this.href,'',"+t.PopupWidth+","+t.PopupHeight+","+t.PopupTop+","+t.PopupLeft+",'toolbar="+this._boolToHtml(t.PopupToolbar)+",location="+this._boolToHtml(t.PopupLocation)+",directories="+this._boolToHtml(t.PopupDirectories)+",menubar="+this._boolToHtml(t.PopupMenubar)+",status="+this._boolToHtml(t.PopupStatus)+",scrollbars="+this._boolToHtml(t.PopupScrollbars)+",resizable="+this._boolToHtml(t.PopupResizable)+"'",'onclick="return OE.Navigate.popup(event,'+r+')" href="'+n+'"';case"_blank":return'href="'+n+'" onclick="return OE.Navigate.blank(event, this.href)"';default:return'href="'+n+'"'}},_boolToHtml:function(n){return n==!0?"yes":"no"},_convertToRelative:function(n){return n.startsWith("file:///")?n:n.startsWith("http://")||n.startsWith("https://")?n:n!=""?WEInfoPage.RelativePath+n:""}};WEEdSiteCommon={GetLocalizableString:OE.Common.getLocString,LinkGetPath:OE.Common.Link.getPath};OE.CssEvents={initialize:function(){OE.CssEvents.load();$("div.BaseDiv").each(function(){OE.CssEvents.loadGlobal($(this));$.browser.msie&&parseInt($.browser.version)==7&&OE.CssEvents._autoHeightHack($(this))})},loadGlobal:function(n){var i=n.find(".OESZG_"+n.attr("id")+".OEGd"),t;(i.length>0||n.hasClass("OEGd"))&&(n.bind("mouseup.CssEvents",function(){i.add($(this)).removeClass("OE_Down")}),n.bind("mousedown.CssEvents",function(){i.add($(this)).addClass("OE_Down")}));t=n.find(".OESZG_"+n.attr("id")+".OEGo");(t.length>0||n.hasClass("OEGo"))&&(n.bind("mouseenter.CssEvents",function(){t.add($(this)).addClass("OE_Over")}),n.bind("mouseleave.CssEvents",function(){t.add($(this)).removeClass("OE_Over OE_Down")}))},removeGlobal:function(n,t,i){WEInfoPage.RenderMode=="Editor"?(n.hasClass(i)&&n.removeClass(i),t.each(function(){$(this).hasClass(i)&&$(this).removeClass(i)})):t.add(n).removeClass(i)},loadAll:function(){OE.CssEvents.load();$("div.BaseDiv").each(function(){OE.CssEvents.loadGlobal($(this))})},unLoadAll:function(){$(".OEd, .OEo, .OEGd, .OEGo").unbind(".CssEvents").removeClass("OE_Down OE_Over")},load:function(){var t=$(".OEd"),n;t.bind("mouseup.CssEvents",function(){$(this).removeClass("OE_Down")});t.bind("mousedown.CssEvents",function(){$(this).addClass("OE_Down")});n=$(".OEo");n.bind("mouseenter.CssEvents",function(){$(this).addClass("OE_Over")});n.bind("mouseleave.CssEvents",function(){$(this).removeClass("OE_Over OE_Down")})},_autoHeightHack:function(n){n.each(function(){var n=$(this).innerHeight();$(this).children("div").each(function(){var i=$(this).css("bottom"),t;i!="auto"&&(t=parseInt(i)+parseInt($(this).css("top")),t>0?$(this).height(n-t):$(this).height(n+Math.abs(t)))})})}};OE.Text={ExecutionOnlyOnline:"Unable to perform this action from openElement.\r\nYou must publish your page online.",NoResponse:"An error was encountered while sending email!<br /> Please try again later or contact the server administrator.",NoPHP:"Unable to perform this action.\r\nPHP is not installed on your web server. \r\nPlease contact your host to activate it.\r\n\r\nNote: If uploading outside of openElement, enter your PHP version in Preferences, 'Advanced' tab. Then re-save this page before uploading it.",NoMailFunction:"The form was not sent!
The PHP function 'mail()' is not active on this web server.
Please contact your host to activate it.",NoMailSend:"The form was not sent
Contact the server administrator : Function PHP Mail() failed",FormNotConfigure:"Attention, the element 'SendMail' has not been configured in openElement.\r\nYou must configure it to enable email form submission.",NoUploadRight:"Unable to move imported file.\r\nThe upload folder cannot be created or does not have write permissions.\r\nYou can configure this folder in your upload settings or contact your web host to modify permissions for this folder.",ErrorSize:"Incorrect file size.",ErrorExtension:"Invalid file format. <br />Executable files are not allowed.",OnlineOnly:"Online only.",ExceptionValidator:"Unable to use the customized regular expression in the form validation."};switch(WEInfoPage.LanguageCode){case"FR":OE.Text={ExecutionOnlyOnline:"Impossible d'exécuter cette action depuis openElement.\r\nVous devez mettre en ligne votre page.",NoResponse:"Une erreur est survenue lors de l'envoi de l'e-mail !<br /> Veuillez réessayer ultérieurement ou contacter l'administrateur du serveur.",NoPHP:"Impossible d'exécuter cette action.\r\nLe PHP n'est pas installé sur votre hébergement. \r\nVeuillez contacter votre hébergeur pour l'activer.\r\n\r\nRemarque : En cas de mise en ligne hors openElement, saisissez votre version de PHP dans les préférences, onglet avancées. Puis réenregistrez cette page avant de la remettre en ligne.",NoMailFunction:"Le formulaire n'a pas pu être envoyé<br />La fonction PHP 'mail()' n'est pas active sur cet hébergement. <br />Veuillez contacter votre hébergeur pour l'activer.",NoMailSend:"Le formulaire n'a pas été envoyé\r\n<br />Contacter l'administrateur du serveur : Echec de la fonction PHP Mail()\r\n",FormNotConfigure:"Attention, L'élément "SendMail" n'a pas été configuré dans openElement.\r\nVous devez le configurer pour permettre l'envoie du formulaire par e-mail.",NoUploadRight:"Impossible de déplacer le fichier importé.\r\nLe répertoire d'Upload ne peut pas être crée ou ne possede pas les droits d'écriture.\r\nVous pouvez configurer ce réperoire dans vos paramètres de mise en ligne ou contacter votre hébergeur pour modifier les droits de ce répertoire.",ErrorSize:"Taille du fichier incorrecte.",ErrorExtension:"Format du fichier incorrect. <br />Les fichiers executables sont interdits.",OnlineOnly:"En ligne uniquement.",ExceptionValidator:"Impossible d'utiliser l'expression régulière personnalisée dans la validation du formulaire."}}OE.Form={_copyRadioChecked:function(n,t){if(n&&t)for(var i=0;i").attr({action:"#",method:"post",enctype:"multipart/form-data"}),f.css("display","none").appendTo($("body")),s=!1,o=0;o").attr({type:"hidden",name:n,value:t}).appendTo(f)}),i&&f.attr("action",i),f}};OE.Form.Validator={_keyUpTimeOut:null,initialize:function(n){for(id in n){var t=$("#"+id),i=t.find(":input")||t,r=i.last();r.bind("focusin",function(){var n=$(this).parents(".BaseDiv:first()");n.data("Validated_Focus",!0);n.hasClass("Validate")&&OE.Form.Validator._showErrorTip()});r.bind("focusout",function(){$(this).parents(".BaseDiv:first()").data("Validated_Focus",!1)});i.bind("keyup mouseup",function(){clearTimeout(OE.Form.Validator._keyUpTimeOut);OE.Form.Validator._keyUpTimeOut=setTimeout(function(n){var t=n.parents(".BaseDiv:first()");t.hasClass("Validate")&&(OE.Form.Validator._validateItem(t,n.fieldValue()),OE.Form.Validator._showErrorTip())},200,$(this))})}},validate:function(n,t){var u=!0,f=!0,r,i,e;for(r in n)typeof t!="undefined"&&t!=""&&$("#"+r+t).length>0&&(r+=t),i=$("#"+r),i.addClass("Validate"),OE.Form.Validator._validateItem(i)||(u=!1,f&&(e=i.find(":input:last")||i,e.focus(),f=!1));return u||OE.Loading.close(),u},_validateItem:function(n){var i,t,u,f,r,e;try{if(typeof WEEdValidators=="undefined"||(i=n.find(":input")||n,i.length<1)||(t=i.fieldValue(),t instanceof Array&&(t=t.length?t[0]:""),i.hasClass("defaultText")&&(t=""),i.is("[disabled]")||!i.is(":visible")))return!0;n.data("Validated",!0);u=this._findRule(n);f=0;for(f in u)if(r=u[f],r){n.data("Validated_Rule",r);try{e=new RegExp(r.Expression)}catch(o){return alert(OE.Common.htmlDecode(OE.Text.ExceptionValidator)+":\n "+r.Expression),!1}if(e.test(t))n.data("Validated_State",1),this._RemoveStylesZoneError(n);else return n.data("Validated_State",0),this._AddStylesZoneError(n),!1}}catch(o){alert("Error : "+o)}return!0},_findRule:function(n){for(var t in WEEdValidators)if(t==n.attr("ID"))return WEEdValidators[t]},_isOldVersion:function(n){return n.hasClass("OEWETextBox")||n.hasClass("OEWECheckBox")||n.hasClass("OEWEListBox")||n.hasClass("OEWERadioButtonList")||n.hasClass("OEWETextArea")||n.hasClass("OEWEUploadFiles")?!0:!1},_showErrorTip:function(){var n=null;if($(".BaseDiv.Validate").each(function(){var t=$(this),r=t.data("Validated_State"),f=t.data("Validated_Focus"),i,u;OE.Form.Validator._isOldVersion(t)?(i=t.find(".OEErrorIcone"),r==0?i.show():i.hide()):r==0?f==!0?n=t:n==null&&(n=t):(u=t.find(":input:last")||t,OE.ToolTip.hide("Form",u))}),n!=null){var t=n.find(":input:last")||n,i=n.data("Validated_Rule"),r="
<\/div>"+i.MsgError;OE.ToolTip.add("Form",t,r,{showOn:null,delay:0,target:!0,targetJoint:"bottom left",hideTrigger:"closeButton"});OE.ToolTip.show("Form",t)}},_AddStylesZoneError:function(n){var t,i;if(n.hasClass("OEWETextBoxV2")){if(t=n.find(".OESZ_TextBox"),t.length){i=t.css("width");i||(i="100%");t.addClass("OESZ_TextBoxError");try{t.css("width")!=="100%"&&t.css("width",i)}catch(r){}}return}if(n.hasClass("OEWETextAreaV2")){n.find(".OESZ_TextArea").addClass("OESZ_TextAreaError");return}if(n.hasClass("OEWEListBoxV2")){n.find(".OESZ_ListBox").addClass("OESZ_ListBoxError");return}if(n.hasClass("OEWEUploadFilesV2")){n.find(".OESZ_InputFile").addClass("OESZ_InputFileError");return}if(n.hasClass("OEWERadioButtonListV2")){n.find(".OESZ_RadioButton").addClass("OESZ_RadioButtonError");return}if(n.hasClass("OEWECheckBoxV2")){n.find(".OESZ_DivContent").addClass("OESZ_CheckBoxError");return}},_RemoveStylesZoneError:function(n){if(n.hasClass("OEWETextBoxV2")){n.find(".OESZ_TextBox").removeClass("OESZ_TextBoxError");return}if(n.hasClass("OEWETextAreaV2")){n.find(".OESZ_TextArea").removeClass("OESZ_TextAreaError");return}if(n.hasClass("OEWEListBoxV2")){n.find(".OESZ_ListBox").removeClass("OESZ_ListBoxError");return}if(n.hasClass("OEWEUploadFilesV2")){n.find(".OESZ_InputFile").removeClass("OESZ_InputFileError");return}if(n.hasClass("OEWERadioButtonListV2")){n.find(".OESZ_RadioButton").removeClass("OESZ_RadioButtonError");return}if(n.hasClass("OEWECheckBoxV2")){n.find(".OESZ_DivContent").removeClass("OESZ_CheckBoxError");return}}};OE.Navigate={popup:function(n,t,i,r,u,f,e,o){return r<=0&&(r=screen.width/2),u<=0&&(u=screen.height/2),f<=0&&(f=(screen.height-u)/2),e<=0&&(e=(screen.width-r)/2),window.open(t,i,"top="+f+",left="+e+",width="+r+",height="+u+","+o),OE.Common.stopPrpg(n)},blank:function(n,t){return window.open(t,"_blank"),OE.Common.stopPrpg(n)},open:function(n,t,i){switch(i){case 1:document.location=t;break;case 2:top.location.href=t}return OE.Common.stopPrpg(n)}};OE.ToolTip={add:function(n,t,i,r){if(!this.update(n,t,i)){r=r||{showOn:"mouseover",delay:.1};r.group=n;r.closeButtonOffset=[3,3];var u=new Opentip(t,i,r);t.data("Tip"+n,u)}},update:function(n,t,i){var r=t.data("Tip"+n);return r?(r.setContent(i),!0):!1},deactivate:function(n,t){var i=t.data("Tip"+n);return i?(i.deactivate(),!0):!1},activate:function(n,t){var i=t.data("Tip"+n);return i?(i.activate(),!0):!1},show:function(n,t){var i=t.data("Tip"+n);return i?(i.show(),!0):!1},hide:function(n,t){var i=t.data("Tip"+n);return i?(i.hide(),!0):!1},hideAll:function(){for(var n=0;n
<\/div><\/div>",$("body").append(t),n=$("#OELoading")):n.show();OE.Loading._updateSizeAndPosition(n);$(window).bind("resize.OELoading",function(){OE.Loading._updateSizeAndPosition(n)});$(window).bind("scroll.OELoading",function(){OE.Loading._updateSizeAndPosition(n)})},close:function(){$("#OELoading").hide();$(window).unbind(".OELoading")},_updateSizeAndPosition:function(n){n.css({left:$(window).scrollLeft(),top:$(window).scrollTop()})}};OE.ModalPopup={show:function(n){var t,i;n=n.replace("\n","
");t=$("body").children("#ModalPopup");t.length===0?(i="
",i+="
",i+="
<\/div>",i+="
<\/div>",i+="
<\/div>",i+="<\/div>",i+="<\/div>",$("body").append(i),t=$("#ModalPopup")):t.show();var r=t.children("#ModalPopupBlock"),u=r.children("#ModalPopupBlockClose"),f=r.children("#ModalPopupBlockContent");this._updateSizeAndPosition(t,r);$(window).bind("resize.OEPopupModal",function(){OE.ModalPopup._updateSizeAndPosition(t,r)});$(window).bind("scroll.OEPopupModal",function(){OE.ModalPopup._updateSizeAndPosition(t,r)});f.html(n);u.click(function(){OE.ModalPopup.close()});$("#ModalPopupBlockFooter input").click(function(){OE.ModalPopup.close()})},_updateSizeAndPosition:function(n,t){n.css({left:$(window).scrollLeft(),top:$(window).scrollTop()});t.css({left:(n.width()-t.width())/2,top:(n.height()-t.height())/2})},close:function(){$("#ModalPopup").hide();$(window).unbind(".OEPopupModal")}};OE.GETools={addCustomClassToElement:function(n,t){this.toggleCustomClassForElements(n,t,!0)},removeCustomClassFromElement:function(n,t){this.toggleCustomClassForElements(n,t,!1)},toggleCustomClassForElements:function(n,t,i){WEInfoPage&&WEInfoPage.RenderMode=="Editor"&&WEEdToVB&&WEEdToVB.GECommand&&WEEdToVB.GECommand(i?"addCustomClass":"removeCustomClass",{"class":t,ids:n})},addCSSToHead:function(n){var t=document.createElement("style");t.type="text/css";t.innerHTML=n;document.getElementsByTagName("head")[0].appendChild(t)}}