/*
 * contactable 1.2.1 - jQuery Ajax contact form
 *
 * Copyright (c) 2009 Philip Beel (http://www.theodin.co.uk/)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Revision: $Id: jquery.contactable.js 2010-01-19 $
 *
 */
(function(a){a.fn.contactable=function(c){var b={name:"Name",email:"Email",message:"Nachricht",subject:"Kontaktformular",recievedMsg:" Vielen Dank, wir haben Ihre E-Mail erhalten und werden diese umgehend bearbeiten!",notRecievedMsg:"Ihre Kontaktanfrage konnte nicht versendet werden, bitte versuchen Sie es sp\u00e4ter noch einmal.",disclaimer:"",hideOnSubmit:true};c=a.extend(b,c);return this.each(function(){a(this).html('<div id="contactable"></div><form id="contactForm" method="" action=""><div id="loading"></div><div id="callback"></div><div class="holder"><p><label for="name">Name <span class="red"> * </span></label><br /><input id="name" class="contact" name="name" /></p><p><label for="email">E-Mail <span class="red"> * </span></label><br /><input id="email" class="contact" name="email" /></p><p><label for="comment">Ihre Nachricht <span class="red"> * </span></label><br /><textarea id="comment" name="comment" class="comment" rows="4" cols="30" ></textarea></p><p><input class="submit" type="submit" value="senden"/></p><p class="disclaimer">'+ b.disclaimer+"</p></div></form>");a("div#contactable").toggle(function(){a("#overlay").css({display:"block"});a(this).animate({marginRight:"-=5px"},"fast");a("#contactForm").animate({marginRight:"-=0px"},"fast");a(this).animate({marginRight:"+=395px"},"slow");a("#contactForm").animate({marginRight:"+=390px"},"slow")},function(){a("#contactForm").animate({marginRight:"-=390px"},"slow");a(this).animate({marginRight:"-=395px"},"slow").animate({marginRight:"+=5px"},"fast");a("#overlay").css({display:"none"})}); a("#contactForm").validate({rules:{name:{required:true,minlength:2},email:{required:true,email:true},comment:{required:true}},messages:{name:"",email:"",comment:""},submitHandler:function(){a(".holder").hide();a("#loading").show();a.post("js/jquery/contactable/mail.php",{subject:b.subject,name:a("#name").val(),email:a("#email").val(),comment:a("#comment").val()},function(d){a("#loading").css({display:"none"});if(d=="success"){a("#callback").show().append(b.recievedMsg);if(b.hideOnSubmit==true){a("#contactForm").animate({dummy:1}, 2E3).animate({marginLeft:"-=450px"},"slow");a("div#contactable").animate({dummy:1},2E3).animate({marginLeft:"-=447px"},"slow").animate({marginLeft:"+=5px"},"fast");a("#overlay").css({display:"none"})}}else a("#callback").show().append(b.notRecievedMsg)})}})})}})(jQuery);
