// JavaScript Document

var totalHeight = 0;

$(document).ready(function() { 	
	
	$("ul#largeButton li").mouseover(function() { 
		$(this).stop().animate({backgroundPosition:"10px center"}, 250);
	}).mouseout(function(){
		$(this).stop().animate({backgroundPosition:"0px center"}, 250);
	})
	
	
	$(".coloredBtnWrapper a").mouseover(function() { 
		$(this).stop().animate({backgroundPosition:"18px center"}, 250);
	}).mouseout(function(){
		$(this).stop().animate({backgroundPosition:"8px center"}, 250);
	})
	
	$("#greenBtn a").mouseover(function() { 
		$(this).stop().animate({backgroundPosition:"22px center"}, 250);
	}).mouseout(function(){
		$(this).stop().animate({backgroundPosition:"12px center"}, 250);
	})
	
	

	
	//This is the javaScript that places the background image for the "Q" in the leftNav 
	$( "ul#leftNav.QBkgd li" ).each(
	  
	 // The "intIndex" is the loop iteration index on the current element.
	 function( intIndex ){
	  var intHeight = $(this).height();
	  
	  if(intIndex > 0 && totalHeight < 150)
	  {
		$(this).css("background-position", "right -" + (totalHeight+(intIndex*(intIndex+5))-5) + "px");
		totalHeight += intHeight;
	  }
	  else
	  {
		  	$(this).css("background", "none");
	  }
	  
	  //IE 6 sucks!
	  if($.browser.msie && $.browser.version <= "6.0")
		$(this).css("background", "none");
	  
	});
	
	$("ul#leftNav.QBkgd li ul li").css("background-image","none");
	
	
	
	
	
	
	//This script looks to see if a nested list is at the end of the left nav. If it is, a new image is used
	$("ul#leftNav li ul li").parent().parent().parent().parent().css("background","url(prebuilt/images/interior1/leftNavInnerBottom.png) bottom right no-repeat");
	

});
