// Check Email Address
function call_email() {     
    
    var array = new Array();        
    array = document.getElementById('email').value; 
	//document.getElementById('email').disabled = 'disabled';
    agent.call('/inc/ajax/signup.php','checkEmail','callback_email',array); 
}

function call_email2() {
	var array = new Array();        
    array = document.getElementById('email').value; 
	//document.getElementById('email').disabled = 'disabled';
    agent.call('/inc/ajax/signup.php','checkEmail','callback_email2',array); 
}

// Send Back Verification
function callback_email(str) {  
	//document.getElementById('email').disabled = '';
	//alert(result);
	/*switch(result) {
		case -1: // sql error!
			return -1;
		case 3: // email is a special allow (from sql allowed table)
		case 1: // email is allowed
			var web_address = document.getElementById('email').value;
			document.getElementById('email_auth').value='1';        
			div = document.getElementById('contentdiv');
			div.innerHTML = '';
			return 1;
		case -2: // email syntax is invalid
		case -3: // email domain isn't real
			div = document.getElementById('contentdiv');
			div.innerHTML = 'Please enter a valid corporate email address';
			document.getElementById('email_auth').value='0';        
			return 1;
		case 2: // email has been blocked
	        div = document.getElementById('contentdiv');
        	div.innerHTML = 'Dyadem only accepts corporate email addresses';
        	document.getElementById('email_auth').value='0';
        	return 2;
		//case 4: // name (the first part of the email, _name_@whatever.com) already used
		case 5: // email already used
			div = document.getElementById('contentdiv');
			document.getElementById('email_auth').value='0';
			div.innerHTML = 'Email address has already been registered';
		default: break;
	}*/

    if (str == "1") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'Dyadem Ony Accepts Corporate Email Addresses';
        document.getElementById('email_auth').value='0';        
        return 1;
    } else if (str == "2") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'Please Enter A Valid Email Address';
        document.getElementById('email_auth').value='0';
        return 1;
    } else if (str == "4") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'This Username Already Exists in our Database, Please choose another';
        document.getElementById('email_auth').value='0';        
        return 1;
    } else if (str == "5") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'This Email Address Already Exists in our Database, Please choose another';
        document.getElementById('email_auth').value='0';
        return 1; 
	} else if (str == "6") {
	    div = document.getElementById('contentdiv');
        div.innerHTML = 'Dyadem only accepts corporate email address. If you wish to contact us, please <a href="http://www.dyadem.com/company/contactform.php?contact_type=Alliances">click here</a>';
        document.getElementById('email_auth').value='0';
        return 1; 	
    } else {
        var web_address = document.getElementById('email').value;
        document.getElementById('email_auth').value='1';        
        div = document.getElementById('contentdiv');
        div.innerHTML = '';
    }
}

// Send Back Verification
function callback_email2(str) {  
	//document.getElementById('email').disabled = '';
	//alert(result);
	/*switch(result) {
		case -1: // sql error!
			return -1;
		case 3: // email is a special allow (from sql allowed table)
		case 1: // email is allowed
			var web_address = document.getElementById('email').value;
			document.getElementById('email_auth').value='1';        
			div = document.getElementById('contentdiv');
			div.innerHTML = '';
			return 1;
		case -2: // email syntax is invalid
		case -3: // email domain isn't real
			div = document.getElementById('contentdiv');
			div.innerHTML = 'Please enter a valid corporate email address';
			document.getElementById('email_auth').value='0';        
			return 1;
		case 2: // email has been blocked
	        div = document.getElementById('contentdiv');
        	div.innerHTML = 'Dyadem only accepts corporate email addresses';
        	document.getElementById('email_auth').value='0';
        	return 2;
		//case 4: // name (the first part of the email, _name_@whatever.com) already used
		case 5: // email already used
			div = document.getElementById('contentdiv');
			document.getElementById('email_auth').value='0';
			div.innerHTML = 'Email address has already been registered';
		default: break;
	}*/
	
	//alert(str)
	
    if (str == "1") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'Dyadem Ony Accepts Corporate Email Addresses';
        document.getElementById('email_auth').value='0';        
        return 1;
    } else if (str == "2") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'Please Enter A Valid Email Address';
        document.getElementById('email_auth').value='0';
        return 1;
    /*} else if (str == "4") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'This Username Already Exists in our Database, Please choose another';
        document.getElementById('email_auth').value='0';        
        return 1;
    } else if (str == "5") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'This Email Address Already Exists in our Database, Please choose another';
        document.getElementById('email_auth').value='0';
        return 1;*/ 
	} else if (str == "6") {
	    div = document.getElementById('contentdiv');
        div.innerHTML = 'Dyadem only accepts corporate email address. If you wish to contact us, please <a href="http://www.dyadem.com/company/contactform.php?contact_type=Alliances">click here</a>';
        document.getElementById('email_auth').value='0';
        return 1; 
    } else {
        var web_address = document.getElementById('email').value;
        document.getElementById('email_auth').value='1';        
        div = document.getElementById('contentdiv');
        div.innerHTML = '';
    }

}

