jQuery(document).ready(function($){	
						   
	function getLink(el){
		var theLink = $('a', el).attr('href');
		return theLink;
	};
						   
	//make the captions slide up on hover
	$('.subnavMask.caption').hover(function(){
		$(".captionText", this).stop().animate({top:'57px'},{queue:false,duration:180});
	}, function() {
		$(".captionText", this).stop().animate({top:'84px'},{queue:false,duration:360});
	});
	
	
	// make the blueplate specials image change to animate gif on hover
	$('#subnavWrap2').hover(	
		function(){
			$('#blueplateImg').attr("src","images/subnav_blueplate_ani.gif");
		},
		function() {
			$('#blueplateImg').attr("src","images/subnav_blueplate.gif");
		}
	);
	
	// make the whole containing box use the 'pointer' cursor on mouseover.
	$('.subnavWrappers').hover(function(){
		$(this).css('cursor', 'pointer');
		var newLoc = getLink(this);
		window.status = newLoc;
		return true;		
	}, function(){
		$(this).css('cursor', 'default');
		window.status = "";		
	});
	
	//get the href from the background image and assign it to the whole darn thing
	$('.subnavWrappers').click(function(event){
		// stop the existing link from working, so you don't get the link twice.
		event.preventDefault();
		
		// extract the link info
		var newLoc = getLink(this);
		var targ = $('a', this).attr('target');
		
		// if the target isn't listed, make it '_self'
		if (targ == '') {
			targ = '_self'
		};
		// follow the link
		window.open(newLoc,targ);
		
	});
	
	$('#recallAlert').click(function(event){
		// stop the existing link from working, so you don't get the link twice.
		event.preventDefault();
		
		// extract the link info
		var newLoc = getLink(this);
		
		// popup the link
		popUp(newLoc, "800", "760");
		
	});
	
	
	
	// Live Help
	$('#liveHelpLink a').click(function(e){
		e.preventDefault();
		var URL = $(this).attr('href');
		var w = 585;
		var h = 390;
		popChat(URL, w, h);
	});
	
});



/* for the new chat button */
function popChat(URL,w,h) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+w+",height="+h+"');");
}
