// JavaScript Document
function doubleCheck(id, Page, PageNo) {
	var x=window.confirm("Are you sure you want to delete this entry?")
	if (x)
		location.href = 'index.php?p='+Page+'&View=Delete&Id='+id+'&PageNo='+PageNo;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex = 0;
}

//function to check valid email address
function isValidEmail(){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  strEmail = document.forms[0].ema_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 check_form(my_form) {
	var problem = false;
	validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  	strEmail = document.forms[0].con_email.value;
  	
	if (my_form.con_fname.value == "") {
		alert ("Enter your first name.\n");
		problem = true;
	} else if (my_form.con_lname.value == "") {
		alert ("Enter your Last name.\n");
		problem = true;
	} else if (strEmail.search(validRegExp) == -1) 
   	{
      alert('A valid e-mail address is required.\n');
      problem = true;
    } else if (my_form.con_comments.value == "") {
		alert ("Enter your commentary.\n");
		problem = true;
	}
	
	if (problem) {
		return false;
	} else {
		return true;
	}
}