function ShowDialog()
{
    Effect.Appear("overlay",{from: 0, to: 0.7, duration: 0.5, afterFinish: 
    function()
    {
       Effect.Appear("dialog",{from:0, to:1, duration: 0.5});
    }});
}

function HideDialog()
{
   Effect.Fade("dialog",{from: 1, to: 0, duration: 0.5, afterFinish:
   function()
   {
      Effect.Appear("overlay", {from: 0.7, to: 0, duration: 0.5, afterFinish: 
      function()
      {
           $('overlay').style.display="none";
      }});
   }});

}
  
//siteurl='http://togga.creospace.co.uk/';
 
function validateform() {
var reason = "";

  	reason += validatefirstname();
  	reason += validatebooking();
	reason += validattc();
	reason += validatetel();
	reason += validatecode();
  if (reason != "") {
    alert("Some fields need correction:\n" + reason);
    return false;
  }
else
{  document.customerregistration.action='east-london-recording-studio-rates-and-booking2.php';
   document.customerregistration.submit();
   
   }
}

function validatetel() {
    var error = "";
 
    if (document.customerregistration.phone.value == "") 
	{	
		document.getElementById("phone").style.backgroundColor = '#FFDFE3';
        error = "Please specify telephone number.\n";
    }
	else
	document.getElementById("phone").style.backgroundColor = 'white';  
    return error;  
}
function validatecode() {
    var error = "";
 
    if (document.customerregistration.code.value != "GhK55") 
	{	
		document.getElementById("code").style.backgroundColor = '#FFDFE3';
        error = "Please enter the correct anti spam code.\n";
    }
	else
	document.getElementById("code").style.backgroundColor = 'white'; 
    return error;  
}
function validattc() {
    var error = "";
 
    if (!document.customerregistration.tandc.checked) 
	{	
		document.getElementById("tandc").style.backgroundColor = '#FFDFE3';
        error = "Please confirm acceptance of Terms & Conditions.\n";
    }
	else
	document.getElementById("tandc").style.backgroundColor = 'white'; 
    return error;  
}

function validatefirstname() {
    var error = "";
 
    if (document.customerregistration.name.value == "") 
	{	
		document.getElementById("name").style.backgroundColor = '#FFDFE3';
        error = "Please specify your first name.\n";
    }
	else
	document.getElementById("name").style.backgroundColor = 'white'; 
    return error;  
}
function validatebooking() {
    var error = "";
 
    if (document.customerregistration.information.value == "") 
	{  
		document.getElementById("information").style.backgroundColor = '#FFDFE3';
        error = "Please specify your booking time.\n";
    }
	document.getElementById("tandc").style.backgroundColor = '#FFDFE3'; 
    return error;  
}
