jQuery(document).ready(function(){
	$('#contactform').submit(function(){
		var action = $(this).attr('action');
		$("#message").slideUp(750,function() {
		$('#message').hide();
 		$('#submit')
			.after('<img src="../web-design-graphics/ajax-loader.gif" class="loader" />')
			.attr('disabled','disabled');
		$.post(action, {
			subject: $('#subject').val(),
			package_name: $('#package_name').val(),
			title: $('#title').val(),
			name: $('#name').val(),
			company: $('#company').val(),
			email: $('#email').val(),
			phone: $('#phone').val(),
			website: $('#website').val(),
			comments: $('#comments').val(),
			howFoundUs: $('#howFoundUs').val()
		},
			function(data){
				document.getElementById('message').innerHTML = data;
				$('#message').slideDown('slow');
				$('#contactform img.loader').fadeOut('slow',function(){$(this).remove()});
				$('#contactform #submit').attr('disabled',''); 
				if(data.match('success') != null) $('#contactform').slideUp('slow');
			});
		});
		return false; 
	});
	
	$('#frm_link_exchange').submit(function(){
		var action = $(this).attr('action');
		$("#message").slideUp(750,function() {
		$('#message').hide();
 		$('#submit')
			.after('<img src="../web-design-graphics/ajax-loader.gif" class="loader" />')
			.attr('disabled','disabled');
		$.post(action, {
			major_category: $('#major_category').val(),
			package_name: $('#package_name').val(),
			website_title: $('#website_title').val(),
			website_url: $('#website_url').val(),
			website_desc: $('#website_desc').val(),
			reciprocal_link: $('#reciprocal_link').val(),
			website_author_name: $('#website_author_name').val(),
			website_author_email: $('#website_author_email').val(),
			howFoundUs: $('#howFoundUs').val()
		},
			function(data){
				document.getElementById('message').innerHTML = data;
				$('#message').slideDown('slow');
				$('#frm_link_exchange img.loader').fadeOut('slow',function(){$(this).remove()});
				$('#frm_link_exchange #submit').attr('disabled',''); 
				if(data.match('success') != null) $('#frm_link_exchange').slideUp('slow');
			});
		});
		return false; 
	});
	
});