    function taLimit() {
    	var taObj=event.srcElement;
    	if (taObj.value.length==255*1) return false;
    }
    
    function taCount(visCnt) { 
    	var taObj=event.srcElement;
    	if (taObj.value.length>255*1) taObj.value=taObj.value.substring(0,255*1);
    	if (visCnt) visCnt.innerText=255-taObj.value.length;
    }


	function ValidateUpload(){
		if (document.frm.FILE1.value=="") {
			alert("Please select the image from your local hard drive.")
			document.frm.FILE1.focus()
		return false }
	}

    function show(object) {
    	if (document.layers && document.layers[object] != null)
    	    document.layers[object].visibility = 'visible';
    	else if (document.all)
    	    document.all[object].style.visibility = 'visible';
    }
    function hide(object) {
    	if (document.layers && document.layers[object] != null)
    	    document.layers[object].visibility = 'hidden';
    	else if (document.all)
    	    document.all[object].style.visibility = 'hidden';
    }


var reWhitespace = /^\s+$/
var reEmail = /^.+\@.+\..+$/
//var sEmail = "Email"
var iEmail = "The email address that you entered does not meet minimum formatting\t\nrequirements. (e.g. walker@healthwalkers.com)"
var defaultEmptyOK = false
var mPrefix = "A value was not entered into the "
var mSuffix = " field. This\t\nis a required field. Please enter a value."

function getRadioButtonValue (radio) {

	for (var i = 0; i < radio.length; i++)
    {   if (radio[i].checked) { break }
    }
    return radio[i].value
}

function isEmpty(s) {
	return ((s == null) || (s.length == 0));
}

function isWhitespace (s) {
    return (isEmpty(s) || reWhitespace.test(s));
}

function isEmail (s) {
	return reEmail.test(s);
}

function warnEmpty (theField, s) {
	 theField.focus();
    alert(mPrefix + s + mSuffix);
    return false;
}

function warnInvalid (theField, s) {
    theField.focus();
    theField.select();
    alert(s);
    return false;
}

function checkEmail (theField, emptyOK) {
    if (!isEmail(theField.value, false)){
	warnInvalid (theField, iEmail);
    }else{
 	return true;
    }
}

function checkString (theField, s, emptyOK) {
    if (checkString.arguments.length == 2) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    if (isWhitespace(theField.value))
       return warnEmpty (theField, s);
    else return true;
}

