var sWebsite = "http://www.ameri-canlogistics.com/"
function setOptionsFrom(chosen,makeit) {
 
makeit.options.length = 0;

if (chosen == " ") {
	makeit.options[selbox.options.length] = new Option('Please Select',' ');
}
if (chosen == "Canada") {
	makeit.options[makeit.options.length] = new Option('Alberta','Alberta');
	makeit.options[makeit.options.length] = new Option('British Columbia','British Columbia');
	makeit.options[makeit.options.length] = new Option('Manitoba','Manitoba');
	makeit.options[makeit.options.length] = new Option('New Brunswick','New Brunswick');
	makeit.options[makeit.options.length] = new Option('Newfoundland','Newfoundland');
	makeit.options[makeit.options.length] = new Option('North West Territory','N.W. Territory');
	makeit.options[makeit.options.length] = new Option('Nunavut','Nunavut');
	makeit.options[makeit.options.length] = new Option('Nova Scotia','Nova Scotia');
	makeit.options[makeit.options.length] = new Option('Ontario','Ontario');
	makeit.options[makeit.options.length] = new Option('P.E.I.','P.E.I.');
	makeit.options[makeit.options.length] = new Option('Quebec','Quebec');
	makeit.options[makeit.options.length] = new Option('Saskatchewan','Saskatchewan');
	makeit.options[makeit.options.length] = new Option('Yukon Territory','Yukon Territory');
}
if (chosen == "USA") {
	makeit.options[makeit.options.length] = new Option('Alabama','Alabama');
	makeit.options[makeit.options.length] = new Option('Alaska','Alaska');
	makeit.options[makeit.options.length] = new Option('Arizona','Arizona');
	makeit.options[makeit.options.length] = new Option('Arkansas','Arkansas');
	makeit.options[makeit.options.length] = new Option('California','California');
	makeit.options[makeit.options.length] = new Option('Colorado','Colorado');
	makeit.options[makeit.options.length] = new Option('Connecticut','Connecticut');
	makeit.options[makeit.options.length] = new Option('Delaware','Delaware');
	makeit.options[makeit.options.length] = new Option('Florida','Florida');
	makeit.options[makeit.options.length] = new Option('Georgia','Georgia');
	makeit.options[makeit.options.length] = new Option('Hawaii','Hawaii');
	makeit.options[makeit.options.length] = new Option('Idaho','Idaho');
	makeit.options[makeit.options.length] = new Option('Illinois','Illinois');
	makeit.options[makeit.options.length] = new Option('Indiana','Indiana');
	makeit.options[makeit.options.length] = new Option('Iowa','Iowa');
	makeit.options[makeit.options.length] = new Option('Kansas','Kansas');
	makeit.options[makeit.options.length] = new Option('Kentucky','Kentucky');
	makeit.options[makeit.options.length] = new Option('Louisiana','Louisiana');
	makeit.options[makeit.options.length] = new Option('Maine','Maine');
	makeit.options[makeit.options.length] = new Option('Maryland','Maryland');
	makeit.options[makeit.options.length] = new Option('Massachusetts','Massachusetts');
	makeit.options[makeit.options.length] = new Option('Michigan','Michigan');
	makeit.options[makeit.options.length] = new Option('Minnesota','Minnesota');
	makeit.options[makeit.options.length] = new Option('Mississippi','Mississippi');
	makeit.options[makeit.options.length] = new Option('Missouri','Missouri');
	makeit.options[makeit.options.length] = new Option('Montana','Montana');
	makeit.options[makeit.options.length] = new Option('Nebraska','Nebraska');
	makeit.options[makeit.options.length] = new Option('Nevada','Nevada');
	makeit.options[makeit.options.length] = new Option('New Hampshire','New Hampshire');
	makeit.options[makeit.options.length] = new Option('New Jersey','New Jersey');
	makeit.options[makeit.options.length] = new Option('New Mexico','New Mexico');
	makeit.options[makeit.options.length] = new Option('New York','New York');
	makeit.options[makeit.options.length] = new Option('North Carolina','North Carolina');
	makeit.options[makeit.options.length] = new Option('North Dakota','North Dakota');
	makeit.options[makeit.options.length] = new Option('North Mariana Islands','N.M. Islands');
	makeit.options[makeit.options.length] = new Option('Ohio','Ohio');
	makeit.options[makeit.options.length] = new Option('Oklahoma','Oklahoma');
	makeit.options[makeit.options.length] = new Option('Oregon','Oregon');
	makeit.options[makeit.options.length] = new Option('Pennsylvania','Pennsylvania');
	makeit.options[makeit.options.length] = new Option('Puerto Rico','Puerto Rico');
	makeit.options[makeit.options.length] = new Option('Rhode Island','Rhode Island');
	makeit.options[makeit.options.length] = new Option('South Carolina','South Carolina');
	makeit.options[makeit.options.length] = new Option('South Dakota','South Dakota');
	makeit.options[makeit.options.length] = new Option('Tennessee','Tennessee');
	makeit.options[makeit.options.length] = new Option('Texas','Texas');
	makeit.options[makeit.options.length] = new Option('US Virgin Islands','Virgin Islands');
	makeit.options[makeit.options.length] = new Option('Utah','Utah');
	makeit.options[makeit.options.length] = new Option('Vermont','Vermont');
	makeit.options[makeit.options.length] = new Option('Virginia','Virginia');
	makeit.options[makeit.options.length] = new Option('Washington (State)','Washington');
	makeit.options[makeit.options.length] = new Option('Washington,DC','Washington, DC');
	makeit.options[makeit.options.length] = new Option('West Virginia','West Virginia');
	makeit.options[makeit.options.length] = new Option('Wisconsin','Wisconsin');
	makeit.options[makeit.options.length] = new Option('Wyoming','Wyoming');
}
if (chosen == "Mexico") {
	makeit.options[makeit.options.length] = new Option('Aguascalientes','Aguascalientes');
	makeit.options[makeit.options.length] = new Option('Baja California','Baja California');
	makeit.options[makeit.options.length] = new Option('Baja California Sur','Baja California Sur');
	makeit.options[makeit.options.length] = new Option('Campeche','Campeche');
	makeit.options[makeit.options.length] = new Option('Chiapas','Chiapas');
	makeit.options[makeit.options.length] = new Option('Chihuahua','Chihuahua');
	makeit.options[makeit.options.length] = new Option('Coahuila','Coahuila');
	makeit.options[makeit.options.length] = new Option('Colima','Colima');
	makeit.options[makeit.options.length] = new Option('Distrito Federal','Distrito Federal');
	makeit.options[makeit.options.length] = new Option('Durango','Durango');
	makeit.options[makeit.options.length] = new Option('Guerrero','Guerrero');
	makeit.options[makeit.options.length] = new Option('Guanajuato','Guanajuato');
	makeit.options[makeit.options.length] = new Option('Hidalgo','Hidalgo');
	makeit.options[makeit.options.length] = new Option('Jalisco','Jalisco');
	makeit.options[makeit.options.length] = new Option('México','México');
	makeit.options[makeit.options.length] = new Option('Michoacán','Michoacán');
	makeit.options[makeit.options.length] = new Option('Morelos','Morelos');
	makeit.options[makeit.options.length] = new Option('Nayarit','Nayarit');
	makeit.options[makeit.options.length] = new Option('Nuevo León','Nuevo León');
	makeit.options[makeit.options.length] = new Option('Oaxaca','Oaxaca');
	makeit.options[makeit.options.length] = new Option('Puebla','Puebla');
	makeit.options[makeit.options.length] = new Option('Querétaro','Querétaro');
	makeit.options[makeit.options.length] = new Option('Quintana Roo','Quintana Roo');
	makeit.options[makeit.options.length] = new Option('Sinaloa','Sinaloa');
	makeit.options[makeit.options.length] = new Option('San Luis Potosí','San Luis Potosí');
	makeit.options[makeit.options.length] = new Option('Sonora','Sonora');
	makeit.options[makeit.options.length] = new Option('Tabasco','Tabasco');
	makeit.options[makeit.options.length] = new Option('Tamaulipas','Tamaulipas');
	makeit.options[makeit.options.length] = new Option('Tlaxcala','Tlaxcala');
	makeit.options[makeit.options.length] = new Option('Veracruz','Veracruz');
	makeit.options[makeit.options.length] = new Option('Yucatán','Yucatán');
	makeit.options[makeit.options.length] = new Option('Zacatecas','Zacatecas');
}
}


