$(function(){
	//fix for IE6 security warning when doing a site search on a secure page
	temp=navigator.appVersion.split('MSIE');
	ieVer=parseInt(temp[1]);
	var isIE6=(ieVer == 6)?1:0;
	if(isIE6) {
		ie6Loc = $('.searchForm').attr('action');
		ie6Loc = ie6Loc.replace( /https/, 'http' );
		$('.searchForm').attr('action', ie6Loc);
	}

	//fix for IE6 security warning when doing an atm search on a secure page
	if ($('#seekatm').length) {
		temp=navigator.appVersion.split('MSIE');
		ieVer=parseInt(temp[1]);
		var isIE6=(ieVer == 6)?1:0;
		if(isIE6) {
			ie6Loc = $('#seekatm').attr('action');
			ie6Loc = ie6Loc.replace( /https/, 'http' );
			$('#seekatm').attr('action', ie6Loc);
		}
	}
});

// for Cool Menus
if(window.event + "" == "undefined") event = null;
function showMenu(){return false};
function mout(){return false};
function dummyObject() {this.mout=mout};
oM = new dummyObject();

//window.onerror = function(){ return true; }

function target_blank(url){
    tmp = window.open(removeAmpersand(url));
    tmp = null;
}

function makeNavImage(name,width,height){
this.name_on="nav-" + name +"-on.gif";
this.name_off="nav-" + name +"-off.gif";
this.width=width;
this.height=height;
this.newimage_on = new Image(width,height);
this.newimage_on.src = dir + '/images/' + this.name_on;
this.newimage_off = new Image(width,height);
this.newimage_off.src = dir + '/images/' + this.name_off;
}

function img_act(imgName){
document[imgName].src =  navitems[imgName].newimage_on.src;
}

function img_inact(imgName){
window.status = "";
document[imgName].src =  navitems[imgName].newimage_off.src;
}

document.write('<img src="'+dir+'/images/wcscreenrez.gif?width='+screen.width+'&height='+screen.height+'" width="1" height="1">'); 

function wcInternalPopup(url, height, width){
    var wide=width;
    var tall=height;
    var halfwide = (wide/2);
    var halftall = (tall/2);
    var pWidth = ( ((parseInt(screen.width) / 2)) - halfwide);
    var pHeight = (((parseInt(screen.height) / 2)) - halftall);
    var features = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+wide+',height='+tall+',top='+pHeight+',left='+pWidth;
    window.open(url,'internalpopup',features);
} 

function wcPopup(url, height, width, disclaimer){
    var wide=width;
    var tall=height;
    var halfwide = (wide/2);
    var halftall = (tall/2);
    var pWidth = ( ((parseInt(screen.width) / 2)) - halfwide);
    var pHeight = (((parseInt(screen.height) / 2)) - halftall);
    var features = 'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width='+wide+',height='+tall+',top='+pHeight+',left='+pWidth;
    window.open(url,'externalpopup',features);
}

function open_apps(nameofapp)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 350)
var pHeight = (((parseInt(screen.height) / 2)) - 300)
aWindow = window.open('https://www.usfed.org/Forms/OnlineForm.cgi?form=' + nameofapp,'application',"toolbar=0,location=0,directories=0,status=0,menubar=0,width=700,height=600,top=" + pHeight + ",left=" + pWidth + ",scrollbars=1,resizable=1,status=1");
}

function openPDF(page){
	bWindow = window.open('/home/fiFiles/static/documents/'+page);
	bWindow = null;
}

function openDisc(page)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 300)
var pHeight = (((parseInt(screen.height) / 2)) - 400)
bWindow = window.open(page,'discwin',"scrollbars=1,toolbar=0,location=0,directories=0,status=0,menubar=0,width=600,height=600,top=" + pHeight + ",left=" + pWidth);
	bWindow = null;
}

function showText(theDiv) {
        divObj = document.getElementById(theDiv);
             if (divObj.style.display == 'block') {
                     divObj.style.display = 'none;'
             } else {
                     divObj.style.display = 'block';
             }

}


function getSelect(page)
{
if(page!="") openPDF(page);
}
/************************************************************************************************************
* This function is used in the onclick of the a tag to display the external site warning. 
* @param msg - Integer specifying the which message to display.
* @param lk - The a link object
* Usage: <a href="http://wwww.mysite.com" onclick="return displayThirdPartyAlert(1,this);">My Site</a>
**************************************************************************************************************/
function displayThirdPartyAlert(msg,lk){
	var description = lk.innerHTML;
	if(description.indexOf('alt="') != -1){
		var x = description.indexOf('alt="')+5;
		var temp = description.substring(x);
		description = temp.substring(0,temp.indexOf("\""));
	}
	showWarning(lk.href, description, lk.target, msg)
	return false;
}

/************************************************************************************************************
* This function is used in the href of the a tag to display the external site warning. 
* @param lk - The url of the site to be opened
* @param desc - The description of the site to be opened, i.e. the name of the site.
* @param target - Allows for the window to opened in a new window
* @param msg - Integer specifying the which message to display.
* Usage: <a href="javascript:('http://wwww.mysite.com');">My Site</a>
**************************************************************************************************************/