function validateRegistration(form) {        
	
    first = validateFirstName('submission');
    last = validateLastName('submission');
    company = validateCompanyName('submission');
    industry = validateIndustry('submission');
    country = validateCountry('submission');
    state = validateState('submission');
    city = validateCity('submission');
    zip = validateZip('submission');
    //zip_valid = checkZip(document.form1.zip.value)
    address = validateAddress('submission');
    phone = validatePhone('submission');    
    email = document.getElementById('email_auth').value;
    call_email();
    //password = validatePassword('submission');
   
   error = 0;
   
    if (first == 1) {  error = 1; return false; }  
    if (last == 1) {  error = 1; return false; }   
    if (company == 1) {  error = 1; return false; }    
    if (industry == 1) {  error = 1; return false; }   
    if (country == 1) {  error = 1; return false; }        
    if (state == 1){  error = 1; return false; }       
    if (city == 1) {  error = 1; return false; }       
    if (zip == 1) {  error = 1; return false; }                
    //if (zip_valid == 2) { return false; }               
    if (email != 1) {  error = 1; return false; }  
    if (address == 1) {  error = 1; return false; }    
    if (phone == 1) {  error = 1; return false; } 
    //if (password == 1) {  return false; }       
	
	if (error != 1) {	 
	 form.submit();	
	} else {
		return false;
	}
	


}


function switchState(str) {
    agent.call('/inc/ajax/signup.php','getStates','callback_switchState',str);
}

function callback_switchState(str) {
    
    document.form1.state.options.length=0;
	//document.form1.b_state.options.length=0;
    
    for (i=0; i< str.length ; i++) { 
        
        document.form1.state.options[i]=new Option(str[i][1], str[i][0], true, false);      
		//document.form1.b_state.options[i]=new Option(str[i][1], str[i][0], true, false);      
    }       
    
    /*
    document.form1.state.options[0]=new Option("Sports", "sportsvalue", true, false)
    document.form1.state.options[1]=new Option("Music", "musicvalue", false, false)
    document.form1.state.options[2]=new Option("Movies", "moviesvalue", false, false)
    */
    
    //div = document.getElementById('states');
    //div.innerHTML = str;
    
}

function checkZip(value) {      
    
    var country = document.form1.country.value;
    div = document.getElementById('zipDiv');        
    
    if (country !='United States' || country !='Canada') {
        
        if (country == '') {
            div.innerHTML = "Please select a country that corresponds to your ZIP/Postal Code";
            return 2;       
        } else if (value == ''){
            div.innerHTML = "Please select a ZIP/Postal Code";                      
        } else {
            return true;    
        }               
        
    } else {
        
        if (country == 'United States') {
            if (value.search(/^[0-9][0-9][0-9][0-9][0-9]$/) == -1 ) {           
                div.innerHTML = "Please enter a valid ZIP Code.  Accepted format is 00000";
                document.form1.zip.focus();
                return 2;
            } else {
                    div.innerHTML = "";
            }   
            
        } else if (country == 'Canada') {
            if (value.search(/^[A-Z][0-9][A-Z][0-9][A-Z][0-9]$/) == -1) {           
                div.innerHTML = "Please enter a valid Postal Code. Accepted format is A1A1A1";
                document.form1.zip.focus();
                return 2;           
            } else {
                div.innerHTML = "";
            }   
        }       
    
    }                   

}


