(function(b){var c=[],a=function(f){for(var e=0,d=c.length;e<d;e++){c[e].update(f)}};b.model={attach:function(d){return c.push(d)},get:function(d){b.getJSON(d,a)},post:function(d,e){b.post(d,e,a,"json")}}})(jQuery);(function(b){var a=null;b(function(){a=b.form2.init("#frm_newsletter",{loader:"loader_f.gif"})});b.model.attach({update:function(c){if(typeof c.form==="undefined"||typeof c.form.id==="undefined"||c.form.id!=="newsletter"){return}if(c.form.status==="error"){setTimeout(function(){c.form.errors={main:c.form.errors.email};a.error(c.form)},333)}else{setTimeout(function(){a.ok(c.form);b("#email").val("")},333)}}})})(jQuery);(function(e){var d,c,b,a=null,f=null;e.form2={init:function(h,i){var g="loader.gif";if(i.loader){g=i.loader}a=f=null;d=e(typeof h==="undefined"?"form":h);a=d.find("h5");if(a.length===0){a=null}b=d.find(":input");c=e('<img src="/img/'+g+'" alt="">').appendTo(e(d.find(".row_submit")));d.bind("submit.form",function(){if(a!==null&&a.hasClass("error")){a.css("opacity",0.1)}d.find("em.error").css("opacity",0.1).addClass("old");c.css("visibility","visible");e.model.post(d.attr("action"),d.serialize());b.attr("disabled",true);return false});return this},error:function(g){var j,k,h;if(g.errors.main){if(a===null){a=e('<h5 class="error">'+g.errors.main+"</h5>").insertBefore(d.find(":first")).css("opacity",0)}else{if(!a.hasClass("error")){a.removeClass("ok").addClass("error")}a.html(g.errors.main)}}for(j in g.errors){if(g.errors.hasOwnProperty(j)){if(j==="main"){continue}k=e("#"+j).parent();if(k.length===0){continue}h=k.find("em.error");if(h.length===0){e('<em class="error">'+g.errors[j]+"</em>").prependTo(k).css("opacity",0)}else{h.text(g.errors[j]).show().removeClass("old")}if(f===null){f=e("#"+j)}}}d.find("em.old").hide();d.find("h5.error,em.error").fadeTo("normal",1);b.removeAttr("disabled");c.css("visibility","hidden");if(f===null){d.find("input:first").focus()}else{f.focus()}f=null},ok:function(g){if(a===null){a=e('<h5 class="ok">'+g.message+"</h5>").insertBefore(d.find(":first")).css("opacity",0)}else{if(!a.hasClass("ok")){a.removeClass("error").addClass("ok")}a.html(g.message)}d.find("em.old").hide();a.fadeTo("normal",1);b.removeAttr("disabled");c.css("visibility","hidden");f=null},submit:function(){d.submit()}}})(jQuery);$(function(){if(window.location.host.indexOf(".dev")>-1){return}$.getScript("http://www.google-analytics.com/ga.js",function(){try{var a=_gat._getTracker("UA-11699782-1");a._trackPageview()}catch(b){}})});
