jQuery.noConflict();

var imageRotatorInterval = 4000; 
var wrapperWidth = 0, wrapperHeight = 0, bodyPaddingTop = 0, contentContainerPaddingTop = 0, contentContainerPaddingBottom = 0;

function resizeWrapper() 
{
	var windowHeight = jQuery(window).height();
	var windowWidth = jQuery(window).width();

	if (wrapperWidth == 0) { 
		wrapperWidth = jQuery("#wrapper").width();
		wrapperHeight = jQuery("#wrapper").height();
		bodyPaddingTop = parseInt(jQuery("body").css("padding-top"));
		contentContainerPaddingTop = parseInt(jQuery("#right-column").css("padding-top"));
		contentContainerPaddingBottom = parseInt(jQuery("#right-column").css("padding-bottom"));
	}

	if (windowWidth <= wrapperWidth)
	{
		jQuery("#wrapper").css('width', wrapperWidth - 48);
		jQuery("#footer").css('width', wrapperWidth - 68);
	}

	if (windowHeight < wrapperHeight) jQuery("#wrapper").css('height', windowHeight - bodyPaddingTop - jQuery("#footer").height()); 
		else jQuery("body").css('padding-top', (parseInt(windowHeight - wrapperHeight)/2));

	jQuery("#content").css('height', jQuery("#wrapper").height() - contentContainerPaddingTop - contentContainerPaddingBottom);
	
	jQuery("#image-rotator").css('height', jQuery("#content").height() - 10).css("width", jQuery("#content").width() - 3);
	
	
}

jQuery(window).load(function () {	
    jQuery(window).resize(function(){
        //resizeWrapper();
    });
	//resizeWrapper();
	
	jQuery("#nav ul a").append("<span></span>");
	
	jQuery('#wrapper').css("visibility", "visible");
	jQuery('#footer').css("visibility", "visible");
	
	jQuery('#image-rotator li:gt(0)').hide();
	jQuery('#image-rotator ul').css("visibility", "visible");
	startImageRotator();
	
	// Set fixed height on right colum
	var leftHeight = jQuery('#left-column').height();
	jQuery('#right-colum').height(leftHeight);
	
	
});

function startImageRotator()
{
	setInterval(function(){
		jQuery('#image-rotator li:first-child').fadeOut()
		.next('li').fadeIn()
		.end().appendTo('#image-rotator ul');}, 
	imageRotatorInterval);
}

		