function validateFirstName(type) {
    
    var fname = document.form1.first_name.value;
    fname_div = document.getElementById('fnameDiv');
    
    if (type == 'submission') {
        
        if (fname == '') {      
            fname_div.innerHTML = 'Please enter your first name';       
            return 1;   
        } else {
            fname_div.innerHTML = '';       
        }
            
    } else {
        
        if (fname != '') {      
            fname_div.innerHTML = '';       
        }
        
    }
                    
}

function validateLastName(type) {
    
    var lname = document.form1.last_name.value;
    lname_div = document.getElementById('lnameDiv');
    
    if (type == 'submission') {
        
        if (lname == '') {      
            lname_div.innerHTML = 'Please enter your last name';    
            return 1;   
        } else {
            lname_div.innerHTML = '';       
        }
            
    } else {
        
        if (lname != '') {      
            lname_div.innerHTML = '';       
        }
        
    }
                    
}

function validateTitle(type) {
    
    var title = document.form1.title.value;
    title_div = document.getElementById('titleDiv');
    
    if (type == 'submission') {     
        if (title == '') {      
            title_div.innerHTML = 'Please enter your title';
            return 1;   
        } else {
            title_div.innerHTML = '';       
        }           
    } else {        
        if (title != '') {      
            title_div.innerHTML = '';       
        }       
    }                   
}

function validateCompanyName(type) {
    
    var cname = document.form1.company_name.value;
    cname_div = document.getElementById('cnameDiv');
    
    if (type == 'submission') {     
        if (cname == '') {      
            cname_div.innerHTML = 'Please enter your company name';
            return 1;   
        } else {
            cname_div.innerHTML = '';       
        }           
    } else {        
        if (cname != '') {      
            cname_div.innerHTML = '';       
        }       
    }                   
}

function validateIndustry(type) {   
    var industry = document.form1.industry.value;
    industry_div = document.getElementById('industryDiv');      
    
    if (type == 'submission') {     
        if (industry == '') {       
            industry_div.innerHTML = 'Please enter your industry';  
            return 1;   
        } else {
            industry_div.innerHTML = '';        
        }           
    } else {        
        if (industry != '') {       
            industry_div.innerHTML = '';        
        }       
    }                   
}

function validateCountry(type) {    
    var country = document.form1.country.value;
    country_div = document.getElementById('countryDiv');
    
    if (type == 'submission') {     
        if (country == '') {        
            country_div.innerHTML = 'Please enter your country';        
            return 1;   
        } else {
            country_div.innerHTML = '';     
        }           
    } else {        
        if (country != '') {        
            country_div.innerHTML = '';     
        }       
    }                   
}

function validateState(type) {  
    
    var state = document.form1.state.value;
    var country = document.form1.country.value;
    state_div = document.getElementById('stateDiv');    
    
    //if (country == 'United States' || country == 'Canada') {
    
    if (type == 'submission') {     
        if (state == '') {      
            state_div.innerHTML = 'Please enter a state';       
            return 1;   
        } else {
            state_div.innerHTML = '';       
        }           
    } else {        
        if (state != '') {      
            state_div.innerHTML = '';       
        }       
    }
    
    //}

}

function validateCity(type) {   
    var city = document.form1.city.value;
    city_div = document.getElementById('cityDiv');
    
    if (type == 'submission') {     
        if (city == '') {       
            city_div.innerHTML = 'Please enter a city';     
            return 1;   
        } else {
            city_div.innerHTML = '';        
        }           
    } else {        
        if (city != '') {       
            city_div.innerHTML = '';        
        }       
    }                   
}

function validateZip(type) {    
    var zip = document.form1.zip.value;
    zip_div = document.getElementById('zipDiv');
    
    if (type == 'submission') {     
        if (zip == '') {        
            zip_div.innerHTML = 'Please enter a zip code';      
            return 1;   
        } else {
            zip_div.innerHTML = '';     
        }           
    } else {        
        if (zip != '') {        
            zip_div.innerHTML = '';     
        }       
    }                   
}

