//::Gray Rollover
function GrayBTN(imgID,status){
	if (status==0)
		imgID.style.filter='progid:DXImageTransform.Microsoft.BasicImage(grayScale=1)'
	else
		imgID.style.filter=''
}

//::Successful record insert message
function DisplayMSG(varName){
	alert('» Thank you, ' + varName + '!\nYou have been successfully entered into our mailing list database.');
}

//::Login Error message
function DisplayLoginError(){
	alert('» Error\nThe username/password entered is incorrect.');
}

//::Record not found message
function DisplayNoRecord(){
	alert('» Error\nThe e-mail address you have entered was not found.');
}

//::Record deleted message
function DisplayRecordDeleted(){
	alert('» Your information has been successfully removed from the Farmingdale Aquatics database.');
}

//::Letter saved message
function DisplayLetterSaved(){
	alert('» The letter has been successfully saved.');
}

//::Admin. messages
function AdminMSG(msg){
	switch (msg) {
		case "add":
			alert('Record has been successfully added!');
			break;
		case "edit":
			alert('Record has been successfully edited!');
			break;
		case "delete":
			alert('Record has been successfully deleted!');
			break;
	}
}

//::Validate Fields
function ValidateFields() {
	missinginfo = "";
	var objForm = document.frmMailingList;
	if (objForm.firstname.value == "") {
	missinginfo += "\n     »  First Name";
	}
	if ((objForm.email.value == "") || 
	(objForm.email.value.indexOf('@') == -1) || 
	(objForm.email.value.indexOf('.') == -1)) {
	missinginfo += "\n     »  E-Mail Address";
	}
	if (missinginfo != "") {
	missinginfo = "The following information was entered incorrectly:\n" +
	missinginfo + "\n\nPlease re-enter the information and try again...";
	alert(missinginfo);
	return false;
	}
	else return true;
}

//::Confirm Delete
function del(url){
	if (confirm("Are you sure you want to delete this record?")) {location.href=url};
}

//::Auto-centering pop-up window
var win = null;
function CiPopWin(mypage,myname,w,h,scroll,resize){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resize+'';
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}