var loaded = 0;
function PreLoad() {

var URL
URL="http://www.ameri-canlogistics.com/"

if (document.images != null) {

clickme1 = new Image();
clickme1.src = URL + "images/menu/about.gif";
clickme1o = new Image();
clickme1o.src = URL + "images/menu/about-over.gif";

clickme2 = new Image();
clickme2.src = URL + "images/menu/services.gif";
clickme2o = new Image();
clickme2o.src = URL + "images/menu/services-over.gif";
clickme3 = new Image();
clickme3.src = URL + "images/menu/customers.gif";
clickme3o = new Image();
clickme3o.src = URL + "images/menu/customers-over.gif";

//clickme2 = new Image();
//clickme2.src = URL + "images/menu/track-shipping.gif";
//clickme2o = new Image();
//clickme2o.src = URL + "images/menu/track-shipping-over.gif";
//clickme3 = new Image();
//clickme3.src = URL + "images/menu/quote-freight.gif";
//clickme3o = new Image();
//clickme3o.src = URL + "images/menu/quote-freight-over.gif";

clickme4 = new Image();
clickme4.src = URL + "images/menu/contact.gif";
clickme4o = new Image();
clickme4o.src = URL + "images/menu/contact-over.gif";
clickme5 = new Image();
clickme5.src = URL + "images/menu/home.gif";
clickme5o = new Image();
clickme5o.src = URL + "images/menu/home-over.gif";

clickme6 = new Image();
clickme6.src = URL + "images/team.jpg";
clickme6o = new Image();
clickme6o.src = URL + "images/team-over.jpg";
clickme7 = new Image();
clickme7.src = URL + "images/deliveries.jpg";
clickme7o = new Image();
clickme7o.src = URL + "images/deliveries-over.jpg";
clickme8 = new Image();
clickme8.src = URL + "images/rate-request.jpg";
clickme8o = new Image();
clickme8o.src = URL + "images/rate-request-over.jpg";

}

	loaded = 1;
}