function validateAddress(type) {    
    var address = document.form1.address_1.value;
    address_div = document.getElementById('addressDiv');
    
    if (type == 'submission') {     
        if (address == '') {        
            address_div.innerHTML = 'Please enter an address';      
            return 1;   
        } else {
            address_div.innerHTML = '';     
        }           
    } else {        
        if (address != '') {        
            address_div.innerHTML = '';     
        }       
    }                   
}

function validatePhone(type) {  
    var phone = document.form1.phone.value;
    phone_div = document.getElementById('phoneDiv');
    
    if (type == 'submission') {     
        if (phone == '') {      
            phone_div.innerHTML = 'Please enter a phone number';
            return 1;           
        } else {
            phone_div.innerHTML = '';   
            return 2;   
        }           
    } else {        
        if (phone != '') {      
            phone_div.innerHTML = '';       
        }       
    }                   
}

function validateInterest(type) {  
    var interest = document.form1.interest.value;
    interest_div = document.getElementById('interestDiv');
    
    if (type == 'submission') {     
        if (interest == '') {      
            interest_div.innerHTML = 'Please enter an area of interest';
            return 1;           
        } else {
            interest_div.innerHTML = '';   
            return 2;   
        }           
    } else {        
        if (interest != '') {      
            interest_div.innerHTML = '';       
        }       
    }                   
}

function validateEmployeeNum(type) {  
    var employeeNum = document.form1.employeeNum.value;
    employeeNum_div = document.getElementById('employeeNumDiv');
    
    if (type == 'submission') {     
        if (employeeNum == '') {      
            employeeNum_div.innerHTML = 'Please enter how many empolyees are in your company';
            return 1;           
        } else {
            employeeNum_div.innerHTML = '';   
            return 2;   
        }           
    } else {        
        if (employeeNum != '') {      
            employeeNum_div.innerHTML = '';       
        }       
    }                   
}

function validateRevenue(type) {  
    var revenue = document.form1.revenue.value;
    revenue_div = document.getElementById('revenueDiv');
    
	
    if (type == 'submission') {     
        if (revenue == '') {      
            revenue_div.innerHTML = 'Please enter how many empolyees are in your company';
            return 1;           
        } else {
            revenue_div.innerHTML = '';   
            return 2;   
        }           
    } else {        
        if (revenue != '') {      
            revenue_div.innerHTML = '';       
        }       
    }                   
}

function validatePassword(type) {

    var password1 = document.form1.password_1.value;
    var password2 = document.form1.password_2.value;
    
    pass1_div = document.getElementById('pass1Div');
    pass2_div = document.getElementById('pass2Div');
    
    //alert(password1 + " - " + password2);
    
    if (type == 'submission') {     
        if (password1 == '') {      
            pass1_div.innerHTML = 'Please enter a password';                    
        } else {
            pass1_div.innerHTML = '';               
        }
        
        if (password2 == '') {      
            pass2_div.innerHTML = 'Please enter the confirm password';                  
        } else {
            pass2_div.innerHTML = '';               
        }
        
        if (password1 == '' || password1 == '') {
            return 1;
        } else if (password2 != password1) {
            pass2_div.innerHTML = 'Please make sure both passwords are identical';
            return 1;   
        }       
                                
    } else {
        
        if (password1 != '') {      
            pass1_div.innerHTML = '';       
        }
        
        if (password2 != '') {      
            pass2_div.innerHTML = '';       
        }
        
    }   
    
    
}

function validateForm4(form) {    
    
    first = validateFirstName('submission');
    last = validateLastName('submission');
    company = validateCompanyName('submission');
    industry = validateIndustry('submission');
    country = validateCountry('submission');
    state = validateState('submission');
    city = validateCity('submission');
    zip = validateZip('submission');
	title = validateTitle('submission');
    //zip_valid = checkZip(document.form1.zip.value)
    address = validateAddress('submission');
    phone = validatePhone('submission');    
    email = document.getElementById('email_auth').value;
    call_email2();
    //password = validatePassword('submission');
   
   
    if (first == 1) {  return false; }  
    if (last == 1) {  return false; }   
     if (title == 1) {  return false; } 
	if (company == 1) {  return false; }    
    if (industry == 1) {  return false; }   
    if (country == 1) {  return false; }        
    if (state == 1){  return false; }       
    if (city == 1) {  return false; }       
    
	if (zip == 1) {  return false; }                
    //if (zip_valid == 2) { return false; }               
    if (email != 1) {  return false; }  
    if (address == 1) {  return false; }    
    if (phone == 1) {  return false; } 
    //if (password == 1) {  return false; } 
  
    document.form1.submit();   
    
}

