
	window.onload = function ()
	{
		// The purpose of this function is to make all the INPUT fields have a consecutive "tab index"
		// This increases usability and accessibility for a lot of users
		
		// Setup the Tab Index as 0
		var intTabIndex = 0;
		
		// Loop through each of the Forms on the page
		for (i=0; i < document.forms.length; ++i)
		{
			// Loop through each of the Elements in the form
			for (j=0; j < document.forms [i].elements.length; ++j)
			{
				// Set the "tab index"
				document.forms [i].elements [j].tabIndex = ++intTabIndex;
			}
			
			if (document.forms [i].addEventListener)
			{
				document.forms [i].addEventListener ("submit", DisableSubmits, true);
			}
			else if (document.forms [i].attachEvent)
			{
				document.forms [i].attachEvent ("onsubmit", DisableSubmits);
			}
		}
		
		// Prevent Drag/Drop
		/*
		if (window.attachEvent) document.body.attachEvent ("ondragstart", function () { return false; });
		if (window.attachEvent) document.body.attachEvent ("onselectstart", function () { return false; });
		*/
	}
	
	function DisableSubmits (objForm)
	{
		// Loop through each of the Forms on the page
		for (i=0; i < document.forms.length; ++i)
		{
			// Loop through each of the Elements in the form
			for (j=0; j < document.forms [i].elements.length; ++j)
			{
				if (document.forms [i].elements [j].type == "submit")
				{
					// Disable the Button
					document.forms [i].elements [j].disabled = true;
				}
			}
		}
	}
	
	function Popup (objAddress, intWidth, intHeight)
	{
		var strPopup = objAddress.getAttribute ("href");
		
		if (intWidth == undefined ) intWidth = 250;
		if (intHeight == undefined ) intHeight = 250;
		
		var winPopup = window.open (
			strPopup, 
			'name', 
			'scrollbars=yes, ' + 
			'resizable=yes, ' + 
			'toolbar=no, ' + 
			'menubar=no, ' + 
			'location=no, ' + 
			'directories=no, ' + 
			'fullscreen=no, ' + 
			'dependent=yes, ' + 
			'height=' + intHeight + ', ' + 
			'width=' + intWidth
		);
		
		if (window.focus) winPopup.focus();
		
		return false;
	}
	
	function ImageUpdate (objCaller, strImage)
	{
		document.getElementById (strImage).src = "img/font/" + objCaller.options [objCaller.selectedIndex].value;
	}
	