var submitDone;
submitDone = 0;

var selectedproDone;
selectedproDone= 0;


function isEmail(s)
	{
		var test=""+s ;
		for (var k=0; k <test.length; k++)
		{
			var c=test.substring(k,k+1);
			if (c=="@")
			{
				return (true);
			}
		}
		return (false);
	}

function _CF_onError(form_object, input_object, object_value, error_message)
    {
	alert(error_message);
		input_object.focus();
       	return false;	
    }



function _CF_hasValue(obj, obj_type)
    {
    if (obj_type == "TEXT")
	{
    	if (obj.value.length == 0) 
      		return false;
    	else 
      		return true;
   	}
    else if (obj_type == "EMAIL")
	{
		if (isEmail(obj.value)==false)
      		return false;
    	else 
      		return true;
	}   	
    else if (obj_type == "RADIO")
	{

        for (i=0; i < obj.length; i++)
	    	{
		if (obj[i].checked)
			return true;
		}

       	return false;	
	}	
    else if (obj_type == "CHECKBOX")
	{
		if (obj.checked)
			return true;

       	return false;	
	}
	}

function  _CF_checkcheckform(_CF_this)

    {


    if  (!_CF_hasValue(_CF_this.name, "TEXT" )) 

        {
        if  (!_CF_onError(_CF_this, _CF_this.name, _CF_this.name.value, "Please enter your name or your company"))

   	        {

       	    return false; 

           	}
        }
        
    if  (!_CF_hasValue(_CF_this.email, "TEXT" )) 

        {
        if  (!_CF_onError(_CF_this, _CF_this.email, _CF_this.email.value, "Please enter your email"))

   	        {

       	    return false; 

           	}
        }
    else if  (!_CF_hasValue(_CF_this.email, "EMAIL" )) 
    	{
        if  (!_CF_onError(_CF_this, _CF_this.email, _CF_this.email.value, "Please enter a right value for the 'Email' field."))

   	        {

       	    return false; 

           	}    	
    	}

     if  (_CF_this.email.value != _CF_this.confirm_email.value) 

        {

        if  (!_CF_onError(_CF_this, _CF_this.confirm_email, _CF_this.confirm_email.value, "You must retype your email address same as above email address"))

            {

            return false; 

            }

        }
        
    if  (!_CF_hasValue(_CF_this.content, "TEXT" )) 

        {
        if  (!_CF_onError(_CF_this, _CF_this.content, _CF_this.content.value, "Please fill out your question"))

   	        {

       	    return false; 

           	}
        }
        
    if  (!_CF_hasValue(_CF_this.txtNumber, "TEXT" )) 

        {
        if  (!_CF_onError(_CF_this, _CF_this.txtNumber, _CF_this.txtNumber.value, "Please fill out your verify code"))

   	        {

       	    return false; 

           	}
        }

	if (document.all && document.contactform.submit) {
		document.contactform.submit.disabled = true;
		document.contactform.submit.value = '  please wait...  ';
	}

	if (submitDone == 0) {
		submitDone = 1;
		return true;
	}
	else { 
		if (!document.contactform.submit || !document.all) {
			alert("Please wait..."); 
		}
		return false; 
	}   	    


    } 