function validateForm2(form) {    
    
    first = validateFirstName('submission');
    last = validateLastName('submission');
    company = validateCompanyName('submission');
    industry = validateIndustry('submission');
    country = validateCountry('submission');
    state = validateState('submission');
    city = validateCity('submission');
    zip = validateZip('submission');
	title = validateTitle('submission');
    //zip_valid = checkZip(document.form1.zip.value)
    address = validateAddress('submission');
    phone = validatePhone('submission');    
    email = document.getElementById('email_auth').value;
    call_email();
    //password = validatePassword('submission');
   
   
    if (first == 1) {  return false; }  
    if (last == 1) {  return false; }   
     if (title == 1) {  return false; } 
	if (company == 1) {  return false; }    
    if (industry == 1) {  return false; }   
    if (country == 1) {  return false; }        
    if (state == 1){  return false; }       
    if (city == 1) {  return false; }       
    
	if (zip == 1) {  return false; }                
    //if (zip_valid == 2) { return false; }               
    if (email != 1) {  return false; }  
    if (address == 1) {  return false; }    
    if (phone == 1) {  return false; } 
    //if (password == 1) {  return false; } 
  
    document.form1.submit();   
    
}

function validateForm(form) {    
    
	// validation for alliances submission.
	
    first = validateFirstName('submission');
    last = validateLastName('submission');
    company = validateCompanyName('submission');
    industry = validateIndustry('submission');
    country = validateCountry('submission');
    state = validateState('submission');
    city = validateCity('submission');
    zip = validateZip('submission');
    //zip_valid = checkZip(document.form1.zip.value)
    address = validateAddress('submission');
    phone = validatePhone('submission');    
    email = document.getElementById('email_auth').value;
    call_email();
    //password = validatePassword('submission');
    
   
    if (first == 1) {  return false; }  
    if (last == 1) {  return false; }   
    if (company == 1) {  return false; }    
    if (industry == 1) {  return false; }   
    if (country == 1) {  return false; }        
    if (state == 1){  return false; }       
    if (city == 1) {  return false; }       
    if (zip == 1) {  return false; }                
    //if (zip_valid == 2) { return false; }               
    if (email != 1) {  return false; }  
    if (address == 1) {  return false; }    
    if (phone == 1) {  return false; } 	
    //if (password == 1) {  return false; } 
  
    var doc = document.form1;   
    
    doc.submitBtn.value = 'Please wait ... ';
    doc.submitBtn.disabled = true;
 
    industry = doc.industry.value.replace('&', 'and');  
    // send variables to php script
    var array = new Array(doc.first_name.value,doc.last_name.value,doc.company_name.value,industry,doc.country.value,doc.state.value,doc.city.value,doc.zip.value,doc.address_1.value,
                          doc.address_2.value,doc.phone.value,doc.email.value);    
    agent.call('/inc/ajax/signup.php','registerUser','callback_register',array);    

}

