//AutoFormats textboxes to phone numbers
function fnFormatPhone(isField)
{
	isPhone = isField.value;
	isPhone = isPhone.replace(/\D/g,'');
	if (isPhone.length <= 7)
	{isPhone = isPhone.replace(/\D/g,'').replace(/^(\d{3})(\d{3})/,'(916) $1-$2');isField.value = isPhone;}
	if (isPhone.length > 7 && isPhone.length <= 10)
	{isPhone = isPhone.replace(/\D/g,'').replace(/^(\d{3})(\d{3})/,'($1) $2-');isField.value = isPhone;};
	if (isPhone.length > 10 && isField.Value.Lenght >= 14)
	{isPhone = isPhone.replace(/\D/g,'').replace(/^(\d{3})(\d{3})/,'($1) $2-');isField.value = isPhone;};
}
function contact_confirm_delete()
{
  if (confirm("Are you sure you want to delete this ticket?")==true)
    return true;
  else
    return false;
}
function fnTrapKD(btn, event){

 if (document.all){

  if (event.keyCode == 13){

   event.returnValue=false;

   event.cancel = true;

   btn.click();

  }

 }

 else if (document.getElementById){

  if (event.which == 13){

   event.returnValue=false;

   event.cancel = true;

   btn.click();

  }

 }

 else if(document.layers){

  if(event.which == 13){

   event.returnValue=false;

   event.cancel = true;

   btn.click();

  }

 }

}

