//////////////////////////////////////////////////////////////////////////
// This function handles the dropdown text for all w3-type browsers.    //
// It takes two parameters: 1) The number of the dropdown, 2) The total //
// number of dropdowns. If num is 'all,' it opens all of the dropdowns  //
// on the page, otherwise it loops through the other dropdowns, closing //
// all but the requested one and opening the requested one. The bullet  //
// image changes with the state of the dropdown. There are three states //
// for the bullet image.                                                //
//////////////////////////////////////////////////////////////////////////
// This script was written by Jessyca Wallace for Monarch Productions   //
// on April 3, 2002. It is copyrighted, all rights reserved, and any    //
// use of this script without express written consent from Jessyca      //
// Wallace is considered a violation of that copyright.                 //
//////////////////////////////////////////////////////////////////////////

// Define a counter for measuring whether all text is displayed or not
var allCount = 0;

// Declare the function.
function dropList(num,total) {
	
	// Determine if it is the one that displays all of the text
	if (num == 'all') {
		
		// Determine if the count is even or odd. 
		// Even displays the text, odd hides it.
		if (allCount%2 == 0) {
			
			// Loop through all of the dropdowns on the page
			for (var i = 0; i < total; i++)
			{
				// Get the text block and change its display
				var id = 'dropText' + i;
				var t = document.all(id);
				t.style.display = 'block';
				
				// Get the bullet image and change its src, width, and height
				var image = 'bullet' + i;
				var l = document.all(image);
				l.src = '/assets/images/common/list-image2.gif';
				l.style.width = '17px';
				l.style.height = '13px'; 
				l.style.marginRight = '0px';
			}
			
			// Increment the count so the opposite effect happens on the next click
			allCount = allCount + 1;
			
			// Modify the bullet image next to the 'Display all text' link
			var aid = 'bullet' + 'All';
			var a = document.all(aid);
			a.src = '/assets/images/common/list-image2.gif';
			a.style.width = '17px';
			a.style.height = '13px';
			a.style.marginRight = '0px';
		
		// The 'Display all text' link has been clicked and the count is odd
		} else {
			
			// Loop through the bullets on the page, hide all text, 
			// modify all of the bullet images
			for (var i = 0; i < total; i++)
			{
				var id = 'dropText' + i;
				var t = document.all(id);
				t.style.display = '';
				
				var image = 'bullet' + i;
				var l = document.all(image);
				l.src = '/assets/images/common/list-image.gif';
				l.style.width = '13px';
				l.style.height = '17px';
				l.style.marginRight = '0px'; 
			}
			
			// Increment the count so the text is shown next time
			allCount = allCount + 1;
			
			// Restore the bullet image next to the 'Display all text' link
			var aid = 'bullet' + 'All';
			var a = document.all(aid);
			a.src = '/assets/images/common/list-image.gif';
			a.style.width = '13px';
			a.style.height = '17px';
			a.style.marginRight = '3px';
		}
	
	// A single bullet link has been clicked
	} else {
		
		// Get the requested block of text and its image
		var eid = 'dropText' + num;
		var e = document.all(eid);
		var bid = 'bullet' + num;
		var b = document.all(bid);
		
		// If the bullet item is already open, close it
		// and set its bullet image to the 'visited' state
		if (e.style.display == 'block') {
			e.style.display = '';
			b.src = '/assets/images/common/list-image.gif';
			b.style.width = '13px';
			b.style.height = '17px';
			b.style.marginRight = '3px';
			
		// Set the requested block of text to be displayed and
		// modify its bullet image to the 'active' state
		} else {
		
			// Loop through all of the bullet items 
			for (var i = 0; i < total; i++)
			{
				// Get each block of text
				var id = 'dropText' + i;
				var t = document.all(id);
			
				// Set the bullet images of any open blocks of text to the 'visited' state
				if (t.style.display == 'block') {
					var image = 'bullet' + i;
					var l = document.all(image);
					l.src = '/assets/images/common/list-image.gif';
					l.style.width = '13px';
					l.style.height = '17px';
					l.style.marginRight = '3px';
				}
			
				// Set any open blocks of text to have no display
				t.style.display = ''; 
			}
			
			e.style.display = 'block';
			b.src = '/assets/images/common/list-image2.gif';
			b.style.width = '17px';
			b.style.height = '13px';
			b.style.marginRight = '0px';
		}
		
		// Restore the count to 0 so that all of the text blocks become visible
		// if the 'Display all text' link is clicked again
		allCount = 0;
	}
}

// Declare the function.
function dropSingle(num) {
	
	// Get the requested block of text and its image
	var eid = 'dropSingle' + num;
	var e = document.all(eid);
	var bid = 'bullet' + num;
	var b = document.all(bid);
	
	// If the bullet item is already open, close it
	// and set its bullet image to the 'visited' state
	if (e.style.display == 'block') {
		e.style.display = '';
		b.src = '/assets/images/common/list-image.gif';
		b.style.width = '13px';
		b.style.height = '17px';
		
	// Set the requested block of text to be displayed and
	// modify its bullet image to the 'active' state
	} else {
	
		e.style.display = 'block';
		b.src = '/assets/images/common/list-image2.gif';
		b.style.width = '17px';
		b.style.height = '13px';
	}
}

// Rollovers 
function On(img) {
	var image = document.all('' + img + 'Top');
	image.src = '/assets/images/navigation/' + img + '-on.gif';
}

function Off(img) {
	var image = document.all('' + img + 'Top');
	image.src = '/assets/images/navigation/' + img + '-off.gif';
}

// External Links
function linkOut(message,url) {
	var approve = confirm(message);
	if (approve == true)
		window.open(url);
}