function sendrequest() 
	{ 
	  var name = document.getElementById('name').value;
	  var email = document.getElementById('email').value;
	  var address = document.getElementById('address').value;
	  var phone = document.getElementById('phone').value;
	  var fax = document.getElementById('fax').value;
	  var postcode = document.getElementById('postcode').value;
	  var country = document.getElementById('country').value;
  	  var enquiry = document.getElementById('enquiry').value;
	  var security_code = document.getElementById('security_code').value;

 if(trim(name)=="")
	{
			alert("Please enter the name.");
			document.myform.name.focus();
			return false;
	
	}
	
 if(trim(email)=="")
	{
			alert("Please enter the E-mail address.");
			document.myform.email.focus();
			return false;
	
	}
    else
    {
        if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,5})+$/.test(email)))
        {
             alert("Please Enter Valid email ");
             document.myform.email.focus();
             return false;
        }
    }
    
     if(trim(country)=="0")
    {
            alert("Please select a Country ");
            document.myform.country.focus();
            return false;
    
    }
    
    if(trim(phone)=="")
    {
            alert("Please enter the Phone No.");
            document.myform.phone.focus();
            return false;
    
    }
    		


  else if(trim(enquiry)=="")
	{
			alert("Please enter the Enquiry .");
			document.myform.enquiry.focus();
			return false;
	
	}
	if(trim(security_code)=="")
	{
			alert("Please enter the Security code .");
			document.myform.security_code.focus();
			return false;
	
	}
	else {

		new Ajax.Request("send-contact.php", 
			{ 
			method: 'post', 
			postBody: 'submit=submit&email='+email
            +'&enquiry='+enquiry
            +'&name='+name
            +'&phone='+phone
            +'&address='+address
            +'&postcode='+postcode
            +'&fax='+fax
			+'&security_code='+security_code
            +'&country='+country,
			onComplete: showResponse 
			});
		}	
	}				
		
	function showResponse(req){
	   
	   var response=req.responseText;
	   //alert(response);
		if(trim(response)=="nosecure"){
			document.getElementById('show').innerHTML="Your security code is Incorrect. Please enter the correct code";
		}else{
		window.location.href="contact_thanks.php";
		}
        //document.getElementById('left_column').innerHTML= "<b>Contact US</b><br><br>Thank you for sending  query to Raffles Shirts webmaster.";
}

/*########################## */

function trim(inputString)
{
    inputString = inputString.replace(/^\s+/g,"");
    inputString = inputString.replace(/\s+$/g,"");
    return inputString;
}


