// JavaScript Document

$(document).ready(function()
{
    $("#div_subMenu img").hover
	(
      function () {
        //$(this).append($("<span> ***</span>"));
		$(this).attr("src",($(this).attr("src").replace(/-ma-/ig, "-mo-")));
      }, 
      function () {
		  if($(this).attr("alt") != "selected")
		  {
        	$(this).attr("src",($(this).attr("src").replace(/-mo-/ig, "-ma-")));
		  }
      }
    );
	
	$("#div_gallery img").hover
	(
      function () {
        //$(this).append($("<span> ***</span>"));
		$(this).attr("src",($(this).attr("src").replace(/-ma-/ig, "-mo-")));
      }, 
      function () {
        $(this).attr("src",($(this).attr("src").replace(/-mo-/ig, "-ma-")));
      }
    );
	
	$("#div_subMenu .thickbox").lightBox();
	$("#div_gallery a").lightBox();
	
	$("#link_submit").click(function()
	{ 
		if($("#form_contact").valid())
		{
            $.post( "Enquiry.php", 
                $("#form_contact").serialize(), 
                function(data){ 
                    alert(data); 
               } 
        	); 
		}
    });  
	
	$("#form_contact").validate();
})

function Submit()
{
	$.post("SendEmail.php",  { name: $("txt_name").attr("text"), phone: $("txt_phone").attr("text"), email: $("txt_email").attr("text"), inquiry:$("txt_inquiry").attr("text") },
	  function(data){
		alert("Data Loaded: " + data);
	  });
	
}
