if (document.images){	
	//home
	btn_the_hanger_on= new Image();
	btn_the_hanger_on.src="/images/btn_the_hanger_on.gif";  
	
	btn_the_hanger= new Image(); 
	btn_the_hanger.src="/images/btn_the_hanger.gif";
	
	btn_advertisers_on= new Image();
	btn_advertisers_on.src="/images/btn_advertisers_on.gif";  
	
	btn_advertisers= new Image();
	btn_advertisers.src="/images/btn_advertisers.gif"; 
	
	//about
	btn_customised_on= new Image();
	btn_customised_on.src="/images/btn_customised_hangers_on.gif";  
	
	btn_customised= new Image();
	btn_customised.src="/images/btn_customised_hangers.gif"; 
	 
	//salons
	btn_dry_cleaners_on= new Image();
	btn_dry_cleaners_on.src="/images/btn_dry_cleaners_on.gif";  
	
	btn_dry_cleaners= new Image();
	btn_dry_cleaners.src="/images/btn_dry_cleaners.gif"; 	 
	 
	//services
	btn_contact_on= new Image();
	btn_contact_on.src="/images/btn_contact_on.gif";  
	
	btn_contact= new Image();
	btn_contact.src="/images/btn_contact.gif";
	
	
	//home image
	home_image = new Image();
	home_image = "/images/hanger_bg.gif";
	
	//custom hangers
	customised_hangers = new Image();
	customised_hangers = "/images/customised_bg2.gif";
   }
 

function turnoff(imgName){
   if (document.images){
      imgOff=eval(imgName + ".src");
      document[imgName].src= imgOff;
    }
 }


function turnon(imgName){
   if (document.images){
      imgOn=eval(imgName + "_on.src");
      document[imgName].src= imgOn;
    }
 }
 
 
 
function changeContact(xxx){
	//alert(xxx.value);
	if (xxx.value == "required"){
		xxx.value = "";
	}
	xxx.style.borderColor = '#73b717';
	xxx.style.backgroundColor = '#ffffff';
	
	
}

function moveContact(xxx){
	if (xxx.value.length < 2 ){
		xxx.value = "required";
		//xxx.fontSize = "10px";
		//xxx.style.color = '#FF0000';
		xxx.style.borderColor = '#FF0000';
	}else{
	xxx.style.borderColor = '#cccccc';
	}
}



function validateSignup(myForm){
  var field = myForm.drycleaner_email; // email field
  var str = myForm.drycleaner_email.value; // email string
  var str2 = myForm.drycleaner_telephone.value; // email string
  var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
  var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
  var msg = "";
  var msgTop = "The field(s) listed below still need to be entered correctly\n\n"
	
	if(myForm.drycleaner_firstname.value == ""){
	msg += "First Name:  -- Please enter your First Name\n"
	}
	
	if(myForm.drycleaner_surname.value == "" || myForm.drycleaner_surname.length < 2){
	msg += "Last Name:  -- Please enter your Last Name\n"
	}


  if (!reg2.test(str)) { 
  msg += "E-mail:  -- Please enter your e-mail, \"" + str + "\" is an invalid e-mail\n"; 
  }
  
 if (!checkUKTelephone (str2)) {
      msg += "Telephone Number: " +telNumberErrors[telNumberErrorNo];
  }
  // Otherwise redisplay telephone number on form in corrected format
  else {
     str2 =  checkUKTelephone (str2);
  }
	
	
		var fValue = myForm.drycleaner_postcode.value;
//	var pValue = document.forms["homePcode"].pcode.value;
	if ( 5 < fValue.length > 9){
		msg += "Postcode:  -- Please enter a valid  UK postcode\n"; 
		//return false;
		
	}else{
		
		pcode1a = /^[a-z,A-Z]{1,1}\d\s\d([a-zA-Z]{2,2})/;
		pcode1b = /^[a-z,A-Z]{1,1}\d\d([a-zA-Z]{2,2})/;
		pcode2a = /^[a-z,A-Z]{2,2}\d\s\d[a-zA-Z]{2,2}/;
		pcode2b = /^[a-z,A-Z]{2,2}\d\d[a-zA-Z]{2,2}/;
		pcode3a = /^[a-z,A-Z]{2,2}\d\d\s\d[a-zA-Z]{2,2}/;
		pcode3b = /^[a-z,A-Z]{2,2}\d\d\d[a-zA-Z]{2,2}/;
	
		if (pcode1a.test(fValue) || pcode1b.test(fValue)){
			//alert("type1");
			//document.forms["homePcode"].submit();
		}else if (pcode2a.test(fValue) || pcode2b.test(fValue)){
			//alert("type2");
			//document.forms["homePcode"].submit();
		}else if (pcode3a.test(fValue) || pcode3b.test(fValue)){
			//alert("type3");
			//document.forms["homePcode"].submit();
		}else{
			msg += "Postcode:  -- Please enter a valid  UK postcode\n";
			//return false;
		}
	
	}
  
	
	if (msg != ""){
	alert(msgTop + msg);
	//return false;
	}else{
		//return true;
		myForm.submit();
	}
}

 

function validateContact(myForm){
  var field = myForm.contact_email; // email field
  var str = myForm.contact_email.value; // email string
  var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
  var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
  
 // var str2 = myForm.contact_tel.value; // email string
 // var reg11 = /^\+?0?\d{2,4}[\d -]{6,9}$/;
  var msg = "";
  var msgTop = "The field(s) listed below still need to be entered correctly\n\n"

	if(myForm.contact_name.value == ""){
	msg += "Name:  -- Please enter your name\n"
	}


  if (!reg2.test(str)) { 
  msg += "E-mail:  -- Please enter your e-mail, \"" + str + "\" is an invalid e-mail\n"; 
  }
  
  

	if(myForm.contact_comments.value == ""){
	msg += "Message:  -- Please enter a message you would like to send to us\n";
	}
	
	if (msg != ""){
	alert(msgTop + msg);
	//return false;
	}else{
		myForm.submit();
	}
}



