/*
 * Returns a boolean value indicating whether or not the textString parameter
 * is either the empty String or a String of empty spaces.
 */
function isBlank(textString) {
	returnValue = true;

	for(i = 0; i < textString.length; i++) {
		if (textString.charAt(i) != ' ') {
			returnValue = false;
			break;
		}
	}

	return returnValue;
}



<!-- Script to read cookie value -->
function getCookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function confirmTerms(form) {    
    var terms = "This website, towneair.com, is the private property of Towne Air Freight ('Towne'). ";
    terms = terms + "Towne authorizes the use of the shipment tools and the information gathered "; 
    terms = terms + "to registered users. The information obtained from towneair.com is provided for the "; 
    terms = terms + "personal use of current Towne customers and no other use. Providing or preparing this "; 
    terms = terms + "information for the benefit of a third party is strictly prohibited. Furthermore, "; 
    terms = terms + "you agree, that, in the absence of an agreement signed by a board-elected officer of Towne, ";  
    terms = terms + "the Towne Rules Tariff (available for download "; 
    terms = terms + "on this site) shall apply, govern, and limit Towne's liability for all freight movement tendered by or for you.";

    if(getCookie("termsCookie")!="")
    {
        return true;
    }
    else
    {
        if(confirm(terms))
        {
            document.cookie = "termsCookie=agree";
            return true;
        }
        else
        {
            return false;
        }
    }
}

<!--This script validates the Quick Track.-->
<!--
function validateQuickTrack(form)
{
        var number = form.number;

        if (number.value == '')
        {
            alert('You must enter a number to search for');
            number.focus();
            return false;
        }
}    
//-->

<!--This script validates the login information for the customer login.-->
<!--
function validateLogin(form)
{
        var customerField = form.customer;
        var passwordField = form.password;

        if (customerField.value == '')
        {
            alert('Please enter your login name.');
        customerField.focus();
            return false;
        }

        if (passwordField.value == '')
        {
                alert('Please enter your password.');
                passwordField.focus();
                return false;
        }

        if(confirmTerms(form))
        {
            return true;
        }
        else
        {
            return false;
        }
}    
//-->

<!-- validate dropbox form data -->
<!--
function validateDropbox(form) {
    
    if(form.email.value == '') {
    	alert('Please select the Port of Recovery');
    	form.email.focus();
    	return false;
    }
    
    if(form.payableTH.value != '') {
        if(form.amountTH.value == '') {
            alert('Please enter an amount for TERMINAL HANDLING');
            form.amountTH.focus();
            return false;
        }
        if(form.amountTH.value > 500) { 
            var greaterThan500 = confirm("A check request of over $500 requires authorization.  A representative will call you to verify authorization.");
            if(greaterThan500)
            	return true;
            else
            	return false;
        } 
        if(isNaN(form.amountTH.value)) {
            alert('Please enter an numeric amount for TERMINAL HANDLING');
            form.amountTH.focus();
            return false;
        }
        if(form.authTH.value == '') {
            alert('Please enter an authorization name for TERMINAL HANDLING');
            form.authTH.focus();
            return false;
        }
    }

    if(form.payableS.value != '') {
        if(form.amountS.value == '') {
            alert('Please enter an amount for STORAGE');
            form.amountS.focus();
            return false;
        }
        if(form.amountS.value > 500) {
            var greaterThan500 = confirm("A check request of over $500 requires authorization.  A representative will call you to verify authorization.");
            if(greaterThan500)
            	return true;
            else
            	return false;
        }
        if(isNaN(form.amountS.value)) {
            alert('Please enter an numeric amount for STORAGE');
            form.amountS.focus();
            return false;
        }
        if(form.authS.value == '') {
            alert('Please enter an authorization name for STORAGE');
            form.authS.focus();
            return false;
        }
    }

    if(form.payableO.value != '') {
        if(form.amountO.value == '') {
            alert('Please enter an amount for OTHER');
            form.amountO.focus();
            return false;
        }
        if(form.amountO.value > 500) {
            var greaterThan500 = confirm("A check request of over $500 requires authorization.  A representative will call you to verify authorization.");
            if(greaterThan500)
            	return true;
            else
            	return false;
        }
        if(isNaN(form.amountO.value)) {
            alert('Please enter an numeric amount for OTHER');
            form.amountO.focus();
            return false;
        }
        if(form.authO.value == '') {
            alert('Please enter an authorization name for OTHER');
            form.authO.focus();
            return false;
        }
        if(form.other.value == '') {
            alert('Please enter an explanation for OTHER');
            form.other.focus();
            return false;
        }
    }

	if(form.recovDate.value == '') {
		alert('Please enter a freight availability date.');
		form.recovDate.focus();
		return false;
	}
	
	if(form.recovTime.value == '') {
		alert('Please enter a freight availability time.');
		form.recovTime.focus();
		return false;
	}

    if(form.doc1.value == '') {
        alert('Please attach at least one document');
        form.doc1.focus();
        return false;
    }

    if(confirmDrop(form))
    {
        return true;
    }
    else
    {
        return false;
    }
}
//-->

<!--
function confirmDrop(form) {    
    var drop = "By submitting shipping documentation to Towne Air Freight (Towne), you hereby authorize ";
    drop = drop + "Towne to endorse your documentation as 'ORIGINAL' to effect recovery of cargo."; 
   
    if(confirm(drop))
    {
        return true;
    }
    else
    {
        return false;
    }
}
//-->

<!--
function validatePasswordRequest(form)
{
    var co_nameField = form.co_name;
    var first_nameField = form.first_name;
    var last_nameField = form.last_name;
    var co_addrField = form.co_addr;
    var co_cityField = form.co_city;
    var co_stateField = form.co_state;
    var co_zipField = form.co_zip;
    var txtphoneField = form.txtphone;
    var emailField = form.email;
    var passwordField = form.password;
    var password1Field = form.password1;
    var email1Field = form.email1;
    var acctField = form.acct;

    if (co_nameField.value == '')
    {
        alert('Please enter a company name.');
        co_nameField.focus();
        return false;
    }

    if (first_nameField.value == '')
    {
        alert('Please enter your first name.');
        first_nameField.focus();
        return false;
    }

    if (last_nameField.value == '')
    {
        alert('Please enter your last name.');
        last_nameField.focus();
        return false;
    }

    if (co_addrField.value == '')
    {
        alert('Please enter a street address.');
        co_addrField.focus();
        return false;
    }

    if (co_cityField.value == '')
    {
        alert('Please enter a city.');
        co_cityField.focus();
        return false;
    }

    if (co_stateField.value == '')
    {
        alert('Please enter a state.');
        co_stateField.focus();
        return false;
    }

    if (co_zipField.value == '')
    {
        alert('Please enter a zip code.');
        co_zipField.focus();
        return false;
    }

    if (txtphoneField.value == '')
    {
        alert('Please enter a phone number.');
        txtphoneField.focus();
        return false;
    }

    if (emailField.value == '')
    {
        alert('Please enter an e-mail address.');
        emailField.focus();
        return false;
    }

    if (email1Field.value == '')
    {
        alert('Please enter the login name that you would like.');
        email1Field.focus();
        return false;
    }

    if (passwordField.value == '')
    {
        alert('Please enter a password.');
        passwordField.focus();
        return false;
    }

    if (password1Field.value == '')
    {
        alert('Please re-enter your password.');
        password1Field.focus();
        return false;
    }

    if (passwordField.value != password1Field.value)
    {
        alert('The two passwords you entered did not match.  Please enter your password again.');
        passwordField.focus();
        return false
    }

    if (email1Field.value == passwordField.value)
    {
        alert ('For security reasons, your Login Name and Password cannot be the same.  Please enter a different password.');
        passwordField.focus();
        return false
    }

    if (passwordField.value == 'PASSWORD')
    {
        alert ('For security reasons, your password cannot be PASSWORD.  Please enter a different password.');
        passwordField.focus();
        return false
    }

    if (acctField.value == '')
    {
        alert('Your Towne Air Freight Account number is required.  You can obtain your account number from your last billing statement or by contacting our customer service department at (574) 233-3183.');
        acctField.focus();
        return false;
    }

    if (acctField.value.length >7 || acctField.value.length <7)
    {
        alert ('Your Towne Air Freight account number must be 7 digits in length. If you do not know your account number, you can obtain it from your last billing statement or by contacting our customer service department at (574) 233-3183.');
        acctField.focus();
        return false
    }

    if (isNaN(acctField.value))
    {
        alert('Your Towne Air Freight account number cannot contain letters.  If you do not know your account number, you can obtain it from your last billing statement or by contacting our customer service department at (574) 233-3183.');
        acctField.focus();
        return false;
    }

    form.submitBtn.disabled = true;
}
//-->

<!--
    function dsp(loc){
       if(document.getElementById){
          var foc=loc.firstChild;
          foc=loc.firstChild.innerHTML?
             loc.firstChild:
             loc.firstChild.nextSibling;
          foc.innerHTML=foc.innerHTML=='+'?'-':'+';
          foc=loc.parentNode.nextSibling.style?
             loc.parentNode.nextSibling:
             loc.parentNode.nextSibling.nextSibling;
          foc.style.display=foc.style.display=='block'?'none':'block';}}  

    if(!document.getElementById)
       document.write('<style type="text/css"><!--\n'+
          '.dspcont{display:block;}\n'+
          '//--></style>');
    //-->

