$(function(){

$('#top_mainmenu ul li').hoverIntent(function(){
$('#top_mainmenu ul li a').each(function(){$(this).removeClass('current');});
$('#top_submenu > div').each(function(){$(this).css('display','none');});
$(this).find('a').attr('class','current');
var currentMenu=$(this).find('a').attr('id');
currentMenu=currentMenu.replace('mi_','sm_');
$('#'+currentMenu).css('display','block');
},function(){});

$('#content_promo .content').cycle({
     fx: 'fade',
     speed: 1500,
     timeout: 7500,
     pause: 1,
     prev:    '#content_promo_prev',
     next:    '#content_promo_next'
});

$("a[href*='\?page=offsite\&url=']")
   .each(function()
   {
   		var tVar=this.href.split('&url=');
   		this.title = tVar[1];
   		//alert(tVar[1]);
   		this.href = "javascript: ";
   		this.target = "";
   		this.className='offsite_button';
   });

var pop = function(){
	$('#offsite_screen').css({	"display": "block", opacity: 0.8, "width":$(document).width(),"height":$(document).height()});
	$('#offsite_box').css({"display": "block"}).click(function(){$(this).css("display", "none");$('#offsite_screen').css("display", "none")});
	$('#offsite_continuebutton').attr("href",this.title);
	self.scrollTo(0,0);
}

$('.offsite_button').click(pop);

var rsInfo=new Array();
rsInfo['Savings']='?page=products_savings';
rsInfo['Loans']='?page=products_loans';
rsInfo['Credit Cards']='?page=products_visa';
rsInfo['Certificates']='?page=products_savings_certificates';
$('.single_ratesheet > h4 > span').each(function()
{
	var thisTitle=(this.innerHTML);
	this.innerHTML=('<a href="'+rsInfo[thisTitle]+'">'+thisTitle+'</a>');
});

// I Want To... Drop Down
$('#iwant').hoverIntent(function(){
$('#iwant').addClass('hover');
},function(){
$('#iwant').removeClass('hover');
});

});


//Increase Decrease Font Size
var zoomArray=new Array('small','medium','large');
var zoomValue=get_cookie('zoomValue');
if(zoomValue<0 || zoomValue>=zoomArray.length || zoomValue==null)
{
zoomValue=0;
}
function setZoom()
{
	document.body.className=zoomArray[zoomValue];
	set_cookie('zoomValue',zoomValue);
}
function zoomIn()
{
	if(zoomValue<zoomArray.length-1)
	{
		zoomValue++;
		setZoom();
	}
}
function zoomOut()
{
	if(zoomValue>0)
	{
		zoomValue--;
		setZoom();
	}
}