function validateForm3(form) {    
    
    first = validateFirstName('submission');
    last = validateLastName('submission');
    company = validateCompanyName('submission');   
    country = validateCountry('submission');
    state = validateState('submission');
    city = validateCity('submission');
    zip = validateZip('submission');
    //zip_valid = checkZip(document.form1.zip.value)
    address = validateAddress('submission');
    phone = validatePhone('submission');    
    email = document.getElementById('email_auth').value;
    call_email2();
    interest = validateInterest('submission');
	employeeNum = validateEmployeeNum('submission');
	revenue = validateRevenue('submission');
	//password = validatePassword('submission');
   
   //	alert(first + '-' + last + '-' + company + '-' + country + '-' + state + '-' + city + '-' + zip + '-' + address + '-' + phone + '-' + email + '-' + interest + '-' + employeeNum + '-' + revenue);
   
    if (first == 1) {  return false; }  
    if (last == 1) {  return false; }   
    if (company == 1) {  return false; }        
    if (country == 1) {  return false; }        
    if (state == 1){  return false; }       
    if (city == 1) {  return false; }       
    if (zip == 1) {  return false; }                
    //if (zip_valid == 2) { return false; }               
    if (email != 1) {  return false; }  
    if (address == 1) {  return false; }    
    if (phone == 1) {  return false; } 
    //if (password == 1) {  return false; } 
  	if (interest == 1) {  return false; } 
	if (employeeNum == 1) {  return false; } 
	if (revenue == 1) {  return false; } 
    var doc = document.form1;   
    
    doc.submitBtn.value = 'Please wait ... ';
    doc.submitBtn.disabled = true;
 //	alert('test');
    //industry = doc.industry.value.replace('&', 'and');  
    // send variables to php script
    var array = new Array(doc.first_name.value,doc.last_name.value,doc.company_name.value,doc.country.value,doc.state.value,doc.city.value,doc.zip.value,doc.address_1.value,
                          doc.address_2.value,doc.phone.value,doc.email.value,doc.interest.value,doc.addition_information.value,doc.employeeNum.value,doc.revenue.value,doc.solutions.value);    
    agent.call('/inc/ajax/signup.php','sendAllianceEmail','callback_sendMail',array);    

}

function callback_register(str) {
    
    window.location = '/index.php?msg=2';
    // need to change this function to redirect to a welcome landing page.
    
    /*
    var doc = document.form1;   
    
    doc.submitBtn.value = 'Register Now';
    doc.submitBtn.disabled = false;
    
    sfdiv = document.getElementById('sfDiv');   
    alert(str);
    */
}


function callback_sendMail(str) {
	
	window.location = '/partners/thankyou/';
	
}

function checkEmails(type) {        	  				
 	
	
	
	agent.call('/inc/ajax/signup.php','checkEmail','senderCB',document.form1.sender.value); 
	agent.call('/inc/ajax/signup.php','checkEmail','recipientCB',document.form1.recipient.value); 	   
	error = 0;		
	if(document.getElementById('sender-auth').value != 1) {
		error = 1
	}
	
	if(document.getElementById('recipient-auth').value != 1) {
		error = 1
	} 
	
	
	if (type == 'submit') {	
		if(error == 0) {
			document.form1.action = 'forward-send.php';	
			document.form1.submit();	
		} 
	}
}


function senderCB(str) {	
	 if (str == "1") {
        div = document.getElementById('sendError');
        div.innerHTML = 'Dyadem Ony Accepts Corporate Email Addresses';
        document.getElementById('sender-auth').value='0';        
        return 1;
    } else if (str == "2") {
        div = document.getElementById('sendError');
        div.innerHTML = 'Please Enter A Valid Email Address';
        document.getElementById('sender-auth').value='0';
        return 1;
    /*} else if (str == "4") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'This Username Already Exists in our Database, Please choose another';
        document.getElementById('email_auth').value='0';        
        return 1;
    } else if (str == "5") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'This Email Address Already Exists in our Database, Please choose another';
        document.getElementById('email_auth').value='0';
        return 1; */
    } else {       
        document.getElementById('sender-auth').value='1';        
        div = document.getElementById('sendError');
        div.innerHTML = '';
    }	
}

function recipientCB(str) {	
	 if (str == "1") {
        div = document.getElementById('recpError');
        div.innerHTML = 'Dyadem Ony Accepts Corporate Email Addresses';
        document.getElementById('recipient-auth').value='0';        
        return 1;
    } else if (str == "2") {
        div = document.getElementById('recpError');
        div.innerHTML = 'Please Enter A Valid Email Address';
        document.getElementById('recipient-auth').value='0';
        return 1;
    /*} else if (str == "4") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'This Username Already Exists in our Database, Please choose another';
        document.getElementById('email_auth').value='0';        
        return 1;
    } else if (str == "5") {
        div = document.getElementById('contentdiv');
        div.innerHTML = 'This Email Address Already Exists in our Database, Please choose another';
        document.getElementById('email_auth').value='0';
        return 1; */
    } else {       
        document.getElementById('recipient-auth').value='1';        
        div = document.getElementById('recpError');
        div.innerHTML = '';
    }				
}



