function confirmDeleteDir(form)
{
	var agree=confirm("Are you sure you want to delete this directory and all its content?");
	if (agree)
		form.submit()
	else
		return false ;
}

function confirmDeleteRec(form)
{
	var agree=confirm("Are you sure you want to delete this record?");
	if (agree)
		form.submit()
	else
		return false ;
}

function search(form)
{
	if (form.request.value==''){
		form.request.focus();return false;
	}
	else
		form.request.submit();
}


function isEmpty(strfield1, strfield2, strfield3) {

//change "field1, field2 and field3" to your field names
strfield1 = document.forms[0].field1.value 
strfield2 = document.forms[0].field2.value
strfield3 = document.forms[0].field3.value

  //name field
    if (strfield1 == "" || strfield1 == null || !isNaN(strfield1) || strfield1.charAt(0) == ' ')
    {
    alert("\"Field 1\" is a mandatory field.\nPlease amend and retry.")
    return false;
    }

  //url field 
    if (strfield2 == "" || strfield2 == null || strfield2.charAt(0) == ' ')
    {
    alert("\"Field 2\" is a mandatory field.\nPlease amend and retry.")
    return false;
    }

  //title field 
    if (strfield3 == "" || strfield3 == null || strfield3.charAt(0) == ' ')
    {
    alert("\"Field 3\" is a mandatory field.\nPlease amend and retry.")
    return false;
    }
    return true;
}

//function to check valid email address
function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  strEmail = document.forms[0].email.value;

   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
    {
      alert('A valid e-mail address is required.\nPlease amend and retry');
      return false;
    } 
    return true; 
}

function favorites(){
	if(document.all)
	window.external.AddFavorite(location.href, document.title)
}