	// 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;
		}	
		
		
		// ------------------------------------------------------------------
		// Opens a pop-up window
		function openSimpleWindow(theSource,windowName)
		// Popup simple popup window 
		{
			var vWInfoWin = window.open(theSource,windowName,"resizable=yes,toolbar=no,location=no,scrollbars=yes,status=yes,menubar=no,top=50,left=50,width=400,height=300");
		}

		// 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;
			}


