$(function() {
	// zindex fix for divs and megaDiv hover
	var zIndexNumber = 1000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
});

// ANYTHING SLIDER JQUERY BY CHRIS COYIER AND DOUGLAS NEINER
function formatText(index, panel) {
  return index + "";
}

// Logo rollover and click to home
$(function () {
	$('#header h1').mouseover(function () {
		$(this).css("cursor","pointer");									
	});
	$('#header h1').click(function () {
		window.location = "http://www.gpreinc.com"; // Change back to "/" on launch ********************************************								
	});
});

// Navigation menu behavior
$(function(){  
	//$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)  
	$("ul.topnav li span, ul.topnav li a").mouseover(function() { //When trigger is clicked...  
	//Following events are applied to the subnav itself (moving subnav up and down)  
	$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click  
	$(this).parent().hover(function() {  
	}, function(){  
	$(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up  
	});  
	//Following events are applied to the trigger (Hover events for the trigger)  
	}).hover(function() {  
	$(this).addClass("subhover"); //On hover over, add class "subhover"  
	}, function(){  //On Hover Out  
	$(this).removeClass("subhover"); //On hover out, remove class "subhover"  
	});  
});

// slider controls
$(function () {
	$('.anythingSlider').anythingSlider({
		easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
		autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
		delay: 6000,                    // How long between slide transitions in AutoPlay mode
		startStopped: false,            // If autoPlay is on, this can force it to start stopped
		animationTime: 600,             // How long the slide transition takes
		hashTags: false,                 // Should links change the hashtag in the URL?
		buildNavigation: false,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Go",             // Start text
		stopText: "Stop",               // Stop text
		navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
	});
});

// career functions
$(function() {
	$('a.careerDetails').click(function() {
		$(this).next().toggle();
		return false;
	});
});

// table odd rows
$(function() {
	$("table.bidsTable tr:even").not('tr:first').addClass("odd"); 	
	$("table.bidsTable tr:odd").addClass("even"); 	
});
