 $(document).ready(function(){
	
	$('a[@rel*=lightbox]').lightBox(); 
	
		// if nav is going over a select box then use bgIframe plugin and code for IE6 issues
	$("ul.nav").superfish({
		hoverClass	: "sfHover",
		animation : { opacity:"show", height:"show" },
		speed		: "normal",
		delay		: 000,
		oldJquery	: false, /* set to true if using jQuery version below 1.2 */
		disableHI	: false, /* set to true to disable hoverIntent detection */
		onInit		: function(){},
		onBeforeShow	: function(){},
		onShow		: function(){},
		onHide		: function(){}
	});
	
	
	// jquery odd/even table row background change
	$('table.striped > tr:odd').css('background', '#999999');
	
	
// use class on anchor class="view_details"  use rel= on anchor w/ _$cnt appended   rel="view_details'. $cnt.'"
	// i.e.  <a href="#" class="view_all_goal" rel="view_all_goal_'.($cnt).'" >View All</a>				
	// i.e.  <tr class="view_all_goal_'.($cnt).'" style="display:none">					
					
							
	$('.view_details').click(	
		function(){
			var toggleHide = 'images/hide.gif';
			var toggleShow = 'images/view.gif';
			var eDiv = $('div.'+$(this).attr('rel'));
			var eImg = $(this).children('img');

			if(eDiv.is(':hidden')){
					$(this).children('img').attr('src', toggleHide);
					eDiv.show('slow');
				
				}	
							
			else if(eDiv.is(':visible')){
					$(this).children('img').attr('src', toggleShow);
					eDiv.hide('slow');
				
				}
		
			return false;	
						
		});


	//set class for links to external sites and other document types
	$('a[href^="http://"]').addClass('external').attr('target', '_blank');
	$('a[href$=".pdf"]').addClass('pdf').attr('target','_blank');
	$('a[href$=".ppt"]').addClass('powerpoint').attr('target','_blank');
	$('a[href$=".doc"]').addClass('word').attr('target','_blank');
	$('a[href$=".xls"]').addClass('excel').attr('target','_blank');
	$('a[href$=".csv"]').addClass('excel').attr('target','_blank');

	$('.social_column a[href^="http://"]').removeClass('external').attr('target', '_blank');
	$('.nav a[href^="http://"]').removeClass('external').attr('target', '_blank');
	
//	setInterval(function(){animateFlower()},1000);
	function animateFlower(){
			$("#essaylinkflower").animate({marginRight:'30px'},3500);		
			$("#essaylinkflower").animate({marginRight:'5px'},3500);	
		}	
		
//	animateFlower();


// move the car
setInterval(function() {moveCar() },4000);
function moveCar(){
	
	$('#car').css({backgroundPosition:'250px 2px', backgroundRepeat: 'repeat'});
	
	$('#car').stop().animate({backgroundPosition:"(-250px 2px)"}, {duration:10000});
	
	$('#car').css({backgroundPosition:'-250px 0px', backgroundRepeat: 'no-repeat'});
}

moveCar();


}); // close document ready
