/*
$Id: common.js 33213 2009-05-01 12:58:49Z jhulett $
son of suckerfish menu script from:
http://www.htmldog.com/articles/suckerfish/dropdowns/

/* add your functions to be called on page load here */
function pageInit() {
	addLinkDisclosure();
	startclock();
	nextImg();
}

/* These functions adds a disclosure to all off site links */
var links;
var 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.";

var emailDisclosure =	"This form is not a secure channel.  Calcite Credit Union cannot guarantee the security of internet " +
					"e-mail messages.  Please do not submit private information such as account numbers, social security " +
					"numbers or PINS through this form.  If you have questions involving personal information, it is best " +
					"if you visit the credit union in person or call 1-877-CALCITE and speak to a member service representative.";

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
	domain = domain.replace('www.', '');					// To make things consistant take out "www."
	var domainRegex = new RegExp(domain+"|mailto|cuanswers\.com|myccinfo\.com|itsme247\.com|javascript:", "i"); 	// Cuz vars in /regexes/ can be sticky
	var mailtoRegex = new RegExp("mailto\:");
	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)) {
			offSite.push(links[i].href);
			links[i].target = "_blank";
			links[i].onclick = function () {
				return window.confirm(linkDisclosure);
			}
		}
		if(links[i].href.match(mailtoRegex)) {
			links[i].onclick = function () {
				return window.confirm(emailDisclosure);
			}
		}
	}
}


/* CU*@Home Login Checks */
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;}
}