$(document).ready(function () {
//-----------------------------------------
//slideshow
$("#slideshow").jqGalScroll({ease:'easeInOutCubic',speed:1000});
// smooth scroll
$.localScroll();

//contact form
$("#contact-form").submit(function(){
		
var str = $(this).serialize();
   $.ajax({
   type: "POST",
   url: "/contact/contact.php",
   data: str,
   success: function(msg){
    
$("#email-message").ajaxComplete(function(event, request, settings){
if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
{
result = '<p class="icon ok"><strong>Your message has been sent. Thank you!</strong></p>';
$("#contact-form").hide("fast");
}
else
{
result = msg;
}
$(this).html(result);
});

}

 });
return false;
});

////////////////////////////////////////
//contact form
$("#enquiry-form").submit(function(){
		
var str = $(this).serialize();
   $.ajax({
   type: "POST",
   url: "/project-enquiry-files/contact.php",
   data: str,
   success: function(msg){
    
$("#enquiry-message").ajaxComplete(function(event, request, settings){
if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
{
result = '<div class="success"><p class="icon ok"><strong>Your enquiry has been sent. Thank you!</strong></p><p>I will get back to you within 2 days.</p></div>';
// won't hide form - just the submit button - as too big for that
$("#send-enquiry").hide("slow");
}
else
{
result = msg;
}
$(this).html(result);
});

}

 });
return false;
});



// new windows
$('A[rel="external"]').click( function() {
window.open( $(this).attr('href') );
return false;
});
//---------------------------------
});