/*PopUp Functions*/

/* These functions adds a disclosure to all off site links */
var links;
linkDisclosure = "You are now leaving the credit union's Web site. " +
		"The Web site you have selected is an external one located on another server." +
		"The credit union 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. Thank you for visiting our website.";
mailToDislcosure = "Please be aware that e-mail is not a secure channel. "+
		"Please do not send any sensitive information such as account numbers, "+
		"Social Security Numbers, and passwords via e-mail.";

function addLinkDisclosure () {
	if(!document.getElementsByTagName || !document.domain) return false; // exit if we can't do it
	
	var offSite = new Array; // For our link that lead off site
	var domain = document.domain; // The domain of the current document
	var mailTos = new Array;
	domain = domain.replace('www.', ''); // To make things consistant take out "www."
	var domainRegex = new RegExp(domain+"|mailto"+
		"|cuanswers\.com"+
		"|cuathome\.org"+
		"|itsme247\.com", "i"); // Cuz vars in /regexes/ can be sticky
	links = document.getElementsByTagName('A'); // An array of all our page link objects
	for(var i=0; i<links.length; i++) {
		if(!links[i].href.match(domainRegex)) {
			links[i].target = "_blank";
			offSite.push(links[i].href);
			links[i].onclick = function () {
				//popUpLink(400, 400)
				return window.confirm(linkDisclosure);
			}
		} else if (links[i].href.indexOf("mailto") != -1) {
			mailTos.push(links[i].href);
			links[i].onclick = function () {
				//popUpLink(400, 400)
				return window.confirm(mailToDislcosure);
			}
		}
	}
}

function popUp(windowLocate, winWidth, winHeight, winOptions)
{
var poppedWin=window.open(windowLocate, "popUpWin", "scrollbars, resizable, width="+winWidth+", height="+winHeight);
poppedWin.moveTo(((screen.width/2)-(winWidth/2)),((screen.height/2)-(winHeight/2)));
poppedWin.focus();
}

/*<strong>It&#39;s Me 247</strong> Functions*/
function loginCheck()
{
document.login.target='_top';
if (document.login['LoginName'].value=='' || document.login['LoginPin'].value=='')
	{
	alert("You need to add your username and password to log in.");
	return false;
	}
else
	{
	return true;
	}
}

/*No unwanted email for this little website*/
function contact($name, $domain)
{
$atmark='&#64;';
$allTogetherNow=$name+$atmark+$domain;
$result='<a href="mailto:'+$allTogetherNow+'" title="Click to send an email to the webmaster.">'+$allTogetherNow+'</a>';
return $result;
}

/*Navigation Functions*/
killMenu=0; /*Stupid old JavaScript can't nicely verify whether a variable is set or not.*/
var navArray=new Array('navNew', 'navHours','navSavings','navLoans','navServices','navClubs','navRates','navNews','navMember','navPrivate','navHome','navAlerts');

function menuOver(thisMenu)
{
if (document.getElementById)
	{
		for(i=0; i<navArray.length; i++)
			{
				document.getElementById(navArray[i]+'Parent').style.backgroundColor='transparent';
				document.getElementById(navArray[i]).style.display='none';
			}
		document.getElementById(thisMenu+'Parent').style.backgroundColor='#dee6f6'
		document.getElementById(thisMenu).style.display='block';
		clearTimeout(killMenu);
	}
}

function saveMenu(thisMenu)
{
if (document.getElementById)
	{
		clearTimeout(killMenu);
	}
}

function menuOut(thisMenu)
{
if (document.getElementById)
	{
		var doomedMenu=setTimeout('document.getElementById("'+thisMenu+'").style.display="none"; document.getElementById("'+thisMenu+'Parent'+'").style.backgroundColor="transparent";',750);
		return doomedMenu;
	}
}