startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;

// Login function
function doLoginRefresh()
{
	if (document.Remote.AccessID.value != "")
		{
		setTimeout('document.Remote.reset()', 20000);
		document.Remote.AccessID.value=document.Remote.AccessID.value;
		return true;
		}
	else
		{
		alert("\n Please Enter a valid Access ID.  Thank you!\n\n\t"); 
		return false;
		}	
}

//Blater your leaving FSBCT.com

function bye() {
alert('You are now leaving the Farmington Bank site.  Farmington\n Bank endorses but makes no warranty as to the accuracy\n of the information contained within the site you are about to\n enter, and assumes no liability for damages related to their use.');
}

//Don't send personal info in e-mails.

function email() {
alert('Farmington Bank asks that you refrain from sending\n confidential information such as your Social Security number\n or Account number through email. If this information is needed,\n please provide it via telephone or in person.');
}

Shadowbox.init({
    skipSetup: true,
	modal:	true,
    players: ["html"]
});

function setCook() {
var cookie_date = new Date ( 2011, 12, 31 );
document.cookie = "fsbct_benhere=yes;expires=" + cookie_date.toGMTString();
window.location = "http://www.farmingtonbankct.com/index.htm";

}

function reder() {
	window.location = "http://www.farmingtonbankct.com/index.htm";
	}

function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results )
    return ( unescape ( results[2] ) );
  else
    return null;
}

var cokfb_results = get_cookie ( "fsbct_benhere" );
var domain = window.location.hostname
if (domain == 'farmingtonbankct.com' || domain =='www.farmingtonbankct.com' ) {
	
} else {
	
	if (cokfb_results == "yes") {
	window.location = "http://www.farmingtonbankct.com/index.htm";
	//alert('whats up dog');
	
	} else {
	window.onload = function(){
    Shadowbox.open({
        content:    '<div id="openbox">Welcome to Farmington Bank, formerly called Farmington Savings Bank.  You\'ve come to the right place. Please take a moment to save our new website address in your Favorite links.<br /><br /><center><input type="submit" name="button" id="button" value="Remind me later" onClick="window.parent.Shadowbox.close();reder();" />&nbsp;&nbsp;&nbsp;<input type="submit" name="button2" id="button2" value="Don\'t show this message again" onClick="window.parent.Shadowbox.close();setCook();" /></center></div>',
        player:     "html",
        title:      "Welcome to Farmington Bank",
		
        height:     130,
        width:      600
    });
	};
}};

