function ChkForm(theForm){
if(theForm.txtQName.value == ""){
 	alert("Please provide your name.");
	theForm.txtQName.focus();
	return(false);
 }
var addr = theForm.stxtAddr.value;
if(addr == ""){
 	alert("Please provide the Shipping Address.");
	theForm.stxtAddr.focus();
	return(false);
 }

 if(addr.length < 20){
 	alert("Please provide the complete Shipping Address.");
	theForm.stxtAddr.focus();
	return(false);
 }

 if(theForm.txtQPhone.value == ""){
 	alert("Please provide your phone number.");
	theForm.txtQPhone.focus();
	return(false);
 }
  var chkPhone = strip(theForm.txtQPhone.value);
  if (chkPhone.length < 10){
    alert("Your telephone number needs to be at least 10 digits.");
	theForm.txtQPhone.value = chkPhone;
    theForm.txtQPhone.focus();
    return (false);
  }
 if(theForm.txtQEmail.value == ""){
 	alert("Please provide your email address.");
	theForm.txtQEmail.focus();
	return(false);
 }
var EMValue = theForm.txtQEmail.value;	
	var delim1 = EMValue.indexOf("@");
	var delim2 = EMValue.indexOf(".");
	if (delim1 == -1) {
		alert("Please fix your email address.");
		theForm.txtQEmail.focus();
		return (false);
	}		
	if (delim2 == -1) {
		alert("Please fix your email address.");
		theForm.txtQEmail.focus();
		return (false);
	}		
	if ((delim2 - delim1) < 3) {
		alert("Please fix your email address.");
		theForm.txtQEmail.focus();
		return (false);
	}

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@.-_";
  var checkStr = theForm.txtQEmail.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)    {
      allValid = false;
      break;
    }
  }
  if (!allValid)  {
    alert("Your EMail Address contains characters we don't recognize.");
    theForm.txtQEmail.focus();
    return (false);
  }
	
	if((theForm.rdoSize[1].checked == true)&&(theForm.imgSize.value=="")){
		alert("Please provide the dimensions you are interested in.");
		theForm.imgSize.focus();
    return (false);
		
		}
	return(true)
}

function strip(number) {
 var sOut = '';
 mask = '1234567890';
 for(count = 0; count <= number.length; count++) {
 	if(mask.indexOf(number.substring(count, count+1),0) != -1 ) sOut += number.substring(count,count+1);
 }
 return sOut;
}
