/****************************************************************************************
 * Author			: Rob Brown
 * Name				: launchChild
 * Description: Open child browser (for request forms) with particular pop-up dimensions!
 ****************************************************************************************/

	function launchChild (url, width, height)
	{
		var propString = new String;
		propString = 'width=' + width + ',height=' + height + 'top=5,left=200,scrollbars=1,resizable';
		//window.open(url,'child',propString);
		window.open(url,'_blank',propString);
	}

/****************************************************************************************
 * Author			: Rob Brown
 * Name				: openChild
 * Description: Makes the items in the selectboxes hyperlinks that open child browsers
 ****************************************************************************************/

	function openChild(TF)
	{
		var url;
		var name;
		var sname;
		url = TF.options[TF.selectedIndex].value;
		name = new String(TF.options[TF.selectedIndex].text);
		sname = name.replace(/\W/gi, '');
		window.open(url,sname);
	}

/****************************************************************************************
 * Author			: Rob Brown
 * Name				: openChild
 * Description: Makes the items in the drop down list boxes hyperlinks that open child
 *							browsers
 ****************************************************************************************/

	function openChildFromDropDownListBox(TF)
	{
		var url;
		if ( TF.options != null ) {
			url = TF.options[TF.selectedIndex].value;
			if (url != "")
			{
				//document.location="<%=URL%>" + url;
				window.open(url,'');
			}
		}
	}

/****************************************************************************************
 * Author				: Rob Brown
 * Name					: moveToAnchor
 * Description	: Just moves the location to the passed anchor (used on itinerary.asp)
 * Modification : Handles old Netscape and other browsers now as well
 ****************************************************************************************/

	function moveToAnchor(anchorTag) {
		// javascript with anchors does not like names with a # in them...
		var loopcount;
		loopcount = 0;
		while (loopcount < document.anchors.length) {
			if (document.anchors[loopcount].name != anchorTag) {
				loopcount = loopcount + 1;
			}
			else {
				if (navigator.appName == 'Netscape') {
	        if (document.images)
	          document.location.replace(document.location + '#' + anchorTag);
	        else
						document.location.href = document.location + '#' + anchorTag;
				}
				else {
					document.anchors[loopcount].scrollIntoView();
				}
				break;
			}
		}
	}

/****************************************************************************************
 * Author			: Dudley
 * Name				: checkDate
 * Description: Checks the passed field for valid date
 ****************************************************************************************/

	function checkDate(fred)
	{
	   var str;

	   var dd;
	   var mm;
	   var yy;
	   var num;
	   var first;
	   var second;

	if (fred.value != "")
	   {
		   str=new String(fred.value)
		   dd=str.substring(0,2);
		   mm=str.substring(3,5);
		   yy=str.substring(6,10);
		   first=str.substring(2,3);
		   second=str.substring(5,6);

		   if ( (str.length != 10) || ((first != '/') && (first != '-')) || ((second != '/') && (second != '-')) || (mm < 1) || (mm > 12) || (dd < 1) || (dd > 31) || (yy < 1999) || (yy > 2020) )
		   {
		   	 alert('This is not a valid date.');
		   	 fred.value = "";
		     return (false);
		   }

		}
		return (true);
	}

