function placeFocus() {
	if (document.forms.length > 1) {
		var field = document.forms[1];
		for (i = 0; i < field.length; i++) {
			if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
				document.forms[1].elements[i].focus();
				break;
         	}
    	}
  	}
}
function confirmation(keyid, name, location, destination)
{
 var where_to = confirm("Do you really want to delete '" + name + "'");

 if (where_to == true)
 {
   window.location= location + keyid;
   alert(name + ' has been deleted.');
 }
 else
 {
	if(destination != '')
		 window.location= destination;
 }
}

function getObject(obj) {
  var theObj;
  if(document.all) {
    if(typeof obj=="string") {
      return document.all(obj);
    } else {
      return obj.style;
    }
  }
  if(document.getElementById) {
    if(typeof obj=="string") {
      return document.getElementById(obj);
    } else {
      return obj.style;
    }
  }
  return null;
}

function toCount(entrance,exit,text,characters) {
  var entranceObj=getObject(entrance);
  var exitObj=getObject(exit);
  var length=characters - entranceObj.value.length;
  if(length <= 0) {
    length=0;
    text='<span class="disable"> '+text+' </span>';
    entranceObj.value=entranceObj.value.substr(0,characters);
  }
  exitObj.innerHTML = text.replace("{CHAR}",length);
}
function checkSubmit(frm) {
	
	frm.Search.disabled = true;
	frm.Search.value = 'Searching. Please Wait...';
	//alert('test');
	frm.submit();
	//frm.Search.disabled = false;
	//frm.Search.value = 'Search';
	//return true;
}
