

(function($){$.fn.contactable=function(options){var defaults={name:'Name',email:'Email',message:'Message',recipient:'test@test.co.uk',subject:'A contactable message',recievedMsg:'Thank you for your message',notRecievedMsg:'Sorry but your message could not be sent, try again later'};var options=$.extend(defaults,options);return this.each(function(options){$(this).html('<div id="contactable"></div><form id="contactForm" method="" action=""><div id="loading"></div><div id="callback"></div><div class="holder"><input type="hidden" id="recipient" name="recipient" value="'+defaults.recipient+'" /><input type="hidden" id="subject" name="subject" value="'+defaults.subject+'" />    <table border="0" cellspacing="0" cellpadding="0">            <tr>        <td>Your Name <span class="red"> *</span></td>                <td>Your Email  <span class="red"> *</span></td>      </tr>      <tr>        <td><label for="label"></label>        <input id="name" class="contact" name="name" /></td>        <td><label for="label"></label>        <input id="email" class="contact" name="email" /></td>        </tr>      <tr>        <td colspan="2">Your Friend\'s Email addresses </td>        </tr>      <tr>        <td colspan="2"><table width="100" border="0" align="center" cellpadding="2" cellspacing="2">          <tr>            <td><input id="email1" class="contact" name="email1" /></td>            <td><input id="email2" class="contact" name="email2" /></td>          </tr>          <tr>            <td><input id="email3" class="contact" name="email3" /></td>            <td><input id="email4" class="contact" name="email4" /></td>          </tr>        </table></td>      </tr>      <tr>        <td colspan="2"><label for="label">Your Comments <span class="red">  </span></label></td>      </tr>      <tr>        <td colspan="2"><textarea id="comment" name="comment"  ></textarea></td>      </tr>      <tr>        <td colspan="2"><input name="submit" type="submit" class="submit" value="Send"/></td>      </tr></table>      <label for="name"></label>      <label for="email"></label>         <p><label for="comment"></label><br />  </p>  <p>&nbsp;</p></div></form>');
																																																																																												 $('div#contactable').toggle(function(){$('#overlay').css({display:'block'});$(this).animate({"marginLeft":"-=5px"},"fast");$('#contactForm').animate({"marginLeft":"-=0px"},"fast");$(this).animate({"marginLeft":"+=387px"},"slow");$('#contactForm').animate({"marginLeft":"+=390px"},"slow")},function(){$('#contactForm').animate({"marginLeft":"-=390px"},"slow");
																																																																																																																																																																													   $(this).animate({"marginLeft":"-=387px"},"slow").animate({"marginLeft":"+=5px"},"fast");$('#overlay').css({display:'none'})});
																																																																																												 $("#contactForm").validate(
																																																																																																			{rules:
																																																																																																			{name:{required:true,minlength:2},
																																																																																								email:{required:true,email:true},
																																																																																								email1:{required:false,email:true},
																																																																																								email2:{required:false,email:true},
email3:{required:false,email:true},
email4:{required:false,email:true}
																																																																																								},
																																																																																																			messages:{name:"##",email:"",comment:"",
email1:"",
email2:"",
email3:"",
email4:""

																																																																																																			
																																																																																																			}
																																																																																																			
																																																																																																			,submitHandler:function(){
																																																																																																				$('#loading').show();
																																																																																																			$.post('tellafren.php',{
																																																																																																				  name:$('#name').val(),
																																																																																																				  email:$('#email').val(),
																																																																																																				    email1:$('#email1').val(),
																																																																																																					  email2:$('#email2').val(),
																																																																																																					    email3:$('#email3').val(),
																																																																																																						  email4:$('#email4').val(),
																																																																																																						  
																																																																																																				  comment:$('#comment').val()
																																																																																																																																																																																				  },function(data){
																																																																																																																																																																																					
																																																																																																																																																																																					  $('#loading').css({display:'none'});
																																																																																																				  if(data=='success'){
																																																																																																				
																																																																																																																																																																											$('div#contactable').trigger("click");																																																																																											  
																																																																																																				  
																																																																																																				  
																																																																																																				  }
																																																																																																				  else{$('div#contactable').trigger("click");	}})}})})}})
(jQuery);