function ValidateNo(NumStr, String)
{				
	for(var Idx=0; Idx<NumStr.length; Idx++)
	{
		var Char = NumStr.charAt(Idx);
		var Match = false;

		for(var Idx1=0; Idx1<String.length; Idx1++)
		{
			if(Char == String.charAt (Idx1))
				Match = true;
		}

		if (!Match) 
			return false;
	}
	return true;
}

function ValidateContactDetail()
{
	//validating name
	if (objFrm.txtname.value == "")
	{
		alert("Please enter your name.");
		objFrm.txtname.focus();
		return false;
	}
	
	//validating company name
	if (objFrm.txtcname.value == "")
	{
		alert("Please enter your company name.");
		objFrm.txtcname.focus();
		return false;
	}

	//validating email
	var mail = objFrm.txtemail.value;

	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById("txtemail").value)))
	{
		alert("Invalid E-mail Address! Please re-enter.")
		document.getElementById("txtemail").focus()
		return false;	
	}
		
	//validating phone number
	//country code
	if (objFrm.cphone.value == "")
	{
		alert("Please enter value for Phone number");
		objFrm.cphone.focus();
		return false;
	}
	
	if(!ValidateNo(objFrm.cphone.value,"0123456789+- "))
	{
		alert("Please Enter Only Number");
		objFrm.cphone.focus();
		return false;
	}
	//area code
	if (objFrm.aphone.value == "")
	{
		alert("Please enter value for Phone number");
		objFrm.aphone.focus();
		return false;
	}
	
	if(!ValidateNo(objFrm.aphone.value,"0123456789+- "))
	{
		alert("Please Enter Only Number");
		objFrm.aphone.focus();
		return false;
	}
	//phone code
	if (objFrm.pphone.value == "")
	{
		alert("Please enter value for Phone number");
		objFrm.pphone.focus();
		return false;
	}
	
	if(!ValidateNo(objFrm.pphone.value,"0123456789+- "))
	{
		alert("Please Enter Only Number");
		objFrm.pphone.focus();
		return false;
	}
	
	//validating country
	if (objFrm.country.selectedIndex == 0)
	{
		alert("Please select your country");
		objFrm.country.focus();
		return false;
	}
	
	//validating comments
	if (objFrm.comments.value == "")
	{
		alert("Please enter comments.");
		objFrm.comments.focus();
		return false;
	}
	
	return true;	
}