function checkCharacter(obj,limit) { 

    var s = obj.value.length
    
    if (s <= limit) { //if it is > than the limit, crop the the value
        var counter = limit - s;
     }
    else {
        obj.value = obj.value.substring(0,limit)
        alert("Please enter " + limit + " characters or less")
    }
}
function checkCharacter2(obj,limit,label) { 

    var s = obj.value.length
    
    if (s <= limit) { //if it is > than the limit, crop the the value
        var counter = limit - s;
        label.value = counter;
     }
    else {
        obj.value = obj.value.substring(0,limit)
        alert("Please enter " + limit + " characters or less")
    }
}
function validateFormInfo()
{   
    return (
      checkString(document.CONTACTS.elements["company"],"Company") &&
      checkString(document.CONTACTS.elements["firstname"],"First Name") &&
      checkString(document.CONTACTS.elements["lastname"],"Family Name") &&
	  checkEmail(document.CONTACTS.elements["email"]) &&
      checkString(document.CONTACTS.elements["phone"],"Phone Number") &&
      checkString(document.CONTACTS.elements["yourrequest"],"Your request") &&
      checkInjection(document.CONTACTS.elements["yourrequest"],"Your request") 
	)
}

function validateFormInfo2()
{   
    return (
      checkString(document.CONTACTS.elements["username"],"Preferred Username") &&
      checkString(document.CONTACTS.elements["password"],"Preferred Password") &&
      checkString(document.CONTACTS.elements["firstname"],"First Name") &&
      checkString(document.CONTACTS.elements["lastname"],"Last Name") &&
	  checkEmail(document.CONTACTS.elements["email"]) &&
	  checkString(document.CONTACTS.elements["company"],"Company") &&
      checkRadioButton(document.CONTACTS.elements["description"],"Please choice one in\n\nWhick describes you best?") && 
      checkRadioButton(document.CONTACTS.elements["industry"],"Please choice one in\n\nIndustry Type") 
	  )
}

function cmdValidate()
{

if (validateFormInfo()) 
	{
	document.CONTACTS.submit();
	document.CONTACTS.ButtonSubmit.disabled=true
	return false;

	}
else 
	{
	return false;
	 }
}

function cmdAdd()
{
if (validateFormInfo()) 
	{
	document.CONTACTS.submit();
	}
else 
	{
	return false;
	 }
}

function DeleteRecord(Seqno){
  theMsg = "Are you sure you want to permanently delete this PS USER from the database?" 
  if (confirm(theMsg))
	    parent.location="XT_DeleteUser.asp?Seqno="+Seqno;
}


