/*=====================================================================================*/
/*                                 JAVASCRIPT FUNCTION
/*=====================================================================================*/

var win= null;
	
function popupWindow(mypage, myname, w, h) {
	
	var winl = (screen.width-w) / 2;
	var wint = (screen.height-h) / 2;
	var settings = "height=" +h+ ",width=" +w+ ",top=" +wint+ ",left=" +winl+ ",menubar=no,toolbar=no,location=no,scrollbars=no,resizable=no";
	win=window.open(mypage,myname,settings);
	
	if(parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
	
} 

/*=====================================================================================*/
function ConfirmDelete(object) { // pop up confirm to delete

	if(confirm("Are you sure remove this one?") == true) {
		document.forms[0].submit();
		return true;	
	}else {
		return false;	
	}
	
}

/*=====================================================================================*/
function ConfirmDelete1(object) { // pop up confirm to delete

	if(confirm("Are you sure remove this one?") == true) {
		document.forms[1].submit();
		return true;	
	}else {
		return false;	
	}
	
}

/*=====================================================================================*/
function ConfirmDelete2(object) { // pop up confirm to delete

	if(confirm("Are you sure remove this one?") == true) {
		document.forms[2].submit();
		return true;	
	}else {
		return false;	
	}
	
}

/*=====================================================================================*/
function numberOnly(object) {

	var regExp = /^[0-9]*$/;
	
	if (!regExp.test(object.value)) {
		alert("Only numbers allowed!");
		object.value = object.value.replace(/[^0-9]/g,"");
	}
	
}

/*=====================================================================================*/
function clearData() { // reset data in form

	document.forms[0].reset();
	return false;
	
}

/*=====================================================================================*/
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.');
      return false;
    }
	
    return true; 
	
}

/*=====================================================================================*/
function MM_jumpMenu(target, selectObj, restore) {

	eval(target + ".location='" + selectObj.options[selectObj.selectedIndex].value + "'");
	if(restore) {
		selectObj.selectedIndex = 0;	
	}
	
}

/*=====================================================================================*/
