var imagesToPreload = new Array ();

jQuery(window).bind('load', function() {
	
	jQuery(".rollover").each (
		function (idx) {
			var newSrc = jQuery(this).attr("src").replace(".gif","-active.gif#hover");
			imagesToPreload.push (newSrc);
		}
	);
	
	for(var i = 0; i<imagesToPreload.length; i++) {
		jQuery("<img>").attr("src", imagesToPreload[i]);
	}

});

jQuery(document).ready(function(){
	jQuery(document).pngFix();
	jQuery(".rollover").hover(
		function(){
			if(jQuery(this).attr("src").indexOf("-active") == -1) {
				var newSrc = jQuery(this).attr("src").replace(".gif","-active.gif#hover");
				jQuery(this).attr("src",newSrc);
			}
		},
		function(){
			if(jQuery(this).attr("src").indexOf("-active.gif#hover") != -1) {
				var oldSrc = jQuery(this).attr("src").replace("-active.gif#hover",".gif");
				jQuery(this).attr("src",oldSrc);
			}
		}
	);

	resizeSpacer ();
	repositionContent ();
	jQuery(window).resize(function(){
		resizeSpacer ();
		repositionContent ();
	});

});

var bodyHeight = 0;

function resizeSpacer() {
	/*if (bodyHeight == 0)
		bodyHeight = jQuery('#body').height () + jQuery('#footer').height();
	var height = jQuery(window).height () - bodyHeight;
	if (jQuery.browser.safari)
		height -= 405;
	else
		height -= 327;
	if (height > 0)
		jQuery('#spacer').css('height', '' + height + 'px');
	else
		jQuery('#spacer').css('height', '1px');
	jQuery('#footer').css('padding-top', '15px');
	jQuery('#footer').css('padding-bottom', '8px');*/
	if (bodyHeight == 0)
		bodyHeight = jQuery('#body').height () + jQuery('#footer').height();
	var height = jQuery(window).height () - bodyHeight - 368;
	if (height > 0)
		jQuery('#spacer').css('height', '' + height + 'px');
	else
		jQuery('#spacer').css('height', '1px');
}

function isNumberEven (num) {
	if (num % 2 == 0)
		return true;
	return false;
}

function repositionContent () {
}


