(function(c,b,a,d){c.fn.doubleTapToGo=function(e){if(!("ontouchstart" in b)&&!navigator.msMaxTouchPoints&&!navigator.userAgent.toLowerCase().match(/windows phone os 7/i)){return false}this.each(function(){var f=false;c(this).on("click",function(h){var g=c(this);if(g[0]!=f[0]){h.preventDefault();f=g}});c(a).on("click touchstart MSPointerDown",function(k){var j=true,g=c(k.target).parents();for(var h=0;h<g.length;h++){if(g[h]==f[0]){j=false}}if(j){f=false}})});return this}})(jQuery,window,document);jQuery(function(a){var b={init:function(){var c=this;c.error=[];a(".smcf-login, .smcf-register, .smcf-forgotpw").on("click.simplemodal",function(d){c.login=a("#loginform"),c.lostpw=a("#lostpasswordform"),c.register=a("#registerform");if(a(this).hasClass("smcf-login")){c.form="#loginform";c.login.show();c.lostpw.hide();c.register.hide()}else{if(a(this).hasClass("smcf-register")){c.form="#registerform";c.register.show();c.login.hide();c.lostpw.hide()}else{c.form="#lostpasswordform";c.lostpw.show();c.login.hide();c.register.hide()}}c.url=this.href;if(!a("#smcf-container").length){a("#smcf-login-form").modal({overlayId:"smcf-overlay",containerId:"smcf-container",opacity:85,onShow:b.show,position:["15%",null],zIndex:10000})}else{b.show()}return false})},show:function(g){var d=b;d.dialog=g||d.dialog;d.modal=d.modal||this;var e=a(d.form,d.dialog.data[0]),c=a(".smcf-login-fields",e[0]),f=a(".smcf-activity",e[0]);d.dialog.container.css({height:"auto"});d.clear(d.dialog.container[0]);e.unbind("submit.simplemodal").bind("submit.simplemodal",function(i){i.preventDefault();d.clear(d.dialog.container[0]);if(d.isValid(e)){c.hide();f.show();if(d.url&&d.url.indexOf("redirect_to")!==-1){var h=d.url.split("=");e.append(a('<input type="hidden" name="redirect_to">').val(unescape(h[1])))}a.ajax({url:e[0].action,data:e.serialize(),type:"POST",cache:false,success:function(o){var n=a(document.createElement("div")).html(o),p=a("#smcf-login-redirect",n[0]);if(p.length){var k=location.href;if(p.html().length){k=p.html()}window.location=k}else{var l=a("#login_error",n[0]),m=a(".message",n[0]),j=a(d.form,n[0]);if(l.length){l.find("a").addClass("smcf-forgotpw");a("p:first",e[0]).before(l);f.hide();c.show()}else{if(m.length){if(d.form==="#lostpasswordform"||d.form==="#registerform"){d.form="#loginform";d.lostpw.hide();d.register.hide();d.login.show();b.show()}a("p:first",e[0]).before(m);f.hide();c.show()}else{if(j.length){d.showError(e,["empty_all"]);f.hide();c.show()}}}}},error:function(j){a("p:first",e[0]).before(a(document.createElement("div")).html("<strong>ERROR</strong>: "+j.statusText).attr("id","login_error"));f.hide();c.show()}})}else{d.showError(e,d.error)}})},clear:function(c){a("#login_error, .message",c).remove()},isValid:function(d){var f=a(".user_login",d[0]),k=a(".user_pass",d[0]),j=a(".user_email",d[0]),g=a(".firstname",d[0]),i=a(".lastname",d[0]),h=a(":text, :password",d[0]),c=true;b.error=[];if(g.length&&!a.trim(g.val())){b.error.push("empty_firstname");c=false}else{if(i.length&&!a.trim(i.val())){b.error.push("empty_lastname");c=false}else{if(f.length&&!a.trim(f.val())){b.error.push("empty_username");c=false}else{if(j.length&&!a.trim(j.val())){b.error.push("empty_email");c=false}else{if(k.length&&!a.trim(k.val())){b.error.push("empty_password");c=false}}}}}var e=0;h.each(function(){if(!a.trim(this.value)){e++}});if(h.length>1&&e===h.length){b.error=["empty_all"];c=false}return c},message:function(c){return SimpleModalLoginL10n[c]?SimpleModalLoginL10n[c]:c},showError:function(d,c){c=a.map(c,function(e){return b.message(e)});a("p:first",d[0]).before(a('<div id="login_error"></div>').html(c.join("<br>")))}};b.init()});jQuery(document).ready(function(a){a(".carousel").carousel({interval:SimpleModalLoginL10n["carousel-interval"]});a("#page-navigation li:has(ul)").doubleTapToGo();a("#mainCarousel").on("slide",function(c){var b=a(c.relatedTarget).attr("data-post-item");a(".carousel-thumbs a.active").removeClass("active");a('.carousel-thumbs a[data-post-item="'+b+'"]').addClass("active")});a(".carousel-thumbs li > a").click(function(b){var c=a(this).attr("href").slice(1);a("#mainCarousel").carousel(parseInt(c));b.preventDefault()})});function imwb_zonpress_window_open(a,b){a=a.replace(/{URL}/,encodeURIComponent(b));window.open(a,"popUp","width=620,height=440")};