function setCookie(n,t,i){var r=new Date,u;r.setTime(r.getTime()+i*864e5);u="expires="+r.toUTCString();document.cookie=n+"="+t+"; "+u+"; path=/"}function getCookie(n){for(var t,r=n+"=",u=document.cookie.split(";"),i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return""}function ShowMailingListPOP(){getCookie("mailinglist_pop")!="1"&&$("#mailinglist_bottom").slideDown(1500)}function CloseMailingListPOP(){$("#mailinglist_bottom").fadeOut(1500);setCookie("mailinglist_pop","1",1)}function ajax_button_OnBegin(n,t){$("#"+n).prop("disabled",t)}function ajax_button_OnFailure(n,t){alert("Request Failed.");$("#"+n).prop("disabled",t)}function DoMultiUpload(n,t,i){$(".progress").hide();$("#"+n+"_message").hide();$("#"+n+"_label").html("");var r=0,u=1;$("#"+n).fileupload({dataType:"json",autoUpload:!0,progressInterval:1,sequentialUploads:!0,formData:{fieldid:n},add:function(t,i){$("#"+n+"_label").html("Please Wait...");$("#"+n+"_message").html("");$("#"+n+"_message").hide();$.each(i.files,function(){r++});console.log(r);i.submit()},done:function(r,u){$("#"+n+"_progress").css("width","0%");$(".progress").hide();$("#"+n+"_label").html("");var e=u.result.filename,o=u.result.status,f=u.result.data;o=="OK"?($("#"+i).hide(),t==1?$("#"+n+"_result").append(f):$("#"+n+"_result").html(f)):($("#"+n+"_message").show(),t==1?$("#"+n+"_message").append(e+" "+f+"<br/>"):$("#"+n+"_message").html(e+" "+f+"<br/>"))},success:function(n){$("#fileupload_results").append(n);console.log(n);u++},progress:function(t,i){var f=parseInt(i.loaded/i.total*100,10),e;$(".progress").show();$("#"+n+"_progress").css("width",f+"%");$("#"+n+"_progress").html(f+"%");e="Uploading "+u+" of "+r+" - "+i.files[0].name+". "+parseInt(i.loaded/1024)+" KB of "+parseInt(i.total/1024)+" KB at "+parseInt(i.bitrate/1024)+" KB/s";$("#"+n+"_label").html(e)},fail:function(){$(".progress").hide();$("#"+n+"_label").html("");$("#"+n+"_message").show();$("#"+n+"_message").append("No file uploaded. Please try again.<br/>")}})}function ajaxGetURL(n,t){var i;n.preventDefault();$(t).addClass("disabled");var r=$(t).attr("data-content"),u=$(t).attr("data-target"),f=$(t).attr("data-ajax");if(r=="confirm"&&(i=confirm("Are you sure?"),i!=!0)){$(t).removeClass("disabled");return}$.get(f,function(n){$("#"+u).html(n);$(t).removeClass("disabled")}).error(function(){alert("Some error occurred, please try again.");$(t).removeClass("disabled")})}!function(n){n.fn.rating=function(){function f(t,i,r,u){var f=n(t).find('[data-value="'+i+'"]');f.removeClass(u).addClass(r);f.prevAll("[data-value]").removeClass(u).addClass(r);f.nextAll("[data-value]").removeClass(r).addClass(u)}function e(t,i,r){var u=n(t);u.find("[data-value]").removeClass(i).addClass(r)}function o(n,t){n.val(t).trigger("change");t===n.data("empty-value")?n.siblings(".rating-clear").hide():n.siblings(".rating-clear").show()}for(var l,r=this.length-1;r>=0;r--){var s,i,t=n(this[r]),h=t.data("max")||5,c=t.data("min")||0,a=t.val()||0,u=t.data("icon-lib")||"glyphicon";for(active=t.data("active-icon")||"glyphicon-star",inactive=t.data("inactive-icon")||"glyphicon-star-empty",clearable=t.data("clearable")||null,clearable_i=t.data("clearable-icon")||"glyphicon-remove",stars="",i=c;h>=i;i++)stars+=a>=i?['<i class="',u," ",active,'" data-value="',i,'"><\/i>'].join(""):['<i class="',u," ",inactive,'" data-value="',i,'"><\/i>'].join("");clearable&&(stars+=[' <a class="rating-clear" style="display:none;" href="javascript:void">','<span class="',u," ",clearable_i,'"><\/span> ',clearable,"<\/a>"].join(""));l=t.clone(!0).addClass("hidden").data("max",h).data("min",c).data("icon-lib",u).data("active-icon",active).data("inactive-icon",inactive);s=['<div class="rating-input">',stars,"<\/div>"].join("");t.parents(".rating-input").length<=0&&t.replaceWith(n(s).append(l))}n(".rating-input").on("mouseenter","[data-value]",function(){var t=n(this);input=t.siblings("input");f(t.closest(".rating-input"),t.data("value"),input.data("active-icon"),input.data("inactive-icon"))}).on("mouseleave","[data-value]",function(){var i=n(this),t=i.siblings("input"),r=t.val(),s=t.data("min"),h=t.data("max"),u=t.data("active-icon"),o=t.data("inactive-icon");r>=s&&h>=r?f(i.closest(".rating-input"),r,u,o):e(i.closest(".rating-input"),u,o)}).on("click","[data-value]",function(t){var i=n(this),r=i.data("value"),u=i.siblings("input");return o(u,r),t.preventDefault(),!1}).on("click",".rating-clear",function(t){var r=n(this),i=r.siblings("input"),u=i.data("active-icon"),f=i.data("inactive-icon");return o(i,i.data("empty-value")),e(r.closest(".rating-input"),u,f),t.preventDefault(),!1}).each(function(){var t=n(this).find("input"),i=t.val(),r=t.data("min"),u=t.data("max");""!==i&&+i>=r&&u>=+i?(f(this,i),n(this).find(".rating-clear").show()):(t.val(t.data("empty-value")),e(this))})};n(function(){n("input.rating[type=number]").length>0&&n("input.rating[type=number]").rating()})}(jQuery);$(document).ready(function(){$('[data-toggle="refreshContent"]').bind("click",function(n){var t,i,r;n.preventDefault();t=this;i=$(t).attr("data-target");$("#"+i).html('<img src="/content/images/ajax-loader-arrow.gif"/>');$(t).addClass("disabled");r=$(this).attr("href");$.ajax({url:r,type:"POST",success:function(n){$("#"+i).html(n)},error:function(){alert("Server failure! Is the server turned off?")}})});$(document).delegate('*[data-toggle="lightbox"]',"click",function(n){n.preventDefault();$(this).ekkoLightbox()})}),function(n){if(typeof define=="function"&&define.amd)define(n);else if(typeof exports=="object")module.exports=n();else{var i=window.Cookies,t=window.Cookies=n();t.noConflict=function(){return window.Cookies=i,t}}}(function(){function n(){for(var n=0,r={},t,i;n<arguments.length;n++){t=arguments[n];for(i in t)r[i]=t[i]}return r}function t(i){function r(t,u,f){var o,s;if(arguments.length>1){f=n({path:"/"},r.defaults,f);typeof f.expires=="number"&&(s=new Date,s.setMilliseconds(s.getMilliseconds()+f.expires*864e5),f.expires=s);try{o=JSON.stringify(u);/^[\{\[]/.test(o)&&(u=o)}catch(y){}return u=i.write?i.write(u,t):encodeURIComponent(String(u)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape),document.cookie=[t,"=",u,f.expires&&"; expires="+f.expires.toUTCString(),f.path&&"; path="+f.path,f.domain&&"; domain="+f.domain,f.secure?"; secure":""].join("")}t||(o={});for(var l=document.cookie?document.cookie.split("; "):[],a=/(%[0-9A-Z]{2})+/g,c=0;c<l.length;c++){var v=l[c].split("="),h=v[0].replace(a,decodeURIComponent),e=v.slice(1).join("=");e.charAt(0)==='"'&&(e=e.slice(1,-1));try{if(e=i.read?i.read(e,h):i(e,h)||e.replace(a,decodeURIComponent),this.json)try{e=JSON.parse(e)}catch(y){}if(t===h){o=e;break}t||(o[h]=e)}catch(y){}}return o}return r.get=r.set=r,r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,i){r(t,"",n(i,{expires:-1}))},r.withConverter=t,r}return t(function(){})}),function(){"use strict";var n,t;n=jQuery;t=function(t,i){var e,u,f,r=this;return this.options=n.extend({title:null,footer:null,remote:null},n.fn.ekkoLightbox.defaults,i||{}),this.$element=n(t),e="",this.modal_id=this.options.modal_id?this.options.modal_id:"ekkoLightbox-"+Math.floor(Math.random()*1e3+1),f='<div class="modal-header"'+(this.options.title||this.options.always_show_close?"":' style="display:none"')+'><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;<\/button><h4 class="modal-title">'+(this.options.title||"&nbsp;")+"<\/h4><\/div>",u='<div class="modal-footer"'+(this.options.footer?"":' style="display:none"')+">"+this.options.footer+"<\/div>",n(document.body).append('<div id="'+this.modal_id+'" class="ekko-lightbox modal fade" tabindex="-1"><div class="modal-dialog"><div class="modal-content">'+f+'<div class="modal-body"><div class="ekko-lightbox-container"><div><\/div><\/div><\/div>'+u+"<\/div><\/div><\/div>"),this.modal=n("#"+this.modal_id),this.modal_dialog=this.modal.find(".modal-dialog").first(),this.modal_content=this.modal.find(".modal-content").first(),this.modal_body=this.modal.find(".modal-body").first(),this.lightbox_container=this.modal_body.find(".ekko-lightbox-container").first(),this.lightbox_body=this.lightbox_container.find("> div:first-child").first(),this.showLoading(),this.modal_arrows=null,this.border={top:parseFloat(this.modal_dialog.css("border-top-width"))+parseFloat(this.modal_content.css("border-top-width"))+parseFloat(this.modal_body.css("border-top-width")),right:parseFloat(this.modal_dialog.css("border-right-width"))+parseFloat(this.modal_content.css("border-right-width"))+parseFloat(this.modal_body.css("border-right-width")),bottom:parseFloat(this.modal_dialog.css("border-bottom-width"))+parseFloat(this.modal_content.css("border-bottom-width"))+parseFloat(this.modal_body.css("border-bottom-width")),left:parseFloat(this.modal_dialog.css("border-left-width"))+parseFloat(this.modal_content.css("border-left-width"))+parseFloat(this.modal_body.css("border-left-width"))},this.padding={top:parseFloat(this.modal_dialog.css("padding-top"))+parseFloat(this.modal_content.css("padding-top"))+parseFloat(this.modal_body.css("padding-top")),right:parseFloat(this.modal_dialog.css("padding-right"))+parseFloat(this.modal_content.css("padding-right"))+parseFloat(this.modal_body.css("padding-right")),bottom:parseFloat(this.modal_dialog.css("padding-bottom"))+parseFloat(this.modal_content.css("padding-bottom"))+parseFloat(this.modal_body.css("padding-bottom")),left:parseFloat(this.modal_dialog.css("padding-left"))+parseFloat(this.modal_content.css("padding-left"))+parseFloat(this.modal_body.css("padding-left"))},this.modal.on("show.bs.modal",this.options.onShow.bind(this)).on("shown.bs.modal",function(){return r.modal_shown(),r.options.onShown.call(r)}).on("hide.bs.modal",this.options.onHide.bind(this)).on("hidden.bs.modal",function(){return r.gallery&&n(document).off("keydown.ekkoLightbox"),r.modal.remove(),r.options.onHidden.call(r)}).modal("show",i),this.modal};t.prototype={modal_shown:function(){var t,i=this;if(this.options.remote){if(this.gallery=this.$element.data("gallery"),this.gallery){this.gallery_items=this.options.gallery_parent_selector==="document.body"||this.options.gallery_parent_selector===""?n(document.body).find('*[data-toggle="lightbox"][data-gallery="'+this.gallery+'"]'):this.$element.parents(this.options.gallery_parent_selector).first().find('*[data-toggle="lightbox"][data-gallery="'+this.gallery+'"]');this.gallery_index=this.gallery_items.index(this.$element);n(document).on("keydown.ekkoLightbox",this.navigate.bind(this));if(this.options.directional_arrows&&this.gallery_items.length>1){this.lightbox_container.append('<div class="ekko-lightbox-nav-overlay"><a href="#" class="'+this.strip_stops(this.options.left_arrow_class)+'"><\/a><a href="#" class="'+this.strip_stops(this.options.right_arrow_class)+'"><\/a><\/div>');this.modal_arrows=this.lightbox_container.find("div.ekko-lightbox-nav-overlay").first();this.lightbox_container.find("a"+this.strip_spaces(this.options.left_arrow_class)).on("click",function(n){return n.preventDefault(),i.navigate_left()});this.lightbox_container.find("a"+this.strip_spaces(this.options.right_arrow_class)).on("click",function(n){return n.preventDefault(),i.navigate_right()})}}return this.options.type?this.options.type==="image"?this.preloadImage(this.options.remote,!0):this.options.type==="youtube"&&(t=this.getYoutubeId(this.options.remote))?this.showYoutubeVideo(t):this.options.type==="vimeo"?this.showVimeoVideo(this.options.remote):this.options.type==="instagram"?this.showInstagramVideo(this.options.remote):this.options.type==="url"?this.loadRemoteContent(this.options.remote):this.options.type==="video"?this.showVideoIframe(this.options.remote):this.error('Could not detect remote target type. Force the type using data-type="image|youtube|vimeo|instagram|url|video"'):this.detectRemoteType(this.options.remote)}return this.error("No remote target given")},strip_stops:function(n){return n.replace(/\./g,"")},strip_spaces:function(n){return n.replace(/\s/g,"")},isImage:function(n){return n.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSwf:function(n){return n.match(/\.(swf)((\?|#).*)?$/i)},getYoutubeId:function(n){var t;return t=n.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/),t&&t[2].length===11?t[2]:!1},getVimeoId:function(n){return n.indexOf("vimeo")>0?n:!1},getInstagramId:function(n){return n.indexOf("instagram")>0?n:!1},navigate:function(n){if(n=n||window.event,n.keyCode===39||n.keyCode===37){if(n.keyCode===39)return this.navigate_right();if(n.keyCode===37)return this.navigate_left()}},navigateTo:function(t){var r,i;return t<0||t>this.gallery_items.length-1?this:(this.showLoading(),this.gallery_index=t,this.$element=n(this.gallery_items.get(this.gallery_index)),this.updateTitleAndFooter(),i=this.$element.attr("data-remote")||this.$element.attr("href"),this.detectRemoteType(i,this.$element.attr("data-type")||!1),this.gallery_index+1<this.gallery_items.length&&(r=n(this.gallery_items.get(this.gallery_index+1),!1),i=r.attr("data-remote")||r.attr("href"),r.attr("data-type")==="image"||this.isImage(i))?this.preloadImage(i,!1):void 0)},navigate_left:function(){if(this.gallery_items.length!==1)return this.gallery_index===0?this.gallery_index=this.gallery_items.length-1:this.gallery_index--,this.options.onNavigate.call(this,"left",this.gallery_index),this.navigateTo(this.gallery_index)},navigate_right:function(){if(this.gallery_items.length!==1)return this.gallery_index===this.gallery_items.length-1?this.gallery_index=0:this.gallery_index++,this.options.onNavigate.call(this,"right",this.gallery_index),this.navigateTo(this.gallery_index)},detectRemoteType:function(n,t){var i;return t=t||!1,t==="image"||this.isImage(n)?(this.options.type="image",this.preloadImage(n,!0)):t==="youtube"||(i=this.getYoutubeId(n))?(this.options.type="youtube",this.showYoutubeVideo(i)):t==="vimeo"||(i=this.getVimeoId(n))?(this.options.type="vimeo",this.showVimeoVideo(i)):t==="instagram"||(i=this.getInstagramId(n))?(this.options.type="instagram",this.showInstagramVideo(i)):t==="video"?(this.options.type="video",this.showVideoIframe(i)):(this.options.type="url",this.loadRemoteContent(n))},updateTitleAndFooter:function(){var n,t,i,r;return i=this.modal_content.find(".modal-header"),t=this.modal_content.find(".modal-footer"),r=this.$element.data("title")||"",n=this.$element.data("footer")||"",r||this.options.always_show_close?i.css("display","").find(".modal-title").html(r||"&nbsp;"):i.css("display","none"),n?t.css("display","").html(n):t.css("display","none"),this},showLoading:function(){return this.lightbox_body.html('<div class="modal-loading">'+this.options.loadingMessage+"<\/div>"),this},showYoutubeVideo:function(n){var i,t;return t=this.checkDimensions(this.$element.data("width")||560),i=t/(560/315),this.showVideoIframe("//www.youtube.com/embed/"+n+"?badge=0&autoplay=1&html5=1",t,i)},showVimeoVideo:function(n){var i,t;return t=this.checkDimensions(this.$element.data("width")||560),i=t/(500/281),this.showVideoIframe(n+"?autoplay=1",t,i)},showInstagramVideo:function(n){var i,t;return t=this.checkDimensions(this.$element.data("width")||612),this.resize(t),i=t+80,this.lightbox_body.html('<iframe width="'+t+'" height="'+i+'" src="'+this.addTrailingSlash(n)+'embed/" frameborder="0" allowfullscreen><\/iframe>'),this.options.onContentLoaded.call(this),this.modal_arrows?this.modal_arrows.css("display","none"):void 0},showVideoIframe:function(n,t,i){return i=i||t,this.resize(t),this.lightbox_body.html('<div class="embed-responsive embed-responsive-16by9"><iframe width="'+t+'" height="'+i+'" src="'+n+'" frameborder="0" allowfullscreenclass="embed-responsive-item"><\/iframe><\/div>'),this.options.onContentLoaded.call(this),this.modal_arrows&&this.modal_arrows.css("display","none"),this},loadRemoteContent:function(t){var r,i,u=this;return i=this.$element.data("width")||560,this.resize(i),r=this.$element.data("disableExternalCheck")||!1,r||this.isExternal(t)?(this.lightbox_body.html('<iframe width="'+i+'" height="'+i+'" src="'+t+'" frameborder="0" allowfullscreen><\/iframe>'),this.options.onContentLoaded.call(this)):this.lightbox_body.load(t,n.proxy(function(){return u.$element.trigger("loaded.bs.modal")})),this.modal_arrows&&this.modal_arrows.css("display","none"),this},isExternal:function(n){var t;return(t=n.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/),typeof t[1]=="string"&&t[1].length>0&&t[1].toLowerCase()!==location.protocol)?!0:typeof t[2]=="string"&&t[2].length>0&&t[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host?!0:!1},error:function(n){return this.lightbox_body.html(n),this},preloadImage:function(t,i){var r,u=this;return r=new Image,(i==null||i===!0)&&(r.onload=function(){var t,i=n(window).height()*.8;return t=n("<img />"),t.attr("src",r.src),t.attr("style","max-height: "+i+"px"),t.addClass("img-responsive"),u.lightbox_body.html(t),u.modal_arrows&&u.modal_arrows.css("display","block"),u.resize(Math.min(i/r.height,1)*r.width),u.options.onContentLoaded.call(u)},r.onerror=function(){return u.error("Failed to load image: "+t)}),r.src=t,r},resize:function(t){var i;return i=t+this.border.left+this.padding.left+this.padding.right+this.border.right,this.modal_dialog.css("width","auto").css("max-width",i),this.lightbox_container.find("a").css("line-height",function(){return n(this).parent().height()+"px"}),this},checkDimensions:function(n){var t,i;return i=n+this.border.left+this.padding.left+this.padding.right+this.border.right,t=document.body.clientWidth,i>t&&(n=this.modal_body.width()),n},close:function(){return this.modal.modal("hide")},addTrailingSlash:function(n){return n.substr(-1)!=="/"&&(n+="/"),n}};n.fn.ekkoLightbox=function(i){return this.each(function(){var r;return r=n(this),i=n.extend({remote:r.attr("data-remote")||r.attr("href"),gallery_parent_selector:r.attr("data-parent"),type:r.attr("data-type")},i,r.data()),new t(this,i),this})};n.fn.ekkoLightbox.defaults={gallery_parent_selector:"document.body",left_arrow_class:".glyphicon .glyphicon-chevron-left",right_arrow_class:".glyphicon .glyphicon-chevron-right",directional_arrows:!0,type:null,always_show_close:!0,loadingMessage:"Loading...",onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}}}.call(this)