	// Global Variables
	var scrollingOffset = -115;
	var scrollingOffsetIndex = -205;
	
	// Common Javascript function library

		
		// ------------------------------------------------------------------
		// Display an object by id
		function getElement(obj) 
		{
			if (document.getElementById)  
			{ 
				return document.getElementById(obj); 
			}
			if (document.all) 
			{ 
				return document.all[obj];
			} 
			if (document.layers)
			{
				return getLayer(obj, document);
			}
		}

		
		// ------------------------------------------------------------------
		// Display an object
		function show_props(obj, obj_name)
		{
			var result = "<p>";
			
			for (var i in obj) 
			{
				result += obj_name + "." + i + " = " + obj[i] + "<br />";
			}
			result += "</p>";
			
			return result;
		}

		
		// ------------------------------------------------------------------
		// Displays a single array were function called
		function displaySingleArray ( theArray )
		{
			document.write("<p>");
			for (var i=0; i < theArray.length; i++)
			{
				document.write("[" + i + "] = " + theArray[i] + "<br />");
			}
			document.write("</p>");
		}		// ------------------------------------------------------------------
		// Display 2D array where function called
		function display2DArray ( theArray )
		{
			for (var i=0; i < theArray.length; i++) 
			{
				var str = "<p>Row "+i+" - ";
				for (var j=0; j < theArray[i].length; j++) 
				{
					str += " " + theArray[i][j] + " ";
					if (j < (theArray[i].length - 1))
					{
						str += ",";
					}
				}
				document.write(str+"</p>");
			}
			
		}		// ------------------------------------------------------------------
		// Returns random number within range provided
		// Warning..... not working on low range.
		function randomNumberInRange( rangeStart , rangeEnd)
		{
			var result = Math.floor(Math.random() * rangeEnd) + rangeStart;
			
			return result;
		}	
		
		// ------------------------------------------------------------------
		// *** Window Functions
		// ------------------------------------------------------------------
		
		// ------------------------------------------------------------------
		// Opens a pop-up window
		function openSimpleWindow(theSource,windowName,has_controls,window_height,window_width)
		// Popup simple popup window 
		{
			var heightText = '';
			var widthText = '';
			var controlsText = '';
			
			if (has_controls)
			{
				controlsText = 'titlebar=yes,toolbar=yes,location=yes,menubar=yes,personalbar=yes';
			}
			else
			{
				controlsText = ',toolbar=no,location=no,menubar=no';
			}
			if (window_height != '')
			{
				heightText = ",height="+window_height;
			}
			if (window_width != '')
			{
				widthText = ",width="+window_width;
			}
			var options = "resizable=yes,top=0,scrollbars=yes,status=yes,left=50,alwaysRaised=yes"+controlsText+heightText+widthText;
		//	alert(options);
			
			var vWInfoWin = window.open(theSource,windowName,options);
		}

		// ------------------------------------------------------------------
		// Opens a pop-up window
		function adjustScrollPosition(x,y)
		{
		//	alert("hello");
			window.scrollBy(x, y);
			return false;
		}		// ------------------------------------------------------------------
		// *** Email Functions
		// ------------------------------------------------------------------

		// ------------------------------------------------------------------
		// Creates an email address link dynamically that spammers cannot trawl through.
	 	function secureEmail ( name, domain, tld, region, label)
		{
			var theString = "<a href=\"mailto:";
			
			theString += name;
			theString += "@";
			theString += domain;
			theString += ".";
			theString += tld;
			theString += ".";
			theString += region;
			theString += "\">";
			theString += label;
			theString += "</a>";
		
		//	alert(theString);
		
			document.write(theString);
		}

		// ------------------------------------------------------------------
		// ------------------------------------------------------------------
		// Utility Function
		// for getElement, ...
		function getLayer(obj, currentDoc) {
			var currentLayer = currentDoc[obj];
			if (!currentLayer) {
				for (var getobjloop=0;getobjloop<currentDoc.layers.length;getobjloop++) {
					currentLayer = getLayer(obj,currentDoc.layers[getobjloop].document);
					if (currentLayer) { return currentLayer; }
					}
				}
			return currentLayer;
			}

		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		// 'over' images.
		function imgOver(imgID) 
		{
		  var theBtn = getElement(imgID);
	
			// alert("id = " + theBtn.id + "\n" + "src = " + theBtn.src);
			theBtn.src = eval(imgID + "_over.src");
			// alert("id = " + theBtn.id + "\n" + "src = " + theBtn.src);

			return true;  // notify browser we have handled the event.
		}
		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		// 'default' images.
		function imgDefault(imgID) 
		{
		var theBtn = getElement(imgID);
			
			// alert("id = " + theBtn.id + "\n" + "src = " + theBtn.src);
			theBtn.src = eval(imgID + "_default.src");
			// alert("id = " + theBtn.id + "\n" + "src = " + theBtn.src);
			
			return true;  // notify browser we have handled the event.
		}
		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