function hiLite(imgDocID,imgObjName) {
if (document.images !=null) {
  if (loaded)
   document.images[imgDocID].src = eval(imgObjName + ".src")
  }
}

function popup(winName,URL,height,width) {
 var popup = window.open(URL,winName,"height=" + height + ",width=" + width + ",left=50,top=25,status=0,scrollbars=1,toolbar=0,directories=0,menubar=0,location=0");
 NewWindow = popup;
 NewWindow.focus();
}

    //Define global variables

	    var timerID = null;
		var timerOn = false;
		var timecount = 100;
		var what = null;
		var newbrowser = true;
		var check = false;

    	function init(){
    	//  alert ("Running Init");
          if (document.layers) {
                      //  alert ("Running Netscape 4");
                        layerRef="document.layers";
                        styleSwitch="";
                        visibleVar="show";
			screenSize = window.innerWidth;
			what ="ns4";


          }else if(document.all){
                      //  alert ("Running IE");
                        layerRef="document.all";
                        styleSwitch=".style";
                        visibleVar="visible";
			screenSize = document.body.clientWidth + 18;
			what ="ie";

		  }else if(document.getElementById){
                      //  alert ("Running Netscape 6");
                        layerRef="document.getElementByID";
                        styleSwitch=".style";
                        visibleVar="visible";
			what="moz";
		  
		  }else{
		  	//alert("Older than 4.0 browser.");
			what="none";
			newbrowser = false;
		  }
		  
 
		//window.status='status bar text to go here';
		check = true;
  	 	}


	// Turns the layers on and off
        function showLayer(layerName){
        	if(check){
        		if (what =="none"){
        			return;
        			}
	        	else if (what == "moz"){
        			document.getElementById(layerName).style.visibility="visible";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
                  }
		 }
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
		}

        function hideLayer(layerName){
        	if(check){
        		if (what =="none"){
        			return;
        			}
        		else if (what == "moz"){
        			document.getElementById(layerName).style.visibility="hidden";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
				}
        
        	}
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
        }


function hideAll(){
	hideLayer('drp');
	hideLayer('drpservices');
	hideLayer('drpcust');
	hideLayer('drpcontact');
}


function startTime() {
	if (timerOn == false) {
    timerID=setTimeout( "hideAll()" , timecount);
    timerOn = true;
}
}

function stopTime() {
	if (timerOn) {
     clearTimeout(timerID);
     timerID = null;
     timerOn = false;
}
}

function onLoad(){
init();
}

function doLogin()
{

  if (document.Form2.Username.value == "")
  {
    alert("Please enter a value for the \"Username\" field.");
    document.Form2.Username.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;&#352;&#338;&#381;&#353;&#339;&#382;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = document.Form2.Username.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter and digit characters in the \"Username\" field.");
    document.Form2.Username.focus();
    return (false);
  }

  if (document.Form2.Password.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    document.Form2.Password.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;&#352;&#338;&#381;&#353;&#339;&#382;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = document.Form2.Password.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter and digit characters in the \"Password\" field.");
    document.Form2.Password.focus();
    return (false);
  }
  document.location.href= sWebsite + "shipment/verifyAdmin.asp?username=" + document.Form2.Username.value + "&password=" + document.Form2.Password.value;
  return (false);

}
