function confirmleaving(newlink)
{
	alert("YOU ARE LEAVING THE BASILE STATE BANK WEB SITE.\n\nThe Web site you have selected is an external one located on another server. Basile State Bank has no responsibility for any external web site. It neither endorses the information, content, presentation, or accuracy nor makes any warranty, express or implied, regarding any external site.");
	window.location=(newlink);
}

function Popup(title,filename,w,h,scroll,resizable,menubar) {
	title = (title == '') ? 'popup' : title;
	scroll = (scroll == 'scroll') ? 'yes' : 'no';
	resizable = (resizable == 'lock') ? 'no' : 'yes';
	menubar = (menubar == 'menu') ? 'yes' : 'no';

	winOptions = eval("'width="+w+",height="+h+",toolbar=no,location=no,directories=no,status=no,menubar="+menubar+",scrollbars="+scroll+",resizable="+resizable+",copyhistory=no'");
	w = window.open(filename,title,winOptions)
	if (!w) {
		alert("\nAn important message could not be displayed because a popup blocker was detected.\nPlease set your blocker to allow popups for this site and refresh this page.");
		return false;
	}
}


function ValidateForm()
{
	if (!MoreInfo.firstname.value)
	{
		alert("Please enter your First Name.");
		MoreInfo.firstname.focus();
		MoreInfo.firstname.select();
		return false;
	}
	
	else if (!MoreInfo.lastname.value)
	{
		alert("Please enter your Last Name.");
		MoreInfo.lastname.focus();
		MoreInfo.lastname.select();
		return false;
	}
	
	else if (!validEmail(MoreInfo.email.value))
	{
		alert("Please enter your valid Email Address.");
		MoreInfo.email.focus();
		MoreInfo.email.select();
		return false;
	}
	
	else if (!MoreInfo.daytime_tel.value)
	{
		alert("Please enter your Daytime Telephone Number.");
		MoreInfo.daytime_tel.focus();
		MoreInfo.daytime_tel.select();
		return false;
	}

	else if (!MoreInfo.address.value)
	{
		alert("Please enter your Street Address.");
		MoreInfo.address.focus();
		MoreInfo.address.select();
		return false;
	}

	else if (!MoreInfo.city.value)
	{
		alert("Please enter your City.");
		MoreInfo.city.focus();
		MoreInfo.city.select();
		return false;
	}

	else if (!MoreInfo.zip.value)
	{
		alert("Please enter your Zip Code.");
		MoreInfo.zip.focus();
		MoreInfo.zip.select();
		return false;
	}

	return true;
}

function validEmail(email)
{
	var emailReg = /^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$/;
	var regex = new RegExp(emailReg);
	return regex.test(email.toLowerCase());
}

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}