<!--

	/********************************************
	* Common JavaScript functions
	********************************************/	
	
	/********************************************************************************
	* Name:         Check Field (CheckField)
	* File Name:		N/A
	* Version:      1.0
	* Environment:  JavaScript
	* Author:       John Burris
	* Date Created: 03-Feb-2005
	* --------------------------------------------------------------------------------
	* Dependencies: None
	* --------------------------------------------------------------------------------
	* Description:  Checks a form field and if desired, returns a message.
	* --------------------------------------------------------------------------------
	* Notes:        
	*********************************************************************************/
	function CheckField(Field,strMessage) 
	{
		if (Field.value==""){
			alert(strMessage);
			Field.focus();
			return false;
		}
		return true
	}


	/********************************************************************************
	* Name:         Clear Text (ClearText)
	* File Name:		N/A
	* Version:      1.0
	* Environment:  JavaScript
	* Author:       John Burris
	* Date Created: 05-Oct-2004
	* --------------------------------------------------------------------------------
	* Dependencies: None
	* --------------------------------------------------------------------------------
	* Description:  Removes the text from the provided field.
	* --------------------------------------------------------------------------------
	* Notes:        
	*********************************************************************************/
	function ClearText(Field) 
	{
		if(Field.defaultValue == Field.value) { Field.value = "" }
	}
	
	
	/********************************************************************************
	* Name:         Four Digit Year (FourDigitYear)
	* File Name:		N/A
	* Version:      1.0
	* Environment:  JavaScript
	* Author:       John Burris
	* Date Created: 05-Oct-2004
	* --------------------------------------------------------------------------------
	* Dependencies: None
	* --------------------------------------------------------------------------------
	* Description:  Accepts a two-digit year and returns a four-digit year.
	* --------------------------------------------------------------------------------
	* Notes:        
	*********************************************************************************/
	function FourDigitYear(intYear)
	{
		intYear = intYear - 0;
		if (intYear < 70) { return (2000 + intYear); }
		if (intYear < 1900) { return (1900 + intYear); }
		return intYear;
	}

	
	/********************************************************************************
	* Name:         Get This Item (GetThis)
	* File Name:		N/A
	* Version:      1.0
	* Environment:  JavaScript
	* Author:       John Burris
	* Date Created: 05-Oct-2004
	* --------------------------------------------------------------------------------
	* Dependencies: None
	* --------------------------------------------------------------------------------
	* Description:  Loads the link from a dropdown menu into the current window.
	* --------------------------------------------------------------------------------
	* Notes:        
	*********************************************************************************/
	function GetThis(Form)
	{ 
		var myindex = Form.gotolink.selectedIndex
		if(!(myindex == "")) { window.location.href = Form.gotolink.options[myindex].value; }
	}
	

	/********************************************************************************
	* Name:         Is It Today? (IsItToday)
	* File Name:		N/A
	* Version:      1.0
	* Environment:  JavaScript
	* Author:       John Burris
	* Date Created: 05-Oct-2004
	* --------------------------------------------------------------------------------
	* Dependencies: None
	* --------------------------------------------------------------------------------
	* Description:  Checks to see if the string date provided, which can be formatted
	*				in several different ways, is today's date.
	* --------------------------------------------------------------------------------
	* Notes:        
	*********************************************************************************/
	function IsItToday(strDate,intDateType)
	{
		var now = new Date();
		var today = new Date(now.getYear(),now.getMonth(),now.getDate());
	
		// Date format: 19970529
		if (intDateType == 1) { var date = new Date(strDate.substring(0,4),strDate.substring(4,6)-1,strDate.substring(6,8)); }
		// Date format: 970529
		else if (intDateType == 2) { var date = new Date(strDate.substring(0,2),strDate.substring(2,4)-1,strDate.substring(4,6)); }
		// Date format: 29/05/1997
		else if (intDateType == 3) { var date = new Date(strDate.substring(6,10),strDate.substring(3,5)-1,strDate.substring(0,2)); }
		// Date format: 29/05/97
		else if (intDateType == 4) { var date = new Date(strDate.substring(6,8),strDate.substring(3,5)-1,strDate.substring(0,2)); }
		else { return false; }
	
		if (date.toString() == today.toString()) { return true; }
		else { return false; }
	}
	
	
	/********************************************************************************
	* Name:         Make Array (MakeArray)
	* File Name:		N/A
	* Version:      1.0
	* Environment:  JavaScript
	* Author:       John Burris
	* Date Created: 05-Oct-2004
	* --------------------------------------------------------------------------------
	* Dependencies: None
	* --------------------------------------------------------------------------------
	* Description:	Creates an array and populates it with the given items.
	* --------------------------------------------------------------------------------
	* Notes:        
	*********************************************************************************/
	function MakeArray()
	{
		for (i = 0; i < MakeArray.arguments.length; i++) { this[i] = MakeArray.arguments[i]; }
	}
	
	
	/********************************************************************************
	* Name:         Ordinal Numbers (nths)
	* File Name:		N/A
	* Version:      1.0
	* Environment:  JavaScript
	* Author:       John Burris
	* Date Created: 05-Oct-2004
	* --------------------------------------------------------------------------------
	* Dependencies: None
	* --------------------------------------------------------------------------------
	* Description:  Accepts a day and returns and return the ordinal expression
	*				which follows it.
	* --------------------------------------------------------------------------------
	* Notes:        
	*********************************************************************************/
	function nths(intDay) 
	{
		if (intDay == 1 || intDay == 21 || intDay == 31) { return 'st'; }
		if (intDay == 2 || intDay == 22) { return 'nd'; }
		if (intDay == 3 || intDay == 23) { return 'rd'; }
		return 'th';
	}
	
	
	/********************************************************************************
	* Name:         Pop Up Window (PopUpWindow)
	* File Name:		N/A
	* Version:      1.01
	* Environment:  JavaScript
	* Author:       John Burris
	* Date Created: 05-Oct-2004
	* --------------------------------------------------------------------------------
	* Dependencies: None
	* --------------------------------------------------------------------------------
	* Description:  Opens a pop up window with the given dimensions and 
	*								loads the provided URL.
	* --------------------------------------------------------------------------------
	* Notes:        
	*********************************************************************************/
	function PopUpWindow(strURL, intWidth, intHeight)
	{
		eval("WinID" + " = window.open(strURL, 'WinID', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + intWidth + ',height=' + intHeight + ',screenX=50,screenY=50,top=50,left=50');");
   		if (!WinID.opener) { WinID.opener = self; }
	}
	
	
	/********************************************************************************
	* Name:         Year 2000 (Year2000)
	* File Name:		N/A
	* Version:      1.0
	* Environment:  JavaScript
	* Author:       John Burris
	* Date Created: 05-Oct-2004
	* --------------------------------------------------------------------------------
	* Dependencies: None
	* --------------------------------------------------------------------------------
	* Description:  Adds 1900 to values under 1000 (e.g. 105 = 2005)
	* --------------------------------------------------------------------------------
	* Notes:        
	*********************************************************************************/
	function Year2000(intNumber)
	{
		return (intNumber < 1000) ? intNumber + 1900 : intNumber;
	}

	
// -->