var SectionToShowList = "";

var compare_current_state1 = "show";
var compare_current_state2 = "show";




function Expand_collapse_compare_section(displayBlock,index,accountname)
{
	var current_state = eval("compare_current_state"+index);
	if(current_state == "hide")
	{
		Expand_compare_section(displayBlock,index,accountname)
	}
	else
	{
		Collapse_compare_section(displayBlock,index,accountname)
	}
}
function Expand_compare_section(displayBlock,index,accountname)
{
	eval("compare_current_state"+index+"='show'");
	var show_details_id = "show_compare_details"+index;
	var ira_account_bar_id = "compare_account_bar"+index;
	var outer_table_id = "compare_outer_table"+index;
	var section_table_id = "compare_section_table"+index;
	document.getElementById(show_details_id).innerHTML = '<a class="noline-ira" href="javascript:Collapse_compare_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\');toggleSection();" title="Hide details about '+accountname+'" onclick="javascript:Collapse_compare_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\');toggleSection();">Hide details</a>';
	compare_down_image_arrow(index);
	document.getElementById(ira_account_bar_id).className = "overview-layer-background-over";
	document.getElementById(outer_table_id).className = "overview_table_border_over";
	document.getElementById(section_table_id).className = "overview_table_border_over_section";
	show(displayBlock);
}
function Collapse_compare_section(displayBlock,index,accountname)
{
	eval("compare_current_state"+index+"='hide'");
	var show_details_id = "show_compare_details"+index;
	var ira_account_bar_id = "compare_account_bar"+index;
	var outer_table_id = "compare_outer_table"+index;
	var section_table_id = "compare_section_table"+index;
	document.getElementById(show_details_id).innerHTML = '<a class="noline-ira" href="javascript:Expand_compare_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\');toggleSection();" title="Show details about '+accountname+'" onclick="javascript:Expand_compare_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\');toggleSection();">Show details</a>';

	compare_out_image_arrow(index);
	document.getElementById(ira_account_bar_id).className = "overview-layer-background";
	document.getElementById(outer_table_id).className = "overview_table_border";
	document.getElementById(section_table_id).className = "overview_table_border_section";
	hide(displayBlock);
}
function compare_over_image_arrow(index)
{
	var image_id = "compare_image_arrow"+index;
	var ira_account_bar_id = "compare_account_bar"+index;
	var current_state = eval("compare_current_state"+index);
	var outer_table_id = "compare_outer_table"+index;
	var section_table_id = "compare_section_table"+index;
	if(current_state == "hide")
	{
		document.getElementById(image_id).src = "images/arrow_rollover.gif";
		document.getElementById(ira_account_bar_id).className = "overview-layer-background-over";
		document.getElementById(outer_table_id).className = "overview_table_border_over";
		document.getElementById(section_table_id).className = "overview_table_border_over_section";
	}
}

function compare_out_image_arrow(index)
{
	var image_id = "compare_image_arrow"+index;
	var ira_account_bar_id = "compare_account_bar"+index;
	var current_state = eval("compare_current_state"+index);
	var outer_table_id = "compare_outer_table"+index;
	var section_table_id = "compare_section_table"+index;
	if(current_state == "hide")
	{
		document.getElementById(image_id).src = "images/arrow_default.gif";
		document.getElementById(ira_account_bar_id).className = "overview-layer-background";
		document.getElementById(outer_table_id).className = "overview_table_border";
		document.getElementById(section_table_id).className = "overview_table_border_section";
	}
}

function compare_down_image_arrow(index)
{
	var image_id = "compare_image_arrow"+index;
	document.getElementById(image_id).src = "images/arrow_selected.gif";
}

function launchWinNoBrowserControlsSizeable(url,windowHeight,windowWidth,scrollable,resizable)
{
	if (windowHeight == undefined) {
	  windowHeight = 400;
	}
	if (windowWidth == undefined) {
	  windowWidth = 530;
	}
	if (scrollable == undefined) {
	   scrollable ='yes';
	}
	if (resizable == undefined) {
	   resizable ='yes';
	}

	newwin = open(url, 'newwin', 'width='+windowWidth+',height='+windowHeight+',scrollbars='+scrollable+',resizable='+resizable+',left=35,top=161');
}

function showOverviewPage(pagenum)
{
	var objPage='null';
	hide("page1");
	hide("page2");
	show(pagenum);
	switch(pagenum) {
		case 'page1':
			//document.getElementById("list_bottom_center").innerHTML = '<span class="standard-font-bold-list">List Accounts<\/span>';
			//document.getElementById("compare_bottom_center").innerHTML = '<a class="standard-font-bold-list" id="compare_accounts" href="info/BusCompChart.pdf" onclick="javascript:showOverviewPage\(\'page2\'\);return false;" style="text-decoration: none" title="Change the display of these products to Comparison format">Compare Accounts<\/a>';
			//document.getElementById('left_off').src = "images/tab-left-on.gif";
			//document.getElementById('right_off').src = "images/tab-right-on.gif";
			//document.getElementById('list_view').className = "";
			//document.getElementById('left_on').src = "images/tab-left-off.gif";
			//document.getElementById('right_on').src = "images/tab-right-off.gif";
			//document.getElementById('compare_view').className = "tab-off";
			//document.getElementById('compare_accounts').style.cursor = "hand";
			//document.getElementById('printable_link').innerHTML = '<span class="standard-font"><a href="info/BusCompChart.pdf" target="_blank" rel="nofollow" title="Printable version. Link opens a new window." onclick="javascript:launchWinNoBrowserControlsSizeable\(\'info/BusCompChart.pdf\',400,650,\'yes\',\'yes\');return false;" class="noline-ira" style="font-size:10px;">Print Page<\/a><\/span>';
		  break;
		case 'page2':
			document.getElementById("compare_bottom_center").innerHTML = '<span class="standard-font-bold-list">Compare Accounts<\/span>';
			document.getElementById("list_bottom_center").innerHTML = '<a class="standard-font-bold-list" id="list_accounts" href="info/BusCompChart.pdf" onclick="javascript:showOverviewPage\(\'page1\'\);return false;" style="text-decoration: none" title="Products are currently displayed in List format">List Accounts<\/a>';
			document.getElementById('left_off').src = "images/tab-left-off.gif";
			document.getElementById('right_off').src = "images/tab-right-off.gif";
			document.getElementById('list_view').className = "tab-off";
			document.getElementById('left_on').src = "images/tab-left-on.gif";
			document.getElementById('right_on').src = "images/tab-right-on.gif";
			document.getElementById('compare_view').className = "";
			document.getElementById('list_accounts').style.cursor = "hand";
			document.getElementById('printable_link').innerHTML = '<span class="standard-font"><a href="info/BusCompChart.pdf" target="_blank" rel="nofollow" title="Printable version. Link opens a new window." onclick="javascript:launchWinNoBrowserControlsSizeable\(\'info/BusCompChart.pdf\',400,650,\'yes\',\'yes\');return false;" class="noline-ira" style="font-size:10px;">Print Page<\/a><\/span>';
		  break;
	}
}

