// JavaScript Document
var timerVar;
var subTimerVar;

function hideall()
  {
  MM_showHideLayers('autoDrop','','hide', 'loanDrop','','hide', 'checkDrop','','hide', 'accountDrop','','hide', 'businessDrop','','hide', 'miscDrop','','hide');
  
}

function waitasec()
  {
  timerVar = setTimeout('hideall()', 1000);
}

function autoHover() {
clearTimeout(timerVar);
MM_showHideLayers('autoDrop','','show','loanDrop','','hide','checkDrop','','hide','accountDrop','','hide','businessDrop','','hide','miscDrop','','hide');
}

function loanHover() {
clearTimeout(timerVar);
MM_showHideLayers('autoDrop','','hide','loanDrop','','show','checkDrop','','hide','accountDrop','','hide','businessDrop','','hide','miscDrop','','hide');
}

function checkHover() {
clearTimeout(timerVar);
MM_showHideLayers('autoDrop','','hide','loanDrop','','hide','checkDrop','','show','accountDrop','','hide','businessDrop','','hide','miscDrop','','hide');
}

function accountHover() {
clearTimeout(timerVar);
MM_showHideLayers('autoDrop','','hide','loanDrop','','hide','checkDrop','','hide','accountDrop','','show','businessDrop','','hide','miscDrop','','hide');
}

function businessHover() {
clearTimeout(timerVar);
MM_showHideLayers('autoDrop','','hide','loanDrop','','hide','checkDrop','','hide','accountDrop','','hide','businessDrop','','show','miscDrop','','hide');

}

function miscHover() {
clearTimeout(timerVar);
MM_showHideLayers('autoDrop','','hide','loanDrop','','hide','checkDrop','','hide','accountDrop','','hide','businessDrop','','hide','miscDrop','','show');
}

function restoreHome() {
MM_showHideLayers('autoDrop','','hide','loanDrop','','hide','checkDrop','','hide','accountDrop','','hide','businessDrop','','hide','miscDrop','','hide');
waitasec();
}
// time and date for the clock
var newDate = '';
var timeNow = '';
var dateString = '';
var timeString = '';

var weekDays = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
// var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
var months = new Array('Jan','Feb','Mar','Apr.','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
var suffix = new Array('st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st');
var hourmap = new Array(12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11);
var meridian = new Array('am','am','am','am','am','am','am','am','am','am','am','am','pm','pm','pm','pm','pm','pm','pm','pm','pm','pm','pm','pm');
var minutes = '00';

function setTimeEnd()
  {
  timeNow = new Date();
  whichhour = timeNow.getHours();
  if (timeNow.getMinutes() < 10) {
	minutes = '0' + timeNow.getMinutes();
}
  else {
  	minutes = timeNow.getMinutes();
}
  timeString = hourmap[whichhour] + ':' + minutes + ' ' + meridian[whichhour];
  document.getElementById('timeAndDate').innerHTML = dateString + '<br>' + timeString;
}
function loopyTime()
  {
  newDate = new Date();
  timeNow = newDate;
  whichday = newDate.getDay();
  whichmonth = newDate.getMonth();
  whichhour = timeNow.getHours();
  if (timeNow.getMinutes() < 10) {
	minutes = '0' + timeNow.getMinutes();
}
  else {
  	minutes = timeNow.getMinutes();
}
  dateString = weekDays[whichday] + '<br>' + months[whichmonth] +  ' ' + newDate.getDate() + ', ' + newDate.getFullYear();
  timeString = hourmap[whichhour] + ':' + minutes + ' ' + meridian[whichhour];
  document.getElementById('timeAndDate').innerHTML = dateString + '<br>' + timeString;
  setInterval('setTimeEnd()',6000);
}
// functions and variables to show the disclaimer layer
var balloon;
var x;
var y;
var showing;
var xoff;
var yoff;
var showdelay;
var hidedelay;
var m;
var balloonTimer;
function initBalloon(layerString)
  {
  x = 0;
  y = 0;
 showing = false;
  xoff = -50;
  yoff = -130;
  nsYoff = 15;
  showdelay = 20;
  hidedelay = 250;
  balloon = new xLayerFromObj(layerString);
  balloon.hide();
}
function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
  

function showballoon(obj)
{
clearTimeout(balloonTimer);
showing = true;
myX = findPosX(obj) + xoff;
myY = findPosY(obj) + yoff;
balloon.moveTo(myX,myY);
balloon.show();
}

function hideballoon()
{
showing = false;
balloonTimer = setTimeout( "balloon.hide()", hidedelay);
}

var warningString = "You agree that we have no obligation, liability or responsibility to respond, act upon, or follow any instruction to us that is received electronically, by email or otherwise, unless we are able to authenticate the communication to our satisfaction. You further agree that the Credit Union has no obligation or liability for acting upon such instruction that it in good faith believes to be authentic. Click OK to agree and continue or click Cancel.";
function quizShow() {
return confirm(warningString);
}
function showOnlyTwoDivs(containerDiv, divNameOne, divIdOne, divNameTwo, divIdTwo) {
	var aDivs = document.getElementById(containerDiv).getElementsByTagName("DIV");
	// var alertString = "";
	reOne = new RegExp('^' + divNameOne + '_' + divIdOne); 
	reTwo = new RegExp('^' + divNameTwo + '_' + divIdTwo); 
	for (i = 0; i < aDivs.length; i++) {
	    if (aDivs.item(i).id.match(reOne)) {
			// alertString += '' + aDivs.item(i).id + '\n';
			P7_MultiClass2(aDivs.item(i).id,'showItem');
}
	    else if (aDivs.item(i).id.match(reTwo)) {
			// alertString += '' + aDivs.item(i).id + '\n';
			P7_MultiClass2(aDivs.item(i).id,'showItem');
}
		else {
			P7_MultiClass2(aDivs.item(i).id,'hideItem');
}
		}
	// alert(alertString);
}

function MFNWin() {
MM_openBrWindow('http://www.fibrecu.com/popups/MFNPrompt.php?extPage=' + escape('http://members.cunamutual.com/Home/mfn.asp?SITE=14605268') + '','extPrompt','width=400,height=170');
}
function MFNRetCalcWin() {
MM_openBrWindow('http://www.fibrecu.com/popups/MFNPrompt.php?extPage=' + escape('http://members.cunamutual.com/Calcs/calc.asp?nav_dest=calc:Retire&SITE=14605268') + '','extPrompt','width=400,height=170');
}
function MFNRepWin() {
MM_openBrWindow('http://www.fibrecu.com/popups/MFNPrompt.php?extPage=' + escape('http://members.cunamutual.com/representatives/rep.asp?SITE=14605268') + '','extPrompt','width=400,height=170');
}

