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"))

   	        {

       	    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.siteurl, "TEXT" )) 

        {
        if  (!_CF_onError(_CF_this, _CF_this.siteurl, _CF_this.siteurl.value, "Please enter your site URL"))

   	        {

       	    return false; 

           	}
        }

    if  (!_CF_hasValue(_CF_this.sitetitle, "TEXT" )) 

        {
        if  (!_CF_onError(_CF_this, _CF_this.sitetitle, _CF_this.sitetitle.value, "Please enter your site title"))

   	        {

       	    return false; 

           	}
        }
        
    if  (!_CF_hasValue(_CF_this.shortdescription, "TEXT" )) 

        {
        if  (!_CF_onError(_CF_this, _CF_this.shortdescription, _CF_this.shortdescription.value, "Please fill out your site short description"))

   	        {

       	    return false; 

           	}
        }

    if  (!_CF_hasValue(_CF_this.urllink, "TEXT" )) 

        {
        if  (!_CF_onError(_CF_this, _CF_this.urllink, _CF_this.urllink.value, "Please enter URL of your link"))

   	        {

       	    return false; 

           	}
        }

    if  (!_CF_hasValue(_CF_this.urlpage, "TEXT" )) 

        {
        if  (!_CF_onError(_CF_this, _CF_this.urlpage, _CF_this.urlpage.value, "Please enter URL of the page where you put our link"))

   	        {

       	    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.linkexchangeform.submit) {
		document.linkexchangeform.submit.disabled = true;
		document.linkexchangeform.submit.value = '  please wait...  ';
	}

	if (submitDone == 0) {
		submitDone = 1;
		return true;
	}
	else { 
		if (!document.linkexchangeform.submit || !document.all) {
			alert("Please wait..."); 
		}
		return false; 
	}   	    


    } 