function open_now_over_image_open(index)
{
	document.getElementById("open_now" + index).src = "images/opennow-on.gif";
}

function open_now_down_image_open(index)
{
	document.getElementById("open_now"+ index).src = "images/opennow-down.gif";
}
function open_now_off_image_open(index)
{
	document.getElementById("open_now"+ index).src = "images/opennow-off.gif";
}

function showSection(section,index) {
	hide("features"+index);
	hide("rates"+index);
	show(section);
	if (section == 'features'+index)
	{
		document.getElementById('features_bottom_center'+index).innerHTML = '<span class="standard-font-bold-list">Features<\/span>';
		document.getElementById('rates_bottom_center'+index).innerHTML = '<a class="standard-font-bold-list" id="rates_accounts'+index+'" href="index.cfm?template=check_overview&amp;show_page=list_rates" onclick="javascript:showSection(\'rates'+index+'\',\''+index+'\');return false;" style="text-decoration: none;cursor:none;" title="Display the rates and fees for this account">Rates &amp; Fees<\/a>';
		document.getElementById('subleft_off'+index).src = "images/subtab-left-on.gif";
		document.getElementById('subright_off'+index).src = "images/subtab-right-on.gif";
		document.getElementById('features_view'+index).className = "";
		document.getElementById('subleft_on'+index).src = "images/subtab-left-off.gif";
		document.getElementById('subright_on'+index).src = "images/subtab-right-off.gif";
		document.getElementById('rates_view'+index).className = "subtab-off";
		document.getElementById('features_bottom_left'+index).className = "detailbg";
		document.getElementById('features_bottom_center'+index).className = "detailbg";
		document.getElementById('features_bottom_right'+index).className = "detailbg";
		document.getElementById('rates_bottom_left'+index).className = "list-spacer";
		document.getElementById('rates_bottom_center'+index).className = "list-spacer";
		document.getElementById('rates_bottom_right'+index).className = "list-spacer";
		document.getElementById('rates_accounts'+index).style.cursor = "hand";
	}
	else if (section == 'rates'+index)
	{
		document.getElementById('features_bottom_center'+index).innerHTML = '<a class="standard-font-bold-list" id="features_accounts'+index+'" href="index.cfm?template=check_overview&show_page=list_features" onclick="javascript:showSection(\'features'+index+'\',\''+index+'\');return false;" style="text-decoration: none;cursor:none;" title="Display the features for this account">Features<\/a>';
		document.getElementById('rates_bottom_center'+index).innerHTML = '<span class="standard-font-bold-list">Rates &amp; Fees<\/span>';
		document.getElementById('subleft_off'+index).src = "images/subtab-left-off.gif";
		document.getElementById('subright_off'+index).src = "images/subtab-right-off.gif";
		document.getElementById('features_view'+index).className = "subtab-off";
		document.getElementById('subleft_on'+index).src = "images/subtab-left-on.gif";
		document.getElementById('subright_on'+index).src = "images/subtab-right-on.gif";
		document.getElementById('rates_view'+index).className = "";
		document.getElementById('features_bottom_left'+index).className = "list-spacer";
		document.getElementById('features_bottom_center'+index).className = "list-spacer";
		document.getElementById('features_bottom_right'+index).className = "list-spacer";
		document.getElementById('rates_bottom_left'+index).className = "detailbg";
		document.getElementById('rates_bottom_center'+index).className = "detailbg";
		document.getElementById('rates_bottom_right'+index).className = "detailbg";
		document.getElementById('features_accounts'+index).style.cursor = "hand";
	}
}

var bubble = "";
function closeDiv()
{
	if (bubble == "show")
	{
		hideListToolTip();
		hideCompareToolTip();
		bubble = "hide";
	}

}

var list_stuff = "hide";
var list_keep = "hide";
function showListToolTip(field, position, fieldContent, fieldHeader)
{
	document.getElementById("listToolTipText").innerHTML = fieldContent;
	document.getElementById("listToolTipHeader").innerHTML = fieldHeader;
	previousFocusItem = field;
	var el = document.getElementById("listToolTipBox");
	var obj = document.getElementById(field);
	var curleft = 0;
	var curtop = 0;
	if (obj.offsetParent)
	{
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent)
		{
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	if(position=="left")
	{
		curleft = curleft-120;
	}
	else
	{
		curleft = curleft+120;
	}
	curtop = curtop-80;
	el.style.left = curleft+'px';
	el.style.top = curtop+'px';
	el.style.display = "block";
	el.style.zindex = "2";
	el.style.visibility = "visible";
	if (field == "stuff_happens")
	{
		document.getElementById("list_stuff_line").className = "underline";
		list_stuff = "show";
	}
	else if (field != "stuff_happens")
	{
		document.getElementById("list_keep_line").className = "underline";
		list_keep = "show";
	}
	if (field == "stuff_happens") {
		document.getElementById("learn_more_keep_list").style.display="none";
		document.getElementById("learn_more_add_it_up").style.display="none";
	}
	else if (field == "add_it_up_list") {
		document.getElementById("learn_more_keep_list").style.display="none";
		document.getElementById("learn_more_add_it_up").style.display="block";
	}
	else if (field == "add_it_up_bubble") {
		document.getElementById("learn_more_keep_list").style.display="none";
		document.getElementById("learn_more_add_it_up").style.display="block";
	}
	else {
		document.getElementById("learn_more_keep_list").style.display="block";
		document.getElementById("learn_more_add_it_up").style.display="none";
	}
	bubble = "show";
}

function hideListToolTip()
{
	if (null != document.getElementById("listToolTipBox") ) {
	var el = document.getElementById("listToolTipBox");
	el.style.display = "none";
	el.style.visibility = "hidden";
	if(list_stuff == "show")
	{
		document.getElementById("list_stuff_line").className = "dotted-underline";
		list_stuff = "hide";
	}
	else if(list_keep == "show")
	{
		document.getElementById("list_keep_line").className = "dotted-underline";
		list_keep = "hide";
	}
	bubble = "hide";
	}
}

var compare_stuff = "hide";
var compare_keep = "hide";
var compare_over = "hide";
// WR 23561
var compare_checksafe = "hide";
function showCompareToolTip(field, position, fieldContent, fieldHeader)
{
	document.getElementById("compareToolTipText").innerHTML = fieldContent;
	document.getElementById("compareToolTipHeader").innerHTML = fieldHeader;
	previousFocusItem = field;
	var el = document.getElementById("compareToolTipBox");
	var obj = document.getElementById(field);
	if (field == "stuff_happens_compareview")
	{
		document.getElementById("compare_stuff_line").className = "underline";
		compare_stuff = "show";
	}
	//Start WR 23561
	else if (field == "check_safekeeping_compareview1")
	{
		document.getElementById("check_safekeeping_line1").className = "underline";
		compare_checksafe = "show";
	}
	else if (field == "check_safekeeping_compareview2")
	{
		document.getElementById("check_safekeeping_line2").className = "underline";
		compare_checksafe = "show";
	}
	else if (field == "check_safekeeping_compareview3")
	{
		document.getElementById("check_safekeeping_line3").className = "underline";
		compare_checksafe = "show";
	}
	else if (field == "check_safekeeping_compareview4")
	{
		document.getElementById("check_safekeeping_line4").className = "underline";
		compare_checksafe = "show";
	}
	//End WR 23561
	else if(field == "keep_the_change_compareview")
	{
		document.getElementById("keep_line").className = "underline";
		compare_keep = "show";
	}
	else if(field == "overdraft_protection")
	{
		document.getElementById("overdraft_line").className = "underline";
		compare_over = "show";
	}
	var curleft = 0;
	var curtop = 0;
	if (obj.offsetParent)
	{
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent)
		{
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	if(position=="left")
	{
		curleft = curleft-120;
	}
	else
	{
		curleft = curleft+120;
	}
	curtop = curtop-80;
	el.style.left = curleft+'px';
	el.style.top = curtop+'px';
	el.style.display = "block";
	el.style.zindex = "2";
	el.style.visibility = "visible";

	if (field == "keep_the_change_compareview") {
		document.getElementById("learn_more_keep").style.display = "block";
		document.getElementById("learn_more_over_draft").style.display="none";
	}
	else if (field == "overdraft_protection") {
		document.getElementById("learn_more_over_draft").style.display="block";
		document.getElementById("learn_more_keep").style.display="none";
	}
	else {
		document.getElementById("learn_more_over_draft").style.display="none";
		document.getElementById("learn_more_keep").style.display="none";
	}

	bubble = "show";

}

function hideCompareToolTip()
{
	if (null != document.getElementById("compareToolTipBox") ) {
	var el = document.getElementById("compareToolTipBox");
	el.style.display = "none";
	el.style.visibility = "hidden";
	if(compare_stuff == "show")
	{
		document.getElementById("compare_stuff_line").className = "dotted-underline";
		compare_stuff = "hide";
	}
	// Start WR 23561
	else if(compare_checksafe == "show")
	{
		document.getElementById("check_safekeeping_line1").className = "dotted-underline";
		document.getElementById("check_safekeeping_line2").className = "dotted-underline";
		document.getElementById("check_safekeeping_line3").className = "dotted-underline";
		document.getElementById("check_safekeeping_line4").className = "dotted-underline";
		compare_checksafe = "hide";
	}
	//End WR 23561
	else if(compare_keep == "show")
	{
		document.getElementById("keep_line").className = "dotted-underline";
		compare_keep = "hide";
	}
	else if(compare_over == "show")
	{
		document.getElementById("overdraft_line").className = "dotted-underline";
		compare_over = "hide";
	}
	bubble = "hide";
	}
}

function clickedOutsideElement(elemId, evt) {
var theElem = '';
if(window.event)
theElem = getEventTarget(window.event);
else theElem = getEventTarget(evt);

while(theElem != null) {
if(theElem.id == elemId)
return false;

theElem = theElem.offsetParent;
}

return true;
}

function getEventTarget(evt) {
var targ = (evt.target) ? evt.target : evt.srcElement;

if(targ != null) {
if(targ.nodeType == 3)
targ = targ.parentNode;
}

return targ;
}

document.onclick = function(evt) {
if(clickedOutsideElement('compareToolTipBox', evt))
closeDiv();
else
{
}
}

var current_state1 = "hide";
var current_state2 = "hide";
var current_state3 = "hide";
var current_state4 = "hide";
var current_state5 = "hide";

function overview_over_image_arrow(index)
{
	var image_id = "image_arrow"+index;
	var ira_account_bar_id = "ira_account_bar"+index;
	var current_state = eval("current_state"+index);
	var outer_table_id = "outer_table"+index;
	var section_table_id = "section_table"+index;
	if(current_state == "hide")
	{
		document.getElementById(image_id).src = "images/arrow_rollover.gif";
		document.getElementById(ira_account_bar_id).className = "overview-layer-background-over";
		document.getElementById(outer_table_id).className = "overview_table_border_over";
		document.getElementById(section_table_id).className = "overview_table_border_over_section";
	}
}

function overview_out_image_arrow(index)
{
	var image_id = "image_arrow"+index;
	var ira_account_bar_id = "ira_account_bar"+index;
	var current_state = eval("current_state"+index);
	var outer_table_id = "outer_table"+index;
	var section_table_id = "section_table"+index;
	if(current_state == "hide")
	{
		document.getElementById(image_id).src = "images/arrow_default.gif";
		document.getElementById(ira_account_bar_id).className = "overview-layer-background";
		document.getElementById(outer_table_id).className = "overview_table_border";
		document.getElementById(section_table_id).className = "overview_table_border_section";
	}
}

function overview_down_image_arrow(index)
{
	var image_id = "image_arrow"+index;
	document.getElementById(image_id).src = "images/arrow_selected.gif";
}


function show_hide_section(displayBlock,index,accountname)
{
	var current_state = eval("current_state"+index);
	if(current_state == "hide")
	{
		show_section(displayBlock,index,accountname)
	}
	else
	{
		hide_section(displayBlock,index,accountname)
	}
}

function show_section(displayBlock,index,accountname)
{
	eval("current_state"+index+"='show'");
	var show_details_id = "show_details"+index;
	var ira_account_bar_id = "ira_account_bar"+index;
	var outer_table_id = "outer_table"+index;
	var section_table_id = "section_table"+index;
	document.getElementById(show_details_id).innerHTML = '<a class="noline-ira" href="javascript:hide_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\');return false;" title="Hide details about '+accountname+'" onclick="javascript:hide_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\'); return false;">Hide details</a>';
	overview_down_image_arrow(index);
	document.getElementById(ira_account_bar_id).className = "overview-layer-background-over";
	document.getElementById(outer_table_id).className = "overview_table_border_over";
	document.getElementById(section_table_id).className = "overview_table_border_over_section";
	show(displayBlock);
}

function hide_section(displayBlock,index,accountname)
{
	eval("current_state"+index+"='hide'");
	var show_details_id = "show_details"+index;
	var ira_account_bar_id = "ira_account_bar"+index;
	var outer_table_id = "outer_table"+index;
	var section_table_id = "section_table"+index;
	document.getElementById(show_details_id).innerHTML = '<a class="noline-ira" href="javascript:show_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\');" title="Show details about '+accountname+'" onclick="javascript:show_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\');">Show details</a>';
	overview_out_image_arrow(index);
	document.getElementById(ira_account_bar_id).className = "overview-layer-background";
	document.getElementById(outer_table_id).className = "overview_table_border";
	document.getElementById(section_table_id).className = "overview_table_border_section";
	hide(displayBlock);
}

function toggleView(displayBlock,hideBlock,showIndex,hideIndex,showAccountname,hideAccountName)
{
	showOverviewPage('page2');
	Expand_compare_section(displayBlock,showIndex,showAccountname);
	Collapse_compare_section(hideBlock,hideIndex,hideAccountName);

}

function findPosX(obj)
{
var curleft = 0;
if(obj.offsetParent)
	while(1)
	{
	  curleft += obj.offsetLeft;
	  if(!obj.offsetParent)
		break;
	  obj = obj.offsetParent;
	}
else if(obj.x)
	curleft += obj.x;
return curleft;
}

function findPosY(obj)
{
var curtop = 0;
if(obj.offsetParent)
	while(1)
	{
	  curtop += obj.offsetTop;
	  if(!obj.offsetParent)
		break;
	  obj = obj.offsetParent;
	}
else if(obj.y)
	curtop += obj.y;
return curtop;
}



function addSection(){
	document.getElementById("add_remove_1").style.display = "block";
	document.getElementById("add_remove_2").style.display = "block";
	document.getElementById("add_remove_layer").className = "statelistbox1";


	var add_link = '<a href="##" id="add_link" title="Click here to Add or Remove Checking Accounts to compare on this page" onclick="javascript:hidePage\(\);deSelect\(\);hideLayer\(\'req\'\);return false;" class="noline-ira">Add\/Remove Accounts<\/a>';

	var add_image = '<a href="##" title="Click here to Add or Remove Checking Accounts to compare on this page" onclick="javascript:hidePage\(\);deSelect\(\);hideLayer\(\'req\'\);return false;" class="noline-ira"><img id="add_remove_icon"  height="11" width="11" border="0" alt="Add or Remove Accounts for comparison" src="images\/icon-addremove-off.gif"><\/a>';

	var e = document.getElementById("add_link");
	var el = document.getElementById("add_remove_accts");
	var curleft = findPosX(e);
	var curtop = findPosY(e);
	var browsername=navigator.appName;
	if (browsername=="Netscape")
	{
		curleft = curleft-164;
		curtop = curtop+16;
	}
	else if (browsername=="Microsoft Internet Explorer")
	{
		curleft = curleft-155;
		curtop = curtop+16;
	}
	else
	{
		curleft = curleft-165;
		curtop = curtop+16;
	}

	el.style.left = curleft+'px';
	el.style.top = curtop+'px';
	el.style.display = "block";
	el.style.zindex = "2";
	el.style.visibility = "visible";

	document.getElementById("add_remove_link").innerHTML = add_link;
	document.getElementById("add_remove_image").innerHTML = add_image;
	document.getElementById("add_remove_icon").src = "images/icon-addremove-on.gif";

}
function hidePage(){
	document.getElementById("add_remove_accts").style.display = "none";
	document.getElementById("add_remove_1").style.display = "none";
	document.getElementById("add_remove_2").style.display = "none";
	document.getElementById("add_remove_layer").className = "";


	var add_link = '<a href="##" id="add_link" title="Click here to Add or Remove Checking Accounts to compare on this page" onclick="javascript:addSection\(\);hideLayer\(\'req\'\);return false;" class="noline-ira">Add\/Remove Accounts<\/a>';

	var add_image = '<a href="##" title="Click here to Add or Remove Checking Accounts to compare on this page" onclick="javascript:addSection\(\);hideLayer\(\'req\'\);return false;" class="noline-ira"><img id="add_remove_icon"  height="11" width="11" border="0" alt="Add or Remove Accounts for comparison" src="images\/icon-addremove-on.gif"><\/a>';

	document.getElementById("add_remove_link").innerHTML = add_link;
	document.getElementById("add_remove_image").innerHTML = add_image;
	document.getElementById("add_remove_icon").src = "images/icon-addremove-off.gif";
}

function ok_over_image_open()
{
	document.getElementById("ok_image").src = "images/ok-over.gif";
}

function ok_down_image_open()
{
	document.getElementById("ok_image").src = "images/ok-down.gif";
}
function ok_image_open()
{
	document.getElementById("ok_image").src = "images/ok-off.gif";
}


var my_access = "show";
var campus_edge = "show";
var business_checking_advantage = "show";
var tiered_interest = "show";
var first_choice_gold = "show";
var business_checking_preferred = "show";
var sb_bundle = "show";

function deSelect() {

	var max = document.getElementsByName('add_accounts').length;
	for (var i = 0; i < max; i++)
	{
		if (document.add_acct.add_accounts[i].id == "add_my_access")
		{
			if (!document.add_acct.add_accounts[i].checked && my_access == "show") {
				document.add_acct.add_accounts[i].checked = true;
			}
			if (document.add_acct.add_accounts[i].checked && my_access == "hide") {
				document.add_acct.add_accounts[i].checked = false;
			}
		}
		else if (document.add_acct.add_accounts[i].id == "add_campus_edge")
		{
			if (!document.add_acct.add_accounts[i].checked && campus_edge == "show") {
				document.add_acct.add_accounts[i].checked = true;
			}
			if (document.add_acct.add_accounts[i].checked && campus_edge == "hide") {
				document.add_acct.add_accounts[i].checked = false;
			}
		}
		else if (document.add_acct.add_accounts[i].id == "add_advantage_checking")
		{
			if (!document.add_acct.add_accounts[i].checked && business_checking_advantage == "show") {
				document.add_acct.add_accounts[i].checked = true;
			}
			if (document.add_acct.add_accounts[i].checked && business_checking_advantage == "hide") {
				document.add_acct.add_accounts[i].checked = false;
			}
		}
		else if (document.add_acct.add_accounts[i].id == "add_tiered_interest")
		{
			if (!document.add_acct.add_accounts[i].checked && tiered_interest == "show") {
				document.add_acct.add_accounts[i].checked = true;
			}
			if (document.add_acct.add_accounts[i].checked && tiered_interest == "hide") {
				document.add_acct.add_accounts[i].checked = false;
			}
		}
		else if (document.add_acct.add_accounts[i].id == "add_first_choice_gold")
		{
			if (!document.add_acct.add_accounts[i].checked && first_choice_gold == "show") {
				document.add_acct.add_accounts[i].checked = true;
			}
			if (document.add_acct.add_accounts[i].checked && first_choice_gold == "hide") {
				document.add_acct.add_accounts[i].checked = false;
			}
		}
		else if (document.add_acct.add_accounts[i].id == "add_preferred_checking")
		{
			if (!document.add_acct.add_accounts[i].checked && business_checking_preferred == "show") {
				document.add_acct.add_accounts[i].checked = true;
			}
			if (document.add_acct.add_accounts[i].checked && business_checking_preferred == "hide") {
				document.add_acct.add_accounts[i].checked = false;
			}
		}
		else if (document.add_acct.add_accounts[i].id == "add_sb_bundle")
		{
			if (!document.add_acct.add_accounts[i].checked && sb_bundle == "show") {
				document.add_acct.add_accounts[i].checked = true;
			}
			if (document.add_acct.add_accounts[i].checked && sb_bundle == "hide") {
				document.add_acct.add_accounts[i].checked = false;
			}
		}
	}
}




function hidden() {
	document.getElementById("add_remove_accts").style.display="none";
	document.getElementById("add_remove_layer").classname="";
	var add_link = '<a href="##" id="add_link" title="Click here to Add or Remove Checking Accounts to compare on this page" onclick="javascript:addSection\(\);hideLayer\(\'req\'\);return false;" class="noline-ira">Add\/Remove Accounts<\/a>';

	var add_image = '<a href="##" title="Click here to Add or Remove Checking Accounts to compare on this page" onclick="javascript:addSection\(\);hideLayer\(\'req\'\);return false;" class="noline-ira"><img id="add_remove_icon"  height="11" width="11" border="0" alt="Add or Remove Accounts for comparison" src="icon-addremove-on.gif"><\/a>';

	document.getElementById("add_remove_link").innerHTML = add_link;
	document.getElementById("add_remove_image").innerHTML = add_image;
	document.getElementById("add_remove_icon").src = "images/icon-addremove-off.gif";
	document.getElementById("add_remove_icon").src = "images/icon-addremove-off.gif";
}

var timerID = 0;
function hideLayer(op) {
	if(op==null){
		clearTimeout(timerID);
		timerID = setTimeout("hidden()",4000);
	}else {
		if(document.getElementById("add_remove_accts").style.display=='none'){
			clearTimeout(timerID);
			timerID = 0;
		}else{
			timerID = setTimeout("hidden()",4000);
		}
	}
}

function compare_apply_now_over_image_open(index)
{
	document.getElementById("apply_now_id" + index).src = "images/opennow-on.gif";
}

function compare_apply_now_down_image_open(index)
{
	document.getElementById("apply_now_id"+ index).src = "images/opennow-down.gif";
}
function compare_apply_now_off_image_open(index)
{
	document.getElementById("apply_now_id"+ index).src = "images/opennow-off.gif";
}
// Start WR 24730
function hideProduct(section,index)
{
	switch(section)
	{
		case 'my_access_geared':
			for(chma_feat=1;chma_feat<=17;chma_feat++)
			{
				hide("my_access_features_"+chma_feat);
			}
			//Changes For WR26841
			for(chma_rates=1;chma_rates<=12;chma_rates++)
			{
				hide("my_access_rates_fees_"+chma_rates);
			}
			for(chma_geared=1;chma_geared<=3;chma_geared++)
			{
				hide("my_access_geared_"+chma_geared);
			}
			hide("my_access");
			document.getElementById("add_my_access").checked = false;
			my_access = "hide";
		break;
		case 'campus_edge_geared':
			for(chst_feat=1;chst_feat<=17;chst_feat++)
			{
				hide("campus_edge_features_"+chst_feat);
			}
			//Changes For WR26841
			for(chst_rates=1;chst_rates<=12;chst_rates++)
			{
				hide("campus_edge_rates_fees_"+chst_rates);
			}
			for(chst_geared=1;chst_geared<=3;chst_geared++)
			{
				hide("campus_edge_geared_"+chst_geared);
			}
			hide("campus_edge");
			document.getElementById("add_campus_edge").checked = false;
			campus_edge = "hide";
		break;
		case 'business_advantage_geared':
			for(chad_feat=1;chad_feat<=17;chad_feat++)
			{
				hide("business_advantage_features_"+chad_feat);
			}
			//Changes For WR26841
			for(chad_rates=1;chad_rates<=12;chad_rates++)
			{
				hide("business_advantage_rates_fees_"+chad_rates);
			}
			for(chad_geared=1;chad_geared<=3;chad_geared++)
			{
				hide("business_advantage_geared_"+chad_geared);
			}
			hide("business_checking_advantage");
			document.getElementById("add_advantage_checking").checked = false;
			business_checking_advantage = "hide";
		break;
		case 'tiered_interest_geared':
			for(chpr_feat=1;chpr_feat<=17;chpr_feat++)
			{
				hide("tiered_interest_features_"+chpr_feat);
			}
			//Changes For WR26841
			for(chpr_rates=1;chpr_rates<=12;chpr_rates++)
			{
				hide("tiered_interest_rates_fees_"+chpr_rates);
			}
			for(chpr_geared=1;chpr_geared<=3;chpr_geared++)
			{
				hide("tiered_interest_geared_"+chpr_geared);
			}
			hide("tiered_interest");
			document.getElementById("add_tiered_interest").checked = false;
			tiered_interest = "hide";
		break;
		case 'first_choice_gold_geared':
			for(chfg_feat=1;chfg_feat<=17;chfg_feat++)
			{
				show("first_choice_gold_features_"+chfg_feat);
			}
			//Changes For WR26841
			for(chfg_rates=1;chfg_rates<=12;chfg_rates++)
			{
				show("first_choice_gold_rates_fees_"+chfg_rates);
			}
			for(chfg_geared=1;chfg_geared<=3;chfg_geared++)
			{
				show("first_choice_gold_geared_"+chfg_geared);
			}
			hide("first_choice_gold");
			document.getElementById("add_first_choice_gold").checked = false;
			first_choice_gold = "hide";
		break;
		case 'business_preferred_geared':
			for(chpf_feat=1;chpf_feat<=17;chpf_feat++)
			{
				hide("business_preferred_features_"+chpf_feat);
			}
			//Changes For WR26841
			for(chpf_rates=1;chpf_rates<=12;chpf_rates++)
			{
				hide("business_preferred_rates_fees_"+chpf_rates);
			}
			for(chpf_geared=1;chpf_geared<=3;chpf_geared++)
			{
				hide("business_preferred_geared_"+chpf_geared);
			}
			hide("business_checking_preferred");
			document.getElementById("add_preferred_checking").checked = false;
			business_checking_preferred = "hide";
		break;
		case 'sb_bundle_geared':
			for(sb_feat=1;sb_feat<=17;sb_feat++)
			{
				hide("sb_bundle_features_"+sb_feat);
			}
			//Changes For WR26841
			for(sb_rates=1;sb_rates<=7;sb_rates++)
			{
				hide("sb_bundle_rates_fees_"+sb_rates);
			}
				hide("sb_bundle_rates_fees_11");
				hide("sb_bundle_rates_fees_12");
			for(sb_geared=1;sb_geared<=3;sb_geared++)
			{
				hide("sb_bundle_geared_"+sb_geared);
			}
			hide("sb_bundle");
			document.getElementById("add_sb_bundle").checked = false;
			sb_bundle = "hide";
		break;
	}
	change_width();
}

// WR 24730

var features_div='space1';
var rates_div='space2';
function toggleSection(){
	features_style=document.getElementById('tab_compare_info1').style.display;
	rates_style=document.getElementById('tab_compare_info2').style.display;
	if(features_style!='none'&& rates_style != 'none'){
			rates_content=document.getElementById(rates_div).innerHTML;
			features_content=document.getElementById(features_div).innerHTML;
			features_div='space1';
			rates_div='space2';
			document.getElementById(rates_div).innerHTML=rates_content;
			document.getElementById(features_div).innerHTML=features_content;
	}else if(rates_div=='space2'){
		if(features_style!='none'&& rates_style != 'block'){
			rates_content=document.getElementById(rates_div).innerHTML;
			features_content=document.getElementById(features_div).innerHTML;
			features_div='space2'
			rates_div='space1';
			document.getElementById(rates_div).innerHTML=rates_content;
			document.getElementById(features_div).innerHTML=features_content;
		}
	}else if(rates_div=='space1'){
		if(features_style!='block'&& rates_style != 'none'){
			rates_content=document.getElementById(rates_div).innerHTML;
			features_content=document.getElementById(features_div).innerHTML;
			features_div='space1'
			rates_div='space2';
			document.getElementById(rates_div).innerHTML=rates_content;
			document.getElementById(features_div).innerHTML=features_content;
		}

	}
}

// Start WR 24730

function showHideAccounts()
{
	var product_selected = 0;
	var max = document.getElementsByName('add_accounts').length;
	for (var i = 0; i < max; i++) {
		if (eval("document.add_acct.add_accounts[" + i + "].checked") == true) {
			product_selected += 1;
		}
	}
	if (product_selected >= 1)
	{
		for (var j = 0; j < max; j++)
		{
			if (document.add_acct.add_accounts[j].id == "add_my_access")
			{
				if (document.add_acct.add_accounts[j].checked) {
					for(chma_feat=1;chma_feat<=17;chma_feat++)
					{
						show("my_access_features_"+chma_feat);
					}
					//Changes For WR26841
					for(chma_rates=1;chma_rates<=12;chma_rates++)
					{
						show("my_access_rates_fees_"+chma_rates);
					}
					for(chma_geared=1;chma_geared<=3;chma_geared++)
					{
						show("my_access_geared_"+chma_geared);
					}
					show("my_access");
					my_access = "show";
				}
				else if (!document.add_acct.add_accounts[j].checked) {
					for(chma_feat=1;chma_feat<=17;chma_feat++)
					{
						hide("my_access_features_"+chma_feat);
					}
					//Changes For WR26841
					for(chma_rates=1;chma_rates<=12;chma_rates++)
					{
						hide("my_access_rates_fees_"+chma_rates);
					}
					for(chma_geared=1;chma_geared<=3;chma_geared++)
					{
						hide("my_access_geared_"+chma_geared);
					}
					hide("my_access");
					my_access = "hide";
				}
			}
			else if (document.add_acct.add_accounts[j].id == "add_campus_edge")
			{
				if (document.add_acct.add_accounts[j].checked) {
					for(chst_feat=1;chst_feat<=17;chst_feat++)
					{
						show("campus_edge_features_"+chst_feat);
					}
					//Changes For WR26841
					for(chst_rates=1;chst_rates<=12;chst_rates++)
					{
						show("campus_edge_rates_fees_"+chst_rates);
					}
					for(chst_geared=1;chst_geared<=3;chst_geared++)
					{
						show("campus_edge_geared_"+chst_geared);
					}
					show("campus_edge");
					campus_edge = "show";
				}
				else if (!document.add_acct.add_accounts[j].checked) {
					for(chst_feat=1;chst_feat<=17;chst_feat++)
					{
						hide("campus_edge_features_"+chst_feat);
					}
					//Changes For WR26841
					for(chst_rates=1;chst_rates<=12;chst_rates++)
					{
						hide("campus_edge_rates_fees_"+chst_rates);
					}
					for(chst_geared=1;chst_geared<=3;chst_geared++)
					{
						hide("campus_edge_geared_"+chst_geared);
					}
					hide("campus_edge");
					campus_edge = "hide";
				}
			}
			else if (document.add_acct.add_accounts[j].id == "add_advantage_checking")
			{
				if (document.add_acct.add_accounts[j].checked) {
					for(chad_feat=1;chad_feat<=17;chad_feat++)
					{
						show("business_advantage_features_"+chad_feat);
					}
					//Changes For WR26841
					for(chad_rates=1;chad_rates<=12;chad_rates++)
					{
						show("business_advantage_rates_fees_"+chad_rates);
					}
					for(chad_geared=1;chad_geared<=3;chad_geared++)
					{
						show("business_advantage_geared_"+chad_geared);
					}
					show("business_checking_advantage");
					business_checking_advantage = "show";
				}
				else if (!document.add_acct.add_accounts[j].checked) {
					for(chad_feat=1;chad_feat<=17;chad_feat++)
					{
						hide("business_advantage_features_"+chad_feat);
					}
					//Changes For WR26841
					for(chad_rates=1;chad_rates<=12;chad_rates++)
					{
						hide("business_advantage_rates_fees_"+chad_rates);
					}
					for(chad_geared=1;chad_geared<=3;chad_geared++)
					{
						hide("business_advantage_geared_"+chad_geared);
					}
					hide("business_checking_advantage");
					business_checking_advantage = "hide";
				}
			}
			else if (document.add_acct.add_accounts[j].id == "add_tiered_interest")
			{
				if (document.add_acct.add_accounts[j].checked) {
					for(chpr_feat=1;chpr_feat<=17;chpr_feat++)
					{
						show("tiered_interest_features_"+chpr_feat);
					}
					//Changes For WR26841
					for(chpr_rates=1;chpr_rates<=12;chpr_rates++)
					{
						show("tiered_interest_rates_fees_"+chpr_rates);
					}
					for(chpr_geared=1;chpr_geared<=3;chpr_geared++)
					{
						show("tiered_interest_geared_"+chpr_geared);
					}
					show("tiered_interest");
					tiered_interest = "show";
				}
				else if (!document.add_acct.add_accounts[j].checked) {
					for(chpr_feat=1;chpr_feat<=17;chpr_feat++)
					{
						hide("tiered_interest_features_"+chpr_feat);
					}
					//Changes For WR26841
					for(chpr_rates=1;chpr_rates<=12;chpr_rates++)
					{
						hide("tiered_interest_rates_fees_"+chpr_rates);
					}
					for(chpr_geared=1;chpr_geared<=3;chpr_geared++)
					{
						hide("tiered_interest_geared_"+chpr_geared);
					}
					hide("tiered_interest");
					tiered_interest = "hide";
				}
			}
			else if (document.add_acct.add_accounts[j].id == "add_first_choice_gold")
			{
				if (document.add_acct.add_accounts[j].checked) {
					for(chfg_feat=1;chfg_feat<=17;chfg_feat++)
					{
						show("first_choice_gold_features_"+chfg_feat);
					}
					//Changes For WR26841
					for(chfg_rates=1;chfg_rates<=12;chfg_rates++)
					{
						show("first_choice_gold_rates_fees_"+chfg_rates);
					}
					for(chfg_geared=1;chfg_geared<=3;chfg_geared++)
					{
						show("first_choice_gold_geared_"+chfg_geared);
					}
					show("first_choice_gold");
					first_choice_gold = "show";
				}
				else if (!document.add_acct.add_accounts[j].checked) {
					for(chfg_feat=1;chfg_feat<=17;chfg_feat++)
					{
						hide("first_choice_gold_features_"+chfg_feat);
					}
					//Changes For WR26841
					for(chfg_rates=1;chfg_rates<=12;chfg_rates++)
					{
						hide("first_choice_gold_rates_fees_"+chfg_rates);
					}
					for(chfg_geared=1;chfg_geared<=3;chfg_geared++)
					{
						hide("first_choice_gold_geared_"+chfg_geared);
					}
					hide("first_choice_gold");
					first_choice_gold = "hide";
				}
			}
			else if (document.add_acct.add_accounts[j].id == "add_preferred_checking")
			{

				if (document.add_acct.add_accounts[j].checked) {
					for(chpf_feat=1;chpf_feat<=17;chpf_feat++)
					{
						show("business_preferred_features_"+chpf_feat);
					}
					//Changes For WR26841
					for(chpf_rates=1;chpf_rates<=12;chpf_rates++)
					{
						show("business_preferred_rates_fees_"+chpf_rates);
					}
					for(chpf_geared=1;chpf_geared<=3;chpf_geared++)
					{
						show("business_preferred_geared_"+chpf_geared);
					}
					show("business_checking_preferred");
					business_checking_preferred = "show";
				}
				else if (!document.add_acct.add_accounts[j].checked) {
					for(chpf_feat=1;chpf_feat<=17;chpf_feat++)
					{
						hide("business_preferred_features_"+chpf_feat);
					}
					//Changes For WR26841
					for(chpf_rates=1;chpf_rates<=12;chpf_rates++)
					{
						hide("business_preferred_rates_fees_"+chpf_rates);
					}
					for(chpf_geared=1;chpf_geared<=3;chpf_geared++)
					{
						hide("business_preferred_geared_"+chpf_geared);
					}
					hide("business_checking_preferred");
					business_checking_preferred = "hide";
				}
			}
			else if (document.add_acct.add_accounts[j].id == "add_sb_bundle")
			{
				if (document.add_acct.add_accounts[j].checked) {
					for(sb_feat=1;sb_feat<=17;sb_feat++)
					{
						show("sb_bundle_features_"+sb_feat);
					}
					//Changes For WR26841
					for(sb_rates=1;sb_rates<=7;sb_rates++)
					{
						show("sb_bundle_rates_fees_"+sb_rates);
					}
						show("sb_bundle_rates_fees_11");
						show("sb_bundle_rates_fees_12");
					for(sb_geared=1;sb_geared<=3;sb_geared++)
					{
						show("sb_bundle_geared_"+sb_geared);
					}
					show("sb_bundle");
					sb_bundle = "show";
				}
				else if (!document.add_acct.add_accounts[j].checked) {
					for(sb_feat=1;sb_feat<=17;sb_feat++)
					{
						hide("sb_bundle_features_"+sb_feat);
					}
					//Changes For WR26841
					for(sb_rates=1;sb_rates<=7;sb_rates++)
					{
						hide("sb_bundle_rates_fees_"+sb_rates);
					}
						hide("sb_bundle_rates_fees_11");
						hide("sb_bundle_rates_fees_12");
					for(sb_geared=1;sb_geared<=3;sb_geared++)
					{
						hide("sb_bundle_geared_"+sb_geared);
					}
					hide("sb_bundle");
					sb_bundle = "hide";
				}
			}
		}
		change_width();
		hidePage();
	}
	else
	{
		productChecked();
		hidePage();
	}
}
// End WR 24730