function showWarning(lk, desc, target, msg){
	desc = (desc) ? desc : "Third Party Site";
	target = (target) ? target : "_blank";
	msg = (msg) ? msg : 0;
	
	var bankName = "Argonne Credit Union";
	
	var messages = new Array(6);

	messages[0] = '<h1>Third Party Site Disclaimer</h1><br />By accessing the <strong>' + desc + '</strong> you will be leaving Argonne Credit Union\'s (ACU) website and entering <strong>' + lk + '</strong> a website hosted by our third party affiliate.  We provide you access to affiliate products and services through our web site for your convenience.  Please be advised that upon leaving our site you may be subject to the privacy and security policies of the vendors site you are visiting.  We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than those of ACU. Please be aware that ACU does not control the content of linked sites.';
	messages[1] = '<h1>Third Party Site Disclaimer</h1><br />By accessing the <strong>' + desc + '</strong> you will be leaving Argonne Credit Union\'s (ACU) website and entering <strong>' + lk + '</strong> a website hosted by our third party affiliate.  We provide you access to affiliate products and services through our web site for your convenience.  Please be advised that upon leaving our site you may be subject to the privacy and security policies of the vendors site you are visiting.  We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than those of ACU. Please be aware that ACU does not control the content of linked sites.';
	messages[2] = '<h1>Third Party Site Disclaimer</h1><br />By accessing the <strong>' + desc + '</strong> you will be leaving Argonne Credit Union\'s (ACU) website and entering <strong>' + lk + '</strong> a website hosted by our third party affiliate.  We provide you access to affiliate products and services through our web site for your convenience.  Please be advised that upon leaving our site you may be subject to the privacy and security policies of the vendors site you are visiting.  We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than those of ACU. Please be aware that ACU does not control the content of linked sites.';
	messages[3] = '<h1>Third Party Site Disclaimer</h1><br />By accessing the <strong>' + desc + '</strong> you will be leaving Argonne Credit Union\'s (ACU) website and entering <strong>' + lk + '</strong> a website hosted by our third party affiliate.  We provide you access to affiliate products and services through our web site for your convenience.  Please be advised that upon leaving our site you may be subject to the privacy and security policies of the vendors site you are visiting.  We encourage you to read and evaluate the privacy and security policies of the site you are entering, which may be different than those of ACU. Please be aware that ACU does not control the content of linked sites.';
	messages[4] = '<h1>E-mail Disclaimer</h1><br />WARNING: E-mail is an unsecure method of communication. Any information contained in your message could be viewed by a third party. Sensitive information such as your account, credit card, or social security numbers and passwords should be omitted from e-mail messages. ACU Home Banking users can send secure e-mail to ACU using the MailIT feature within Home Banking.';
	messages[5] = '<h1>E-mail Disclaimer</h1><br />WARNING: E-mail is an unsecure method of communication. Any information contained in your message could be viewed by a third party. Sensitive information such as your account, credit card, or social security numbers and passwords should be omitted from e-mail messages. ACU Home Banking users can send secure e-mail to ACU using the MailIT feature within Home Banking.';

	var content = new Array();
	var index = 0;
	content[index++] = messages[msg];
	content[index++] = '<br /><br /><br />';
	content[index++] = '<div align="center"><a href="'+lk+'" target="'+target+'" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'">Continue</a>&#160;&#160;<a href="javascript:void(\'0\');" onclick="document.getElementById(\'ex_dis\').style.display = \'none\'">Decline</a></div></div>';	
	document.getElementById("ex_dis").innerHTML = content.join("");
	document.getElementById("ex_dis").style.display = "block";
	scrollTo(0,0);
}



function checkSize()
{
    var myWidth = 800;
	if( typeof( window.innerWidth ) == 'number' )
	{
		//Non-IE
		myWidth = window.innerWidth;
	}
	else if( document.documentElement && ( document.documentElement.clientWidth ) )
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
	}
	else if( document.body && ( document.body.clientWidth ) )
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
	}
    return myWidth;
}

document.write('<div id="ex_dis" style="background-color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: normal; color: #000000; text-align: left; position:absolute; top:225px; left:' + (parseInt(checkSize()/2)-175) + 'px; border: thin solid #000000; padding: 15px; display: none; z-index: 100000; width:350px; overflow: hidden;"></div>');
// OTHER FUNCTIONS ABOVE

function stringReplacement(str)
{
	var result = str;
	
	if (result == '') result = '&#160;';
	
	if (result.indexOf('&#134;&#134;') > -1) result = result.replace(/\&\#134\;\&\#134\;/,"<sup class=\"superScript\">&#134;&#134;</sup>");
	else if (result.indexOf('&#134;') > -1) result = result.replace(/\&\#134\;/,"<sup class=\"superScript\">&#134;</sup>");
	

	return result;
}

function removeAmpersand(str)
{
	var result = str;
	
	if (result == '') result = '&#160;';

	while (result.indexOf('&#38;') > -1) result = result.replace(/\&\#38\;/,"&");
	while (result.indexOf('&amp;') > -1) result = result.replace(/\&amp\;/,"&");

	return result;
}

function goTo(url)
{
	document.location.href=url;
}
//end of file

function trySum()
{
	if (document.getElementById('FormsButton2') && document.forms['calc']) dosum(document.forms['calc']);
}
