// JavaScript Document
function checkReg(strng,field) {
 var error = "";
 if (strng == "") {
    error = "You didn't enter "+field+" .\n";
 }
 return error;
}
function checkWholeForm(theForm) {
    var why = "";
    why += checkReg (theForm.user_name.value,"User Name");    
	why += checkReg (theForm.pwd.value,"Password");    
	why += checkReg (theForm.name.value,"Name");    
	why += checkReg (theForm.title.value,"Title");    
	why += checkReg (theForm.addr1.value,"Address");    
	why += checkReg (theForm.city.value,"City");    
	why += checkReg (theForm.state.value,"State/Province");    
	why += checkReg (theForm.zip.value,"Zip/Postal Code");    
	why += checkReg (theForm.country.value,"Country");    
	why += checkReg (theForm.work_phone.value,"Work Phone");    
   
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}

function textCounter(field,cntfield,maxlimit) 
{
	if (field.value.length > maxlimit) 
	{
		field.value = field.value.substring(0, maxlimit);
	}
	else
	{
		cntfield.value = maxlimit - field.value.length;
	}
}