/*
 * contactable 1.2 - 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 2009-09-24 $
 *
 */

(function($){$.fn.contactable=function(options){var defaults={name:'Name',email:'Email',message:'Message',recipient:'test@test.co.uk',subject:'A contactable message',recievedMsg:'Thankyou 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><pre><b>Shimla Hills Tour & Travel</b></pre><pre>Desh Raj Thakur Building</pre><pre>Shop No. 1</pre><pre>PO-Ghanahatti</pre><pre>Shimla- 171011 (HP)</pre><br><pre><u>Contact Details</u></pre><br /><pre>Contact Person : Mr. Naresh Thakur</pre><pre>Mobile 	: 	9816050779</pre><pre>Mobile 	: 	9459213454</pre><pre>Landline: 	0177-2775013</pre><pre>Website : 	www.himachalcity.in</pre><pre>E-mail 	: 	info@himachalcity.in</pre><br /><pre><u>Bank Details</u></pre><br /><pre>SBI Bank, Lower Bazar Shimla - 31911829320,<br /> IFSC- SBIN0010729</pre><pre>UBI, The Mall Shimla - 309502010013145</pre></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},comment:{required:true}},messages:{name:"",email:"",comment:""},submitHandler:function(){$('.holder').hide();$('#loading').show();$.get('mail.php',{recipient:$('#recipient').val(),subject:$('#subject').val(),name:$('#name').val(),email:$('#email').val(),comment:$('#comment').val()},function(data){$('#loading').css({display:'none'});if(data=='success'){$('#callback').show().append(defaults.recievedMsg)}else{$('#callback').show().append(defaults.notRecievedMsg)}})}})})}})(jQuery);
