function tabAccounts(id,tab) {
	
	elements = new Array ("easy-access-group","bonds-group","notice-accounts-group");
	tabs = new Array ("snav1","snav2","snav3");

	for (i=0;i<3;i++)
	{	
		var e = elements[i];
		if(e!=id) {
		e=document.getElementById(e)
		e.style.display = 'none';
		} 
		var f = tabs[i];
		if(f!=tab) {
		f=document.getElementById(f)
		f.style.backgroundPosition = '0 0';
		} 
	}
	
	var div = document.getElementById(id);
	div.style.display = 'block';
	
	var tab = document.getElementById(tab);
	tab.style.backgroundPosition = '0 -21px';
	
	sIFR.replace(laisbold, {selector: '.account h2, #ea #hds h1,#ea #hds h2,#n90 #hds h1,#n90 #hds h2',
			   css: ['.sIFR-root  {color:#ffffff;}','em { font-size:35%;font-style:normal; }','a { color:#ffffff;text-decoration:none;}','a:hover { color:#ffffff;text-decoration:underline;}'],
			   wmode: ['transparent']
	});
}

////////////////////
//Email hider script

function email(name, domain, suffix, text)
{
   var address = name + "\u0040" + domain + "." + suffix;
   var url = "mailto:" + address;

   if( ! text )
   {
      text = address;
   }

   document.write("<a href=\"" + url + "\">" + text + "</a>");
}


/////////////////////////////
//HIDE and SHOW script (FAQs)
//get's a count of all elements in the relevant div
function elementCount(inElementId, findElementTag)
{
	var ele = document.getElementById(inElementId).getElementsByTagName(findElementTag);
	var numElements = ele.length;
	
	return numElements;
}

//close all the divs
function clearAll()
{
	var numAns = elementCount('faq','div');
	
	for (i=1;i<=numAns; i++)
	{
		//set the display and remove the class of the div element
		var elem = document.getElementById("A" + i);
		elem.style.display = "none";
		elem.removeAttribute('class');
		elem.removeAttribute('className');
		
		//need to clear class for selected li question element
		var qEle = document.getElementById('Q' + i);
		qEle.removeAttribute('class');
		qEle.removeAttribute('className');

	}
}

//open / close the required div
function toggle_visibility(id) {

	var e = document.getElementById('A' + id);
	if(e.style.display == 'block')
	{
		//close all elements
		clearAll();
	}
	else
	{
		//close all elements
		clearAll();
		
		//open the required one
		e.style.display = 'block';
		e.className = "selected"
		
		//need to add class for selected li question element
		var qEle = document.getElementById('Q' + id);
		qEle.className = "selected";
		
	}
}


///////////////////////
// Tell a friend SCRIPT

var subj="Heritable Savings"
var msg="Hi%0d%0dI saw these savings accounts from Heritable and thought you might be interested - "+window.location;

u = window.location;

function mailThisUrl() {
window.location = "mailto:?subject="+subj+"&body="+msg
}


///////////////////////////
// ACCESSIBLE POPUP WINDOWS
var _POPUP_FEATURES = 'location=0,statusbar=0,menubar=0,scrollbars=1,resizable=1,width=640,height=800';

var _POPUP_FEATURES_WITH_SIZE = 'location=0,statusbar=0,menubar=0,scrollbars=1,resizable=1';

function raw_popup(url, target, features) {
    var theWindow = window.open(url, target, features);
    theWindow.focus();
    return theWindow;
}
	
function link_popup(src, features) {
    return raw_popup(src, '_blank', features);
}

function link_popup_with_size(src, features, width, height){
	
	var features_with_size = features + ',width=' + width + ',height=' + height;

    return raw_popup(src, '_blank', features_with_size);
}
