function _CF_checkzip(object_value)
{
	if (object_value.length == 0)
		return true;

	if (object_value.length != 5 && object_value.length != 10)
		return false;

	if (object_value.charAt(0) == "-" || object_value.charAt(0) == "+")
		return false;

	if (!_CF_checkinteger(object_value.substring(0,5)))
		return false;

	if (object_value.length == 5)
		return true;

	if (object_value.charAt(5) != "-" && object_value.charAt(5) != " ")
		return false;

	if (object_value.charAt(6) == "-" || object_value.charAt(6) == "+")
		return false;

	return (_CF_checkinteger(object_value.substring(6,10)));
}

re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/

function TestEmail(TheForm,TheField,TheValue)
{
	if (re.test(TheValue)) {
		return true
	}
	if (TheValue == "none"){
		return true
	}
		return false
}

function _CF_onError(error_message, input_name)
    {
	alert(error_message);
	document.forms[1][input_name].focus();
	document.forms[1][input_name].select();
      	return false;
    }

function _CF_hasValue(obj)
	{
    	if (obj.value.length == 0)
      		return false;
    	else
      		return true;
    	}

function _val_Button(btn) {
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }
    if (cnt > -1) 
    		return true;
    else 
    		return false;
}

function _CF_hasCheckd(box)
	{
    	if (box.value.checked == false)
      		return false;
    	else
      		return true;
    	}
		
	
		
		
		


function  CheckSupportForm(_CF_this)
    {
/*	if (document.SupportForm.Erase[1].checked == true && document.SupportForm.notguaranteed.checked == false) {
 		if	(!_CF_onError("Please check the box stating that I understand the retention of my data is not guaranteed and G-Tech is not liable as described above",  "notguaranteed")) {
 			return false; }
	}
*/
    if  (!_CF_hasValue(_CF_this.FirstName)){
        if  (!_CF_onError("Please enter your First Name", "FirstName")) {
            return false; }
        }
    if  (!_CF_hasValue(_CF_this.LastName)){
        if  (!_CF_onError("Please enter your Last Name", "LastName")) {
            return false; }
        }
    if  (!TestEmail(_CF_this, _CF_this.Email, _CF_this.Email.value)) {
        if  (!_CF_onError("Please enter a valid email address", "Email")) {
            return false; }
        }
    if  (!_CF_hasValue(_CF_this.Phone)) {
        if  (!_CF_onError("Please Enter your Phone Number ", "Phone")) {
            return false; }
        }
    if  (!_CF_hasValue(_CF_this.Address1)) {
        if  (!_CF_onError("Please Enter your Address", "Address1")) {
            return false; }
        }
    if  (!_CF_hasValue(_CF_this.City)) {
        if  (!_CF_onError("Please Enter your City", "City")) {
            return false; }
        }
    if  (!_CF_hasValue(_CF_this.Postal)) {
        if  (!_CF_onError("Please Enter your Postal Code", "Postal")) {
            return false; }
        }
    if  (!_CF_hasValue(_CF_this.Model)) {
        if  (!_CF_onError("Please Select a G-Tech Product Model", "Postal")) {
            return false; }
        }
    if  (!_CF_hasValue(_CF_this.Serial)) {
        if  (!_CF_onError("Please Enter your G-TECH Product's Serial Number ", "Serial")) {
            return false; }
        }
    if  (!_CF_hasValue(_CF_this.PurchaseDate)) {
        if  (!_CF_onError("Please Enter when you Purchased your Unit", "PurchaseDate")) {
            return false; }
        }
/*    if  (!_CF_hasValue(_CF_this.FWadapter)) {
        if  (!_CF_onError("Please Enter what port your product is plugged into", "FWadapter")) {
            return false; }
       }

    if  (!_val_Button(_CF_this.Erase)) {
        if  (!_CF_onError("Please let us know if it is OK to erase the data on your drive during repair", "OtherFW")) {
            return false; }
        }
*/ 

    if  (!_CF_hasValue(_CF_this.Summary)) {
        if  (!_CF_onError("Enter A Summary of your trouble", "Summary")) {
            return false; }
        }
    if  (!_CF_hasValue(_CF_this.Detail)) {
        if  (!_CF_onError("We need more detail - Please enter the details of your trouble", "Detail")) {
            return false; }
        }
    return true;
	}