function ValidateReg() {

	if (true) {
	
	if (!checkString(document.frm.email,'\"Email Address\"'))return false;
	if (!checkEmail(document.frm.email)) {
		document.frm.email.value = '';
		return false;
	}
	if (!checkString(document.frm.username,'\"User Name\"')) return false;
	if (document.frm.username.value.length < 5) {
		document.frm.username.focus();
		alert('Your \"Username\" must be a minimum of 5 characters.\t');
		return false;
	}
	if ((document.frm.username.value) == (document.frm.email.value)) {
		document.frm.username.focus();
		alert('Your \"Username\" can not be the same as your \t\n\"Email Address\".');
		document.frm.username.value = '';
		return false;
	}
	if (!checkString(document.frm.password,'\"Password\"')) return false;
	if (document.frm.password.value.length < 5) {
		document.frm.password.focus();
		alert('Your \"Password\" must be a minimum of 5 characters.\t');
		return false;
	}
	if (!checkString(document.frm.PASS2,'\"Repeat Password\"')) return false;
	if ((document.frm.password.value) != (document.frm.PASS2.value)) {
		document.frm.password.focus();
		alert('Your \"Password\" entries are unequal.\t\t\nPlease reenter them.');
		document.frm.password.value = '';
		document.frm.PASS2.value = '';
		return false;
	}
	if (!checkString(document.frm.fname,'\"First Name\"')) return false;
	if (!checkString(document.frm.lname,'\"Last Name\"')) return false;
	//if (!checkString(document.frm.address,'\"Address\"')) return false;
	if (!checkString(document.frm.city,'\"City"')) return false;
	if (!checkString(document.frm.opt1,'\"Zip / Postal Code\"')) return false;
	if(document.frm.opt2.options.selectedIndex == 0) {
		return warnEmpty (document.frm.opt2, '\"Gender\"');
		return false;
	}
	if(document.frm.opt2.options.selectedIndex == 0) {
		return warnEmpty (document.frm.opt3, '\"Birth Year\"');
		return false;
	}
	if(document.frm.s2.options.selectedIndex == 0) {
		document.frm.s2.focus();
		alert('How did you find us? Please select from the\t\n\"Referal Category\" list.\t');
		return false;
	}
	if((document.frm.s2.options.selectedIndex != 3) && (document.frm.s2.options.selectedIndex != 10)) {
	
		if(document.frm.s2.options.selectedIndex == 1) {
		if (!checkString(getobject("sw3"),'\"Key Words\"')) return false;
		}
		if((document.frm.s2.options.selectedIndex == 2)||(document.frm.s2.options.selectedIndex == 5)) {
		if (!checkString(getobject("sw3"),'\"Website URL\"')) return false;	
		}
		if(document.frm.s2.options.selectedIndex == 4) {
		if (!checkString(getobject("sw3"),'\"Chat Room URL\"')) return false;
		}
		if(document.frm.s2.options.selectedIndex == 6) {
		if (!checkString(getobject("sw3"),'\"Member Name\"')) return false;	
		}
		if((document.frm.s2.options.selectedIndex == 7)||(document.frm.s2.options.selectedIndex == 8)||(document.frm.s2.options.selectedIndex == 9)) {
		if (!checkString(getobject("sw3"),'\"Name, City and State\"')) return false;
		}
		if(document.frm.s2.options.selectedIndex == 11) {
		if (!checkString(getobject("sw3"),'\"Additional Descriptor\"')) return false;
		}
	
	}
	if (!checkString(document.frm.captcha,'\"Validation Code\"')) return false;
	}
	document.frm.corpcode.value = document.frm.cCode.value;
	//document.frm.cCode.value = "";
	
	if (document.frm.AgreeWithTerms.checked == false) {
	
		alert("User Agreement has not been checked.\t\t");
		return (false);
	}

	return true;
}


    
    
    // VALIDATE ADD
    function ValidateUser(){
        if (document.frm.email.value=="") {
        	alert("Please enter your emailx address.")
        	document.frm.email.focus()
        return false }		
        if (document.frm.username.value=="") {
        	alert("Please enter desired username; must be between 5 and 25 characters.")
        	document.frm.username.focus()
        return false }
        
        
        if (document.frm.password.value=="") {
        	alert("Please enter desired password; must be between 5 and 25 characters.")
        	document.frm.password.focus()
        return false }
        if (document.frm.PASS2.value=="") {
        	alert("Please enter password confirmation.")
        	document.frm.PASS2.focus()
        return false }	
        
        
        if (document.frm.name.value=="") {
        	alert("Please enter your name in this format. (Lastname Firstname)")
        	document.frm.name.focus()
        return false }		
    }


 // VALIDATE ADD & EDIT USER    
    function ValidateUserEdit(){
        if (document.frm.name.value=="") {
        	alert("Please enter username.")
        	document.frm.name.focus()
        return false }
        if (document.frm.password.value=="") {
        	alert("Please enter desired password.")
        	document.frm.password.focus()
        return false }
        if (document.frm.email.value=="") {
        	alert("Please enter user's email address.")
        	document.frm.email.focus()
        return false }
    }
    
    
    
    // VALIDATE URL 
    function ValidateURL(URL){
    	if (document.frm.url.value=="") {
    		alert("The web site URL is empty.")
    		document.frm.url.focus()
    	return false 
    	} else {
    		window.open(URL)
    		return true
    	}
    }
    
    // VALIDATE LOGIN FORM
    function ValidateReminder(){
        if (document.frm.email.value=="") {
        	alert("Please enter your email address.")
        	document.frm.email.focus()
        return false }
    }
        
    // VALIDATE LOGIN FORM
    function ValidateLogin(){
        if (document.frm.username.value=="") {
        	alert("Please enter your username.")
        	document.frm.username.focus()
        return false }
        if (document.frm.password.value=="") {
        	alert("Please enter your password.")
        	document.frm.password.focus()
        return false }
    }
    
    function getobject(obj){
    
    	if (document.getElementById)
    		return document.getElementById(obj)
    	else if (document.all)
    		return document.all[obj]
    }
    
	function tttt(){

		alert("vvvvvv")
    }
    
    	
	function replacetextsp0(obj){
	getobject("sp3").innerHTML = "<div><font>&nbsp;&nbsp;</font>Additional Descriptor:</div>";
	}


	function referal(obj) {
	if(document.frm.s2.options.selectedIndex == 1) {
	getobject("sp3").innerHTML = "<div><FONT color='red'>*</font>&nbsp;Key Words:</div>";
	}
	if(document.frm.s2.options.selectedIndex == 2) {
	getobject("sp3").innerHTML = "<div><FONT color='red'>*</font>&nbsp;Website URL:</div>";
	}
	if((document.frm.s2.options.selectedIndex == 3)) {
	getobject("sp3").innerHTML = "<div><font>&nbsp;&nbsp;</font>Company Name:</div>";
	}
	if(document.frm.s2.options.selectedIndex == 4) {
	getobject("sp3").innerHTML = "<div><FONT color='red'>*</font>&nbsp;Chat Room URL:</div>";
	}
	if(document.frm.s2.options.selectedIndex == 5) {
	getobject("sp3").innerHTML = "<div><FONT color='red'>*</font>&nbsp;Website URL:</div>";
	}
	if(document.frm.s2.options.selectedIndex == 6) {
	getobject("sp3").innerHTML = "<div><FONT color='red'>*</font>&nbsp;Member Name:</div>";
	}
	if(document.frm.s2.options.selectedIndex == 7) {
	getobject("sp3").innerHTML = "<div><FONT color='red'>*</font>&nbsp;Name, City and State:</div>";
	}
	if(document.frm.s2.options.selectedIndex == 8) {
	getobject("sp3").innerHTML = "<div><FONT color='red'>*</font>&nbsp;Name, City and State:</div>";
	}
	if(document.frm.s2.options.selectedIndex == 9) {
	getobject("sp3").innerHTML = "<div><FONT color='red'>*</font>&nbsp;Name, City and State:</div>";
	}
	if((document.frm.s2.options.selectedIndex == 10)||(document.frm.s2.options.selectedIndex == 0)) {
	getobject("sp3").innerHTML = "<div><font>&nbsp;&nbsp;</font>Additional Descriptor:</div>";
	}
	if(document.frm.s2.options.selectedIndex == 11) {
	getobject("sp3").innerHTML = "<div><FONT color='red'>*</font>&nbsp;Additional Descriptor:</div>";
	}
	}
    