$(document).ready(function() {

$('.head').click(function(){
	$('.deets').hide();
	$('.head .s').html('+');
	$(this).siblings('.deets').show();
	$('.s',this).html('-');
});

$('.head:first').siblings('.deets').show();

$('#himg1').cycle({
	fx: 'fade',
	timeout: 6000,
	random: 1
});

$('#himg2').cycle({
	fx: 'fade',
	timeout: 6000,
	random: 1,
	delay: 200
});

$('#himg3').cycle({
	fx: 'fade',
	timeout: 6000,
	random: 1,
	delay: 400
});

$('#himg4').cycle({
	fx: 'fade',
	timeout: 6000,
	random: 1,
	delay: 600
});

$('#heroes').cycle({
	fx: 'fade',
	timeout: 3000,
	random: 1,
	speed: 1200
});

$("#conform").submit(function(){

var str = $(this).serialize();
   $.ajax({
   type: "POST",
     url: "http://trnsw.com.au/php/contactForm.php",
   data: str,
   success: function(msg){
$("#noter").ajaxComplete(function(event, request, settings){
if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
{
$("#conform").fadeOut(200);
$("#confirmation").delay(200).fadeIn(500);
$("#noter").fadeOut(200);
}
else
{
$('#noter').fadeIn(500);
result = msg;
}
$(this).html(result);
});
}
});
return false;
});

$('#products li[rel]').tipsy({title: 'rel', gravity: 's'});

});
