$(function(){var d=$("body"),c=$("#splash"),g=$("h1"),h=$("#contact"),j=$("form"),i=$("#notify-zone"),e=$("#mel"),k=$("#msg"),a=e.add(k),b=$("#send"),f;$("html").addClass("js-enabled");if(d.css("color").indexOf("rgba")!==0){}$("#show").click(function(){c.fadeOut("fast",function(){h.fadeIn("slow")});return false});$("#actions").append('<a id="cancel" href="#">Cancel</a>');f=$("#cancel").click(function(){h.fadeOut("fast",function(){c.fadeIn("slow",function(){a.each(function(){$(this).val("").addClass("empty").removeClass("filled").removeAttr("disabled")});i.text("");j.attr("class","");b.text("Send").show()})});return false});e.data("msg","Your e-mail address");k.data("msg","Drop a few words...");i.text("");a.addClass("empty").blur(function(){var l=$(this);if(l.val()===""){l.addClass("empty").val(l.data("msg"))}if(l.val()===l.data("msg")){l.removeClass("filled")}else{l.addClass("filled")}}).focus(function(){if(j.hasClass("error")){j.removeClass("error");i.text("");b.css("display","inline").text("Send")}var l=$(this);if(l.val()===l.data("msg")){l.val("")}if(l.hasClass("empty")){l.val("");l.removeClass("empty")}});b.click(function(){if(e.hasClass("filled")&&k.hasClass("filled")){j.addClass("sending").removeClass("error");b.attr("disabled","disabled").text("Sending...");$.ajax({url:"/send-mail.php?"+a.serialize(),dataType:"text",success:function(l){j.removeClass("sending");if(l==="ok"){j.addClass("sent");i.text("Message sent successfully.");f.text("Close");b.hide()}else{j.addClass("error");a.each(function(){$(this).removeAttr("disabled")});b.removeAttr("disabled").text("Retry");i.text("Message was not sent.")}},error:function(l,n,m){j.removeClass("sending").addClass("error");a.each(function(){$(this).removeAttr("disabled")});b.removeAttr("disabled").text("Retry");i.text("Message was not sent.")}});a.each(function(){$(this).attr("disabled","disabled")})}else{j.addClass("error");a.each(function(){var l=$(this);if(l.val()===""){l.val(l.data("msg")).addClass("empty")}});i.text("Please fill the form.");b.text("Send")}return false});setTimeout(function(){$("body").append('<script type="text/javascript">var sc_project=5229845,sc_invisible=1,sc_partition=59,sc_click_stat=1,sc_security="9c00677f";<\/script><script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"><\/script>')},800);setTimeout(function(){if(c.css("background-color").indexOf("rgba")!==0){return}var p={value:128,threshold:1,min:89,max:235},o={value:128,threshold:2,min:20,max:149},l={value:128},m={value:0.18,threshold:0.001,min:0.1,max:0.1};albido=p.value+o.value+l.value;function q(s,r){s.value=s.value+s.threshold;if(s.value>s.max){s.value=s.max;s.threshold=r?-n():-s.threshold}if(s.value<s.min){s.value=s.min;s.threshold=r?n():-s.threshold}return s}function n(){return Math.floor(Math.random()*10)%3+1}setInterval(function(){p=q(p,true);o=q(o,true);l.value=albido-p.value-o.value;c.add(h).css("background-color","rgba("+p.value+","+o.value+","+l.value+","+m.value+")")},40)},100)});
