(function($){jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;} var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;} expires='; expires='+date.toUTCString();} var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i]*>([^\b]*?)<\/script>/gi,function(){scripts+=arguments[1]+'\n';return'';});if(option===true) eval(scripts);else if(typeof(option)=='function') option(scripts,text);return text;};window.Phpr=window.LS={response:{popupError:function(message){alert(message);}},options:{form:null,handler:false,extraFields:{},selectorMode:false,loadIndicator:{show:true,hideOnSuccess:true,overlayClass:'ajax_loading_indicator',posX:'center',posY:'center',src:null,injectInElement:false,noImage:false,zIndex:9999,element:null,absolutePosition:false,injectPosition:'bottom',overlayOpacity:1,hideElement:false,html:'Loading...'},evalResponse:true,noLoadingIndicator:false,execScriptsOnFailure:true,evalScripts:true,evalScriptsAfterUpdate:false,lock:true,animation:function(element,html){element.html(html);}},sendRequest:function(url,handler,context){var self=this;if(self.busy) return;context=$.extend(true,{},self.options,{extraFields:{},ajax:{url:url,data:{cms_handler_name:handler}}},context);if(context['update']) context.ajax.data['cms_update_elements']=context['update'];$.extend(context.ajax.data,context.extraFields);var response=$.extend({parent:self,text:'',html:'',javascript:'',onComplete:function(){var self=this;self.parent.busy=false;if(typeof(self.text)!=='string') self.text='';if(context.loadIndicator.show) self.parent.hideLoadingIndicator();self.html=stripScripts(self.text,function(javascript){self.javascript=javascript;});},onSuccess:function(data){var self=this;var pattern=/>>[^<>]*<');self.loadingIndicator=element.css({visibility:visibility,position:position,opacity:options.overlayOpacity,zIndex:options.zIndex}).addClass(options.overlayClass).prependTo(container);} self.loadingIndicator.html(options.html);self.loadingIndicator.show();},hideLoadingIndicator:function(){this.loadingIndicator.hide();},loadingIndicator:null,busy:false};function ls_handle_ajax_data_attribute(element){var $element=$(element),update={},extra_fields={};if($element.data('ajax-update')){var ids_partials=$element.data('ajax-update').split(',');for(var index in ids_partials){var id_partial=ids_partials[index],info=id_partial.split('=');if(info.length!=2){alert('Invalid AJAX update specifier syntax: '+id_partial);return;} update[jQuery.trim(info[0])]=jQuery.trim(info[1]);}} if($element.data('ajax-extra-fields')){var fields_values=$element.data('ajax-extra-fields').split(',');for(var index in fields_values){var field_value=fields_values[index],info=field_value.split('=');if(info.length!=2){alert('Invalid AJAX extra field specifier syntax: '+field_value);return;} extra_fields[jQuery.trim(info[0])]=jQuery.trim(info[1]).replace(/^'/,'').replace(/'$/,'');}} var params={'update':update,'extraFields':extra_fields,confirm:$(element).data('ajax-confirm'),loadIndicator:{html:'Loading...'}};if($element.data('ajax-indicator-html')!==undefined) params.loadIndicator={'html':$element.data('ajax-indicator-html')};$element.sendRequest($element.data('ajax-handler'),params);} if($(document).on!==undefined){$(document).on('change','select[data-ajax-handler], input[type=radio][data-ajax-handler], input[type=checkbox][data-ajax-handler]',function(){ls_handle_ajax_data_attribute(this);});$(document).on('click','a[data-ajax-handler], input[type=button][data-ajax-handler], input[type="submit"][data-ajax-handler]',function(){ls_handle_ajax_data_attribute(this);return false;});$(document).on('submit','[data-ajax-handler]',function(){ls_handle_ajax_data_attribute(this);return false;});}})(jQuery);function ie10_win8_viewport_fix(){if(navigator.userAgent.match(/IEMobile\/10\.0/)){var t=document.createElement("style");t.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.querySelector("head").appendChild(t)}}function andriod_select_fix(){var t=navigator.userAgent,e;t.indexOf("Mozilla/5.0")>-1&&t.indexOf("Android ")>-1&&t.indexOf("AppleWebKit")>-1&&-1===t.indexOf("Chrome")&&$("select.form-control").removeClass("form-control").css("width","100%")}function option_to_button(){var t={},e;$("select").each(function(i,n){if("options"===$(n).data("name")){var o=$(n).attr("name"),s=$(n).data("ajax-handler");void 0!==s&&s.length>0&&(e=s,s='data-ajax-handler="'+s+'"');var a=$(n).data("ajax-update"),r={};void 0!==a&&a.length>0&&(r=a.split("="),t[r[0]]=r[1],a='data-ajax-update="'+a+'"');var l=!1,c=$(n).attr("data-type"),d=$(n).attr("data-group-style");void 0!==d&&d.length||(d="btn-default");var h=$(n).attr("data-btn-title");void 0!==h&&h.length||(h="Select");var u=$(n).attr("data-btn-id");void 0!==u&&u.length||(u="button_group");var p=$(n).parent();c&&(c=$(n).data("type")).length>0&&"group"===c&&(l=!0);var f=$('');if(f.val($(n).val()),f.insertAfter($(n)),$(n).parent().addClass("select-buttons"),!1===l)$(n).find("option").unwrap().each(function(t,e){var i=$(e).val(),n=$('
"+$(e).text()+"
");$(e).attr("selected")&&n.addClass("active"),$(e).replaceWith(n)});else{var m=$('
'),g=$("