function CheckOptions(myForm)
{
	if(myForm.selectedIndex==0)
	{
		alert("Please select an option.");
		myForm.focus();
		return false;
	}
	else
	{
		return true;
	
	}
}

function checkExtOps(frmname)
{
 //go through each element to see if any are dropdowns, check to see if something is selected.
 for(i=0; i < frmname.length; i++)
 {  
  if(frmname.elements[i].type == 'select-one' || frmname.elements[i].type == 'select-multiple')
  {
   if(frmname.elements[i].selectedIndex==0)
   {
    alert("Please select an option.");
    frmname.elements[i].focus();
    return false;
   }
  }
 } 
 return true;
}

function changeImages() {
	preloadFlag = true;
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		preloadFlag = true;
	}
}

function TrackCheck()
{
	if (document.shipform.realnum.value == "")
	{
		alert("You must enter a number before clicking\nthe track button.");
		return false;
	}

	if (document.shipform.coortrack[0].checked == true)
	{
		if (document.shipform.shiptype[0].checked == true)
		{
			document.shipform.action = "https://www.fedex.com/AltRefTracking?ascend_header=1&clienttype=dotcom&cntry_code=us&language=english&altref=y&tracknumbers=" + document.shipform.realnum.value;
			return true;
		}
		else if (document.shipform.shiptype[1].checked == true)
		{


                        myDate = new Date();
                      	toMonth = myDate.getMonth() + 1; // this line sets the myMonth variable to correspond with the calendar month.
                      	toDay = myDate.getDate() + 2; // sets the toDay to two days from today.
                      	fromMonth = toMonth - 3;
                      	if(fromMonth <= 0)
                      	{
								   fromMonth += 12;  //If month is less than 0 add 12 to get the proper month number;
                      	}

								 fromDay = toDay; // sets the fromDay to today

                      	// Y2K Fix
                      	if (myDate.getYear() <= 1000) toYear= myDate.getYear() + 1900;
                      		else  toYear= myDate.getYear();

                      	if (toMonth <= 3) fromYear = toYear - 1;
                      	else fromYear = toYear;

                      	document.shipform.FromPickupYear.value = fromYear;
                      	document.shipform.ToPickupYear.value = toYear;
								document.shipform.FromPickupMonth.value = fromMonth;
							   document.shipform.ToPickupMonth.value = toMonth;
                      	document.shipform.FromPickupDay.value = fromDay;
                      	document.shipform.ToPickupDay.value = toDay;
                      	document.shipform.AcceptUPSLicenseAgreement.value = "yes";
                      	document.shipform.TypeOfInquiryNumber.value = "R";
                      	document.shipform.ReferenceNumber.value = document.shipform.realnum.value;

                      	document.shipform.action = "http://wwwapps.ups.com/etracking/tracking.cgi";
                        document.shipform.account_number.value == "";

			return true;
		}
	}

	if (document.shipform.coortrack[1].checked == true)
	{
		if (document.shipform.shiptype[0].checked == true)
		{
			document.shipform.action = "http://www.fedex.com/Tracking?ascend_header=1&clienttype=dotcom&cntry_code=us&language=english&tracknumbers=" + document.shipform.realnum.value;
			return true;
		}
		else if (document.shipform.shiptype[1].checked == true)
		{
			document.shipform.action = "http://wwwapps.ups.com/etracking/tracking.cgi";
			document.shipform.AcceptUPSLicenseAgreement.value = "yes";
			document.shipform.TypeOfInquiryNumber.value = "T";
			document.shipform.trackNums.value = document.shipform.realnum.value;
			document.shipform.account_number.value == "";
			return true;
		}

	}
return false;
}