function nFormU(e,b){
	var m='';
	var c=1;
	var u=trim(document.getElementById('username').value);
	//alert(u.length);
	if(u.length==0){
		m='You must enter a username/email address.';
	}else{
		if(u.length<6){
			m='Your username/email address must be at least 6 characters';
		}else{
			var e=checkemail(u);
			if(!e&&!b){
				c=confirm('Since you are not entering an email address, your account functionality will be limited to those functions that do not require an email address. Without an email address, you must provide your home phone number in order to create an account.You may choose to enter an email address at a later time if you wish.\n\nContinue creating your account without an email address?');  
			}
		}
	}			
	if(m.length||!c){
		if(m.length){				
			if(typeof window.translateAjax == 'function' ){
				alert(translateAjax(m));
			}else{
				alert (m);
			}			
		}
		if(e && e.preventDefault){
				e.preventDefault(); 
		}
		return false;
	}			 
}
function showPhones(){
	document.getElementById('morephonelink').style.display='none';
	document.getElementById('morephone').style.display='block';	
	return false;
}
function setF(e){
	document.getElementById(e).focus();
	return false;
}
function showVet(){
	if(document.getElementById('vetstatusyes').checked){
		document.getElementById('vetshow').style.display='block';
	}else{
		document.getElementById('vetshow').style.display='none';
	}
	return false;
}
function setStates(){
	if(document.getElementById('countryid').options[document.getElementById('countryid').selectedIndex].value=='USA'){
		document.getElementById('reqstatename').style.display='none';
		document.getElementById('reqstate').style.display='block';
		document.getElementById('vetbox').style.display='block';
	}else{
		document.getElementById('reqstatename').style.display='block';
		document.getElementById('reqstate').style.display='none';
		document.getElementById('vetbox').style.display='none';
	}
}
function nForm(e){
	var m='';
	var aE=new Array();
	var aEl=new Array();
	var aEc=new Array('homephone','password','confirmpassword','passwordhint','passwordanswer','firstname','lastname','address1','cityname','statename','postalcode','vetshow');
	var sE='';
	var isemail=parseInt(document.getElementById('isemail').value);			
	if(!isemail){
		if(trim(document.getElementById('homephone').value).length==0){
			m+='As you are not using an email address for your username, you must enter a home phone number.\n';
			aE[aE.length]='<div class="ncl l"><a href="#" onclick="return setF(\'homephone\');return false;">Home Phone</a></div>';
			aEl[aEl.length]='homephone';
		}
		if(trim(document.getElementById('password').value).length<6){
			m+='You must enter a password of at least 6 characters.\n';
			aE[aE.length]='<div class="ncl l"><a href="#" onclick="return setF(\'password\');">Choose Password</a></div>';
			aEl[aEl.length]='password';
		}else{
			if(trim(document.getElementById('confirmpassword').value)!=trim(document.getElementById('password').value)){
				m+='Your Password and your Confirm Password must match.\n';
				aE[aE.length]='<div class="ncl l"><a href="#" onclick="return setF(\'confirmpassword\');">Confirm Password</a></div>';
				aEl[aEl.length]='confirmpassword';
			}
		}
		if(parseInt(document.getElementById('passwordhint').value)==0){
			m+='You must choose a Password Hint.\n';
			aE[aE.length]='<div class="ncl l"><a href="#" onclick="return setF(\'passwordhint\');">Password Hint</a></div>';
			aEl[aEl.length]='passwordhint';
		}
		if(trim(document.getElementById('passwordanswer').value).length==0){
			m+='You must enter an answer for your Password Hint.\n';
			aE[aE.length]='<div class="ncl l"><a href="#" onclick="return setF(\'passwordanswer\');">Password Hint Answer</a></div>';
			aEl[aEl.length]='passwordanswer';
		}
	}	
	if(trim(document.getElementById('firstname').value).length==0){
		m+='You must enter your first name.\n';
		aE[aE.length]='<div class="ncl l"><a href="#" onclick="return setF(\'firstname\');return false;">First Name</a></div>';
		aEl[aEl.length]='firstname';
	}
	if(trim(document.getElementById('lastname').value).length==0){
		m+='You must enter your last name.\n';
		aE[aE.length]='<div class="ncl l"><a href="#" onclick="return setF(\'lastname\');return false;">Last Name</a></div>';
		aEl[aEl.length]='lastname';
	}
	if(trim(document.getElementById('address1').value).length==0){
		m+='You must enter your address.\n';
		aE[aE.length]='<div class="ncl l"><a href="#" onclick="return setF(\'address1\');return false;">Address</a></div>';
		aEl[aEl.length]='address1';
	}
	if(trim(document.getElementById('cityname').value).length==0){
		m+='You must enter your city.\n';
		aE[aE.length]='<div class="ncl l"><a href="#" onclick="return setF(\'cityname\');return false;">City</a></div>';
		aEl[aEl.length]='cityname';
	}
	if(document.getElementById('countryid').options[document.getElementById('countryid').selectedIndex].value!='USA'){
		if(trim(document.getElementById('statename').value).length==0){
			m+='You must enter your state/region.\n';
			aE[aE.length]='<div class="ncl l"><a href="#" onclick="return setF(\'statename\');return false;">State</a></div>';
			aEl[aEl.length]='statename';
		}
	}				
	if(trim(document.getElementById('postalcode').value).length==0){
		m+='You must enter your zip / postal code.\n';
		aE[aE.length]='<div class="ncl l"><a href="#" onclick="return setF(\'postalcode\');return false;">Zip /Postal Code</a></div>';
		aEl[aEl.length]='postalcode';
	}	
	if(m.length){
		if(typeof window.translateAjax == 'function' ){
			alert(translateAjax(m));
		}else{
			alert (m);
		}
		for(var i=0;i<aE.length;i++){
			sE+=aE[i];
		}
		if(sE.length>0){
			sE='<div class="flexwarn l">The following fields need to be corrected.</div>'+sE+'<div class="sp10"><div></div></div>';
			if(typeof window.translateAjax == 'function' ){
				sE=translateAjax(sE);
			}
			document.getElementById('awarn').innerHTML=sE;
		}		
		for(var i=0;i<aEc.length;i++){
			if(document.getElementById(aEc[i])){
				document.getElementById(aEc[i]).style.backgroundColor='#FFFFFF';
			}
		}
		for(var i=0;i<aEl.length;i++){
			document.getElementById(aEl[i]).style.backgroundColor='#ffe3e3';
		}
		if(e && e.preventDefault){
				e.preventDefault(); 
		}
		return false;
	}			 
}
