function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function open_calculator(){
	alert("Warning!  You are about to leave the Directions Credit Union Web site.  Directions Credit Union is not responsible for the content or availability of the linked sites in all locations.");
	openBrWindow('http://www.mortgage-calculators.org/calculators/template3.php3?calc_type=26','calculator','status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=500,height=550')
}
function givealert(){
	alert("Warning!  You are about to leave the Directions Credit Union Web site.  Directions Credit Union is not responsible for the content or availability of the linked sites in all locations.");

}

// Suckerfish Dropdowns for IE
sfHover = function() {
	var sfEls = document.getElementById("mnav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);




/*
  * Summary:	ZEBRA STRIPES FOR TABLES. Inserts Css Class into every odd row in a TBODY TR.
  * Credits: http://www.thewatchmakerproject.com/journal/309/stripe-your-tables-the-oo-way
  */
var Event = {
	add: function(obj,type,fn) {
		if (obj.attachEvent) {
			obj['e'+type+fn] = fn;
			obj[type+fn] = function() { obj['e'+type+fn](window.event); }
			obj.attachEvent('on'+type,obj[type+fn]);
		} else
		obj.addEventListener(type,fn,false);
	},
	remove: function(obj,type,fn) {
		if (obj.detachEvent) {
			obj.detachEvent('on'+type,obj[type+fn]);
			obj[type+fn] = null;
		} else
		obj.removeEventListener(type,fn,false);
	}
}

function $() {
	var elements = new Array();
	for (var i=0;i<arguments.length;i++) {
		var element = arguments[i];
		if (typeof element == 'string') element = document.getElementById(element);
		if (arguments.length == 1) return element;
		elements.push(element);
	}
	return elements;
}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/,"");
}

function addClassName(el,className) {
	removeClassName(el,className);
	el.className = (el.className + " " + className).trim();
}

function removeClassName(el,className) {
	el.className = el.className.replace(className,"").trim();
}

var ZebraTable = {
	bgcolor: '',
	classname: '',
	stripe: function(el) {
		if (!$(el)) return;
		var rows = $(el).getElementsByTagName('tr');
		for (var i=1,len=rows.length;i<len;i++) {
			if (i % 2 == 0) rows[i].className = 'alt';
			Event.add(rows[i],'mouseover',function() { ZebraTable.mouseover(this); });
			Event.add(rows[i],'mouseout',function() { ZebraTable.mouseout(this); });
		}
	},
	mouseover: function(row) {
		this.bgcolor = row.style.backgroundColor;
		this.classname = row.className;
		addClassName(row,'over');
	},
	mouseout: function(row) {
		removeClassName(row,'over');
		addClassName(row,this.classname);
		row.style.backgroundColor = this.bgcolor;
	}
}





/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  *
  * Title : 		Preview Your Links with Unobtrusive JavaScript
  * Author : 		Chris Campbell
  * URL : 		http://particletree.com/features/preview-your-links
  *
  * Description :	Inspired by the TargetAlert Firefox extension that ìprovides visual cues for
  *			the destinations of hyperlinksî and Christian Heilmannís Image previews with 
  *			DOM JavaScript, we wrote a simple set of unobtrusive JavaScript functions to 
  *			find links on a page that go to amazon product pages, pdfs, word documents or
  *			whatever destination that might slow down the browsing process and adds an 
  *			icon next to them to let you know what you might expect to find behind a link.
  *
  * Created : 	7/24/2005
  * Modified : 	7/27/2005
  *
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/


//code enters here
addEvent(window, 'load', linkPreview);

/*
  * Summary:	Attaches an event to the object passed in
  *			Script written by Christian Heilmann at http://www.onlinetools.org/articles/unobtrusivejavascript/chapter4.html
  * Parameters: 	Object to attach event to | type of event to attach | function call
  * Return: 		Boolean indicating success or failure
  */
function addEvent(obj, evType, fn){ 
	if (obj.addEventListener){ 
		obj.addEventListener(evType, fn, false); 
		return true; 
	} 
	else if (obj.attachEvent){ 
		var r = obj.attachEvent("on"+evType, fn); 
		return r; 
	}
	else { 
		return false; 
	} 
}




/*
  * Summary:	Grabs all non-image links from the page and calls checkLinks() if amazon.com is not located in the link 
  */
function linkPreview(){
	var links = document.getElementsByTagName("a");

	for (i=0; i<links.length; i++){
		var currentLink = links[i];
		var	images = currentLink.getElementsByTagName("img");
		
	 	// Check if the link is an image. We don't want icons next to images.
		if (images.length == 0){
			var linkHref = currentLink.href;
			
			// Find all links directed to amazon.com 
			if (linkHref.match(/amazon.com/)){
				append(currentLink, "amazon");
			}
			else{
				checkLinks(linkHref, currentLink)
			}
		}
	}
}

/*
  * Summary:	Checks if the link goes to an external file (ie. .doc, .pdf) and calls append()
  * Parameters: 	The href of the link | the <a> object 
  */
function checkLinks(linkHref, currentLink){
	var linkHrefParts = linkHref.split(".");
	
	// extension is the last element in the LinkSplit array
	var extension = linkHrefParts[linkHrefParts.length - 1];
	
	// In some browsers there is a "/" placed after the link. removes the "/"
	extension = extension.replace("/","");
	
	if( extension in { doc:1, pdf:1, ppt:1, txt:1, xls:1, zip:1 } ){
		append(currentLink, extension );
	}
}

/*
  * Summary:	Creates a span after the object passed in and sets the class to the link type
  * Parameters: 	<a> object | external link type
  */
function append(currentLink, extension){
	var span = document.createElement('span');
	span.innerHTML = "&nbsp;";
	currentLink.parentNode.insertBefore(span,currentLink.nextSibling);
	span.className = extension;
}

/*
  * Summary:	ACCESSIBLE EXTERNAL LINKS THAT POP UP NEW WINDOWS
  * Credits: http://www.sitepoint.com/article/standards-compliant-world/3
  */
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}

/*
  * Function loads multiple onload events on page load.
  */
window.onload = function() {
	ZebraTable.stripe('data');
	ZebraTable.stripe('data1');
	ZebraTable.stripe('data2');
	ZebraTable.stripe('data3');
	ZebraTable.stripe('data4');
	ZebraTable.stripe('data5');
	externalLinks;

}