/*PopUp Functions*/
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();
}

/*Ensures required form elements are filled out.*/
function contactForm($formObject)
{
	var $required = new Array('FirstName','LastName','Email','Phone','Input');
	for ($loop = 0; $loop < $required.length; $loop++) {
		if ($formObject.eval($required[$loop]).value == '') {
			alert('At least one of the form fields has not been filled out.\r\n Please fill in all fields and resubmit.');
			return false;
		}
	}
	document.forms.frmContact.Submit();
}

/*CU*@HOME 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;
	}
}

function emailLink($thisEmail)
	{
		sendEmail = confirm('This email does not use SSL technology and is not secure. \r\n\r\nPlease do not send private information like account numbers or social security numbers. If you have account-specific questions, please call the credit union.\r\n\r\nDo you still want to send the email? Click "OK" for yes, "Cancel" for no.');
		if (sendEmail) {
			document.location='mailto:'+$thisEmail;
		}
		else {
			return false;
		}
	}

/*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 credit union." onclick="emailLink(\''+$allTogetherNow+'\');return false;">'+$allTogetherNow+'</a>';
return $result;
}

/*Makes sure the content height is at least the height of the navigation.*/
function screenHeight(nav, content)
{
	if (document.getElementById) {
		var sideHeight = document.getElementById(nav).offsetHeight;
		var conHeight = document.getElementById(content).offsetHeight
		if (sideHeight > conHeight) {
			document.getElementById(content).style.height=sideHeight+'px';
		}
	}
}