//no conflict jquery 
jQuery.noConflict();

jQuery(document).ready(function(){ 
	
	//Set the heights of the content background and fade
	var divContentHeight = jQuery(".left_side").height();
	var pageHeight = divContentHeight + 315;
	var footerPosition = divContentHeight + 320;
	if(divContentHeight == null) {
		pageHeight = 800;
		footerPosition = 805;
	}
	if(pageHeight < 800) {
		pageHeight = 800;
		footerPosition = 805;
	}
	jQuery("#background_fade").css("height", pageHeight);
	jQuery("#footer").css("top", footerPosition);
	
	//Schedule Toggle (Show/Hide extra content)
	jQuery(".schedule_extra").hide();

	jQuery("#item_more").toggle(function(){
		jQuery(this).text("[-]");
		}, function () {
		jQuery(this).text("[+]"); 
	});
	
	jQuery(".schedule_container").click(function(){
		jQuery(this).next(".schedule_extra").slideToggle("slow");
	});
	
	//Results Toggle (Show/Hide extra content)
	jQuery(".results_extra").hide();

	jQuery("#results_more").toggle(function(){
		jQuery(this).text("[-]"); 
		}, function () {
		jQuery(this).text("[+]"); 
	});
	
	jQuery(".results_container").click(function(){
		jQuery(this).next(".results_extra").slideToggle("slow");
	});

});

// Sponsor Rotator
var imgStr = ["1.jpg","1.jpg", "2.jpg", "3.jpg", "4.jpg"];
var rotator = {
    path:   '/images/sponsors/',
    id:   'rotate_img',
    speed: 3000,
    bTrans: true,
    bRand: false,
    bMouse: true,
    images: imgStr,
    actions: ["http://www.mikeshardlemonade.com","http://www.mikeshardlemonade.com","http://simpsonraceproducts.com/","http://www.lonbro.com/","http://www.turnermotorsportsllc.com/"] // Image linked, all point to same URL 
}

function initRotator() {
    dw_Rotator.setup(rotator);
}

dw_Event.add( window, 'load', initRotator);
