// JavaScript Document


	// =============================================================
	// Testimonials Quote Swapping
	// =============================================================

	var cur_quote=1;
	
	function ShowQuote(quote_num)
	{
		var div_id_str_old; 
		var div_id_str_new;
		
		
		div_id_str_old = "Quote-" + cur_quote;
		div_id_str_new = "Quote-" + quote_num; 
		cur_quote = quote_num; 

		// turn off old
		document.getElementById(div_id_str_old).style.display="none";

		// turn on new
		document.getElementById(div_id_str_new).style.display="";
	}
		
	function ChangeQuote()
	{
		var randomnumber
		
		do
		{
				randomnumber=Math.floor(Math.random()*6) + 1; 
		} while (randomnumber==cur_quote);
		
		ShowQuote(randomnumber)
	}
	
	 var timer1 = setInterval("ChangeQuote()", 8000);

	
	// =============================================================
	// NAV Button Rollover Caching
	// =============================================================
	
	function AddRollover(img, rolloverURL)
	{
		if (typeof img == "string") // if img is a string
		{
				var id = img;       // it is an id, not an image
				img = null;         // and we don't have an image yet
				
				// first try looking the image up by id
				if (document.getElementById) 
					img = document.getElementById(id);
				else if (document.all) img = document.all[id];
				
				// if not found by id, try looking up by name
				if (!img) 
					img = document.images[id];
				
				// if still not found, do nothing, fail silently
				if (!img) 
					return;
		}
		
		// if we found an element but it is not an <img> tag, fail
		if (img.tagName.toLowerCase() != "img") return;
		
		// Remember the original URL of image
		var baseURL = img.src;
		
		// Preload rollover image into cache
		(new Image()).src = rolloverURL;
		
		img.onmouseover = function() {img.src = rolloverURL; }
		img.onmouseout = function() { img.src = baseURL; }
	}
	
	function InitRollovers() 
	{
		var images = document.getElementsByTagName("img");
		
		for (var i=0; i<images.length; i++)
		{
				var image = images[i];
				var rolloverURL=image.getAttribute("rollover");
				if (rolloverURL) 
					AddRollover(image, rolloverURL);
		}
	}
				
	// =============================================================
	// =============================================================
		
	function DocInit()
	{
		ChangeQuote();
		
		InitRollovers();
	}

	// =============================================================
	// =============================================================
	
	function DocInit_NoQuotesBox()
	{
		//ChangeQuote();
		
		InitRollovers();
	}	