<!--
function validateContact(form)
{
    var emailField = form.email;

    if(emailField.value == '.')
    {
        alert('Please enter an e-mail address.  If you do not wish to provide this information, enter "None."');
        emailField.focus();
        return false;
    }

    form.submitBtn.disabled = true;
}
//-->

<!--
function showSelect()
{
    if(document.getElementById('select'))
    {
        document.getElementById('select').style.visibility = "visible";
    }

    if(document.getElementById('select2'))
    {
        document.getElementById('select2').style.visibility = "visible";
    }

    if(document.getElementById('select3'))
    {
        document.getElementById('select3').style.visibility = "visible";
    }

    if(document.getElementById('select4'))
    {
        document.getElementById('select4').style.visibility = "visible";
    }

    if(document.getElementById('select5'))
    {
        document.getElementById('select5').style.visibility = "visible";
    }
}

function hideSelect()
{
    if(document.getElementById('select'))
    {
        document.getElementById('select').style.visibility = "hidden";
    }

    if(document.getElementById('select2'))
    {
        document.getElementById('select2').style.visibility = "hidden";
    }

    if(document.getElementById('select3'))
    {
        document.getElementById('select3').style.visibility = "hidden";
    }

    if(document.getElementById('select4'))
    {
        document.getElementById('select4').style.visibility = "hidden";
    }

    if(document.getElementById('select5'))
    {
        document.getElementById('select5').style.visibility = "hidden";
    }

}
//-->

<!--
function validateAccount(form)
{
    var nameField = form.name;
    var titleField = form.title;
    var phoneField = form.phone;
    var emailField = form.email;

    if (nameField.value == '') 
    {
        alert('Please enter your name.');
        nameField.focus();
        return false;
    }

   if (titleField.value == '') 
   {
       alert('Please enter your title.');
       titleField.focus();
       return false;
    }

    if (phoneField.value == '') 
    {
        alert('Please enter your phone number.');
        phoneField.focus();
        return false;
    }

    if (emailField.value == '') 
    {
        alert('Please enter your email address.');
        emailField.focus();
        return false;
    }
}
//-->

<!--
function displayStatements(agingBean) 
{
    document.forms["acctInfo"].agingBean.value = agingBean;
    newwin=window.open(document.forms["acctInfo"].action, "Statements", 'left=25,top=25,width=600,height=300,toolbar=0,resizable=0,scrollbars=1'); 
    newwin.focus();
    document.forms["acctInfo"].submit();
} // end displayStatements
//-->

<!--
function displayStatementDetail(statementBean) 
{
    document.forms["onlinestmt"].statementBean.value = statementBean;
    newwin=window.open(document.forms["onlinestmt"].action, "StatementDetail", 'left=25,top=25,width=600,height=300,toolbar=0,resizable=0,scrollbars=1'); 
    newwin.focus();
    document.forms["onlinestmt"].submit();
} // end displayDetail
//-->

<!--
function PopUp(url) 
{
    window.open(url,"MyPopup",'height=200,width=500');
} 
//-->

<!--
function displayProDetail(statementBean) 
{
    document.forms["stmtDetail"].statementBean.value = statementBean;
    document.forms["stmtDetail"].submit();
} // end displayDetail
//-->

<!--
function popup(mylink, windowname)
{
    if (! window.focus)return true;
        var href;
    if (typeof(mylink) == 'string')
       href=mylink;
    else
       href=mylink.href;
    window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
    return false;
}
//-->

<!--
function displayDetail(trackingBean)
{
        //document.forms["proDetail"].statementBean.value = statementBean;
	document.forms["proDetail"].trackingBean.value = trackingBean;
        newwin=window.open(document.forms["proDetail"].action, "ShipmentDetail", 'left=25,top=325,width=600,height=375,toolbar=0,resizable=0,scrollbars=1'); 
        newwin.focus();
	document.forms["proDetail"].submit();
} // end displayDetail
//-->

<!--
function goToReferencesPage(proNumber) 
{
    var url = "references.jsp?proNumber=" + proNumber;
    window.open(url, null,"left=280,top=405,height=200,width=300,toolbar=no,menubar=no,location=no,scrollbars=1");
} // end function
//-->

<!--
function goToLabelPrint() 
{
    var url = "booking.do?action=printLabels";
    window.open(url, null,"left=280,top=405,height=155,width=300,toolbar=no,menubar=no,location=no");
} // end function
//-->

<!--
/*
 * Sets the action input in the form to the value of the parameter.
 */
function setAction(actionValue) {
    var frm = document.forms["pickupForm"];

    frm.action.value = actionValue;
}
//-->
