$(document).ready(function(){
	
	$('body, img, div').pngFix();
	
	$('div#top-menu ul li').animate({ opacity: 0.7 }, 100);
	
	$('div#top-menu ul li').hover(function() {
		$(this).stop().animate({ opacity: 1.0 }, 400);
	}, function() {
		$(this).stop().animate({ opacity: 0.7 }, 400);
	});
	
	//$('div#cont-left').animate({ opacity: 0.1 }, 100).animate({ opacity: 1.0 }, 1000);
	

	$("form#contactForm").submit(function() { 	
		
		var uEmail = escape($('input#email').val());
		var uTel = escape($('input#telephone').val());
		var uName = escape($('input#name').val());
		
		if (uEmail == '' || uTel == '' || uName == '' ) {
			
			alert('Please enter information for all fields');
			return false;
			
		} else {
		
			token = Math.floor(Math.random()*3554871221);
			var queryString = $(this).serialize();
			$.ajax({
				type: 'post',
				url:  $(this).attr('action'),
				data: queryString,
				beforeSend: function() {
					$('form#contactForm').hide();
					$('div#tmp').append('<div id="loading"><p>Please wait, sending enquiry...</p></div>');
				},
				success: function(result) {
					$('div#loading').hide();
					if (result == 'OK') {
						$('p#success').append('<p>Your enquiry has been sent, thank you!</p>').fadeIn().show();
					} else {
						$('#BigError').show();
						$('#BigError').append('<p>ERROR: '+result+'</p>');
					}	
				}
			});
			
			return false;
		
		}
		
	});
	
	
	$('div#header').cycle({fx:'fade', timeout:8000});


	
	


});
