﻿
function KeyDownHandler(btn)
{

 if (event.keyCode == 13)
    {
    for(var i=0 ;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf(btn) >=0)
        {
              // process only the Enter key
   
        // cancel the default submit
        event.returnValue=false;
        event.cancel = true;
        // submit the form by programmatically clicking the specified button
        document.forms[0].elements[i].click();
    }
        }
    }
  
}


function maxsize(obj,mx){
	if(obj.value.length>mx) {
		obj.value=obj.value.substring(0,mx); 
	}
}

function textlen(x,y){
  var thelength = x.value.length;
  window.status=thelength+' of '+y+' maximum characters.';
}

function maxtext(x,y){
tempstr = x.value
  if(tempstr.length>y){
    x.value = tempstr.substring(0,y);
  }
  textlen(x,y);
}
/*********************/
function emptyText(txtField, str){
	if(txtField.value==str){
		txtField.value="";
	}
}


