$("document").ready(function(){function a(a){var b=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);return b.test(a)}$("input#submit").live("click",function(){var b=$("input[name=name]");var c=$("input[name=email]");var d=$("input[name=website]");var e=$("textarea[name=comment]");var f=0;var g=a(c.val());if(b.val()==""||b.val()=="Max Mustermann"||b.val()=="John Doe"){b.css("color","red");$("label#name").css("color","red");f++}else b.removeClass("hightlight");if(c.val()==""||c.val()=="max@mustermann.de"||c.val()=="john@johndoe.com"||!g){c.css("color","red");$("label#email").css("color","red");f++}else c.removeClass("hightlight");if(e.val()==""){e.css("color","red");$("label#comment").css("color","red");f++}else e.removeClass("hightlight");if(f>0)return false;var h="name="+b.val()+"&email="+c.val()+"&website="+d.val()+"&comment="+encodeURIComponent(e.val());$(".text").attr("disabled","true");$(".loading").show();$.ajax({url:"process.php",type:"GET",data:h,cache:false,success:function(a){if(a==1){$(".form").fadeOut(200);setTimeout(function(){$(".done").fadeIn("fast")},200)}else alert("Sorry, unexpected error. Please try again later.")}});return false});$("input#name").live("focus",function(){$(this).css("color","black");$("label#name").css("color","#ddd");if($(this).val()=="Max Mustermann"||$(this).val()=="John Doe")$(this).val("")}).live("focusout",function(){if($(this).val()==""){if(ctState.lang=="de")$(this).val("Max Mustermann");else $(this).val("John Doe")}});$("input#email").live("focus",function(){$(this).css("color","black");$("label#email").css("color","#ddd");if($(this).val()=="max@mustermann.de"||$(this).val()=="john@johndoe.com")$(this).val("")}).live("focusout",function(){if($(this).val()==""){if(ctState.lang=="de")$(this).val("max@mustermann.de");else $(this).val("john@johndoe.com")}});$("input#website").live("focus",function(){$(this).css("color","black");$("label#website").css("color","#ddd");if($(this).val()=="www.mustermann.de"||$(this).val()=="www.johndoe.com")$(this).val("")}).live("focusout",function(){if($(this).val()==""){if(ctState.lang=="de")$(this).val("www.mustermann.de");else $(this).val("www.johndoe.com")}});$("textarea#comment").live("focus",function(){$(this).css("color","black");$("label#comment").css("color","#ddd")})})
