﻿// JScript File
function ShowUnit()
{
	// declare local variables
	var oMessageDiv = document.getElementById("divMessage");
	var oTextBox = document.getElementById("txtTrackingInput");
	
	//alert(document.Index.divMessage.innerHTML);
	// Initialize the Error Text
	oMessageDiv.innerText = "";
	// Hide the Div
	oMessageDiv.style.display = "none";
	
	// Ensure a value is entered
	if (oTextBox.value == "")
	{
		// Set the Message Text
		oMessageDiv.innerText = "Please enter the VIN or Container Number."
		// Show the Div
		oMessageDiv.style.display = "";
		// Set the focus to the text box
		oTextBox.focus();
		// Return control to the form
		return;
	}
	
	// Build the URL
	var sURL = "/track-trace/index.aspx?track=" + oTextBox.value.toUpperCase();
	
    // Navigate to the Track an Trace page
    window.location.href = sURL;
}
