// method for resizing the footer (if needed)
//
$(document).ready(
	function() {
		resizeFooter();
		resizeLoginBackground();
	});

function resizeFooter() {
	var page = $('#page-container');
	var w    = $(window);
	if (page.height() < w.height()) {
		$('#footer').css({height: (w.height() - page.height()) + 70});
	}
}

function menu(e) {
	// on mouseover of the anchor, display the menu. 
	//
	$(e).parent().find('.subnav').show();
	$(e).parent().addClass('active');
	
	// When the mouse hovers out of the subnav, move it back up
	//
	$(e).parent().hover(
		function() {}, 
		function(){
	 		$(e).parent().find(".subnav").hide(); 
			$(e).parent().removeClass('active');
		}
	);
	
}

/**
 * Method that brings up and populates the facebox with the label reg. 
 * There's probably a better way of doing this, but it's friday 
 * afternoon. 
 */
function showLabelRules() {
	var f = $('#rulesContent').html();
	$.facebox("<div id='label-rules'>" + f + "</div>");
}

/**
 * Method that resizes the tinted backgound of the header link.
 */
function resizeLoginBackground() {
	if ($('#cart-link').length > 0) {
		var hcb = $('#header-cart-box');
		var cl  = $('#cart-link');
		hcb.css({'width': cl.width() + 30 + 'px'});
	}
}
