function checkEmail(formName, fieldName) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document[formName][fieldName].value)){
		return (true);
	}
	else {
		alert("The Email Address That you have enter is invalid. Please correct it.")
	}
}

function enCode(strCode) {
	return (escape(strCode));
}

function disabledField(formName, fieldName, fieldValue) {
	document[formName][fieldName].value = fieldValue;
}

function submitOnce() {
	if (submitted == 0) {
		submitted++;
	}
	else {
		alert("This page has already been submitted. Please wait.")
	}
}

function checkCheckBox(formName, fieldName, alertMessage) {
	if (document[formName][fieldName].checked) {
		alert(alertMessage);
	}	
}

function textAreaMaxLenght(formName, fieldName, MaxLenght, alertMessage) {
	if (document[formName][fieldName].value.length > MaxLenght) {
		alert(alertMessage);
	}	
}

function closeWindow() {
	window.close();
}

function openMenulesswindow(pageUrl, windowWidth, windowHeight, showscrollbars, showresizable) {
	window.open(pageUrl, "MenuLessWindow", "width=" + windowWidth + ",height=" + windowHeight + ",location=0,menubar=0,resizable=" + showresizable + ",scrollbars=" + showscrollbars + ",status=1,titlebar=0,toolbar=0");
}

function cancelredirect(pageurl) {
	window.location = pageurl;
}

function openerSelect(form, field, formvalue) {
	window.opener.document[form][field].value = formvalue;
	closeWindow();
}

function deleteEntry(url) {
	agree = confirm("Are you sure you want to delete this record?")
	if (agree)  {
		window.location = url;	
	}
}

function selectArticle(formName, fieldName, fieldValue) {
	opener[formName][fieldName].value = fieldValue;
	opener[formName].submit();
	closeWindow();
}