var SectionToShowList = "";
function showPage(pagenum){
	var objPage='null';
	objPage = document.getElementById('page1');
	objPage.style.display = 'none';
	objPage = document.getElementById('page2');
	objPage.style.display = 'none';
	objPage = document.getElementById(pagenum);
	objPage.style.display = 'block';
	switch(pagenum) {
		case 'page1':
		  document.getElementById('image1').src = "images/tab_why_ON.jpg";
		  document.getElementById('image2').src = "images/tab_choosing_OFF.jpg";
		  break;
		case 'page2':
		  document.getElementById('image1').src = "images/tab_why_OFF.jpg";
		  document.getElementById('image2').src = "images/tab_choosing_ON.jpg";
		  break;
	}
}

function ira_Page()
{
	var str = "page1";
	showPage(str);
	if(SectionToHideList != "")
	{
		var SectionToHide = SectionToHideList.split(',');
		for(var i = 1; i < SectionToHide.length; i++) 
		{
			hide(SectionToHide[i]);
		}
	}
	if(SectionToShowList != "")
		{
			var SectionToShow = SectionToShowList.split(',');
			for(var i = 1; i < SectionToShow.length; i++) 
			{
				show(SectionToShow[i]);
			}
	}
}

var current_state1 = "hide";
var current_state2 = "hide";
var current_state3 = "hide";
var current_state4 = "hide";
var current_state5 = "hide";

function 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;
	if(current_state == "hide")
	{
		document.getElementById(image_id).src = "images/showhide_arrow_over.jpg";
		document.getElementById(ira_account_bar_id).className = "layer-background-over";
		document.getElementById(outer_table_id).className = "table_border_over";	
	}
}

function down_image_arrow(index)
{
	var image_id = "image_arrow"+index;
	document.getElementById(image_id).src = "images/showhide_arrow_down.jpg";
}

function 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;
	if(current_state == "hide")
	{
		document.getElementById(image_id).src = "images/showhide_arrow.jpg";
		document.getElementById(ira_account_bar_id).className = "layer-background";
		document.getElementById(outer_table_id).className = "table_border";	
	}
}

function Expand_collapse_section(displayBlock,index,accountname)
{
	var current_state = eval("current_state"+index);
	if(current_state == "hide")
	{
		Expand_section(displayBlock,index,accountname)
	}
	else
	{
		Collapse_section(displayBlock,index,accountname)
	}
}
function Expand_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;
	document.getElementById(show_details_id).innerHTML = '<a class="noline-ira" href="javascript:Collapse_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\');return false;" title="Hide details about '+accountname+'" onClick="javascript:Collapse_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\'); return false;">Hide details</a>';
	down_image_arrow(index);
	document.getElementById(ira_account_bar_id).className = "layer-background-over";
	document.getElementById(outer_table_id).className = "table_border_over";
	show(displayBlock);
}
function Collapse_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;
	document.getElementById(show_details_id).innerHTML = '<a class="noline-ira" href="javascript:Expand_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\');" title="Show details about '+accountname+'" onClick="javascript:Expand_section(\'' + displayBlock + '\',\''+index+'\',\''+accountname+'\');">Show details</a>';
	
	out_image_arrow(index);
	document.getElementById(ira_account_bar_id).className = "layer-background";
	document.getElementById(outer_table_id).className = "table_border";
	hide(displayBlock);
}
function launchWinNoBrowserControlsSizeable(url,windowHeight,windowWidth,scrollable,resizable)
{
	if (windowHeight == undefined) {
	  windowHeight = 400;
	}
	if (windowWidth == undefined) {
	  windowWidth = 600;
	}
	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 over_image_icon()
{
	document["img0"].src = "images/icon_magnify_over.jpg";
}
function out_image_icon()
{
	document["img0"].src = "images/icon_magnify.jpg";
}