   var locationArray = new Array("Samaria", "Howe");
   var customerArray = new Array("Select Customer", "Ballreich","Bettermade","E.K. Bare","Snack Alliance","Wise","Chief Wabasis","Schmieding","Masser","Potato Services","Bouwkamp","Farmers Exchange","MBT Produce", "Mrs. Dennis", "Eugene Bernath", "Fresh Solution Farms","4-D Farms");
   
 
   var destinationArray = new Array(customerArray.length);
   destinationArray[1]  = new Array("Tiffin");
   destinationArray[2]  = new Array("Detroit");
   destinationArray[3]  = new Array("Bird-in-Hand");
   destinationArray[4]  = new Array("Bristol");
   destinationArray[5]  = new Array("Berwick");
   destinationArray[6]  = new Array("McBride","Berlin","Snack Alliance","E.K. Bare","Old York","Uncle Rays","Utz");
   destinationArray[7]  = new Array("Springdale","Allens"); 
   destinationArray[8]  = new Array("Sacramento","York","Hanover"); 
   destinationArray[9]  = new Array("Campbell's","Conn's","E.K. Bare","Grippo","Hurst","Uncle Ray's","Mike Sells","Sandridge","Shearer's","Utz","Frito-Binghamton","Frito-Brewster","Frito-Charlotte","Frito-Dayville","Frito-Frankfort","Frito-Kirkwood","Frito-Lynchburg","Frito-Wooster","Frito-York","Mrs. Dennis","Al Johnson","Great Lake Packers","Old York","Penn Co.","Reser's Fine Food");
   destinationArray[10] = new Array("Grant");
   destinationArray[11] = new Array("Snack Alliance","Wise"); 
   destinationArray[12] = new Array("Jacksonville");
   destinationArray[13] = new Array("");
   destinationArray[14] = new Array(""); 
   destinationArray[15] = new Array("White Pigeon");
   destinationArray[16] = new Array("Frey Produce");
  
   streetArray     = new Array(customerArray.length);
   streetArray[1]  = new Array("186 Ohio Ave.");
   streetArray[2]  = new Array("10148 Gratiot Ave.");
   streetArray[3]  = new Array("P.O. Box 409");
   streetArray[4]  = new Array("225 Commonwealth Ave.");
   streetArray[5]  = new Array("228 Raseley St.");
   streetArray[6]  = new Array("2028 Central St.","1313 Stadium Dr.","225 Commonwealth Ave.","P.O. Box 409","","14245 Birwood","900 High St.");
   streetArray[7]  = new Array("P.O. Box 369","");
   streetArray[8]  = new Array("2 Fearnot Rd.","P.O. Box 2427","900 High St.");
   streetArray[9]  = new Array("E. Maumee St.","1805 Kemper Ct.","P.O. Box 409","6750 Colerain Ave.","22 Route 97","14245 Birwood","333 Leo St.","133 Commerce Dr.","692 Wabash Rd, N","900 High St.","","","","","","","","","","","","","","","");
   streetArray[10] = new Array("2530 E. 136th St.");
   streetArray[11] = new Array("225 Commonwealth Ave.", "228 Raseley St.");
   streetArray[12] = new Array("P.O. Box 600277");    
   streetArray[13] = new Array("");    
   streetArray[14] = new Array("");
   streetArray[15] = new Array("70255 Blue School Rd.");    
   streetArray[16] = new Array("");
 
   cityArray     = new Array(customerArray.length);
   cityArray[1]  = new Array("Tiffin");
   cityArray[2]  = new Array("Detroit");
   cityArray[3]  = new Array("Bird-in-Hand");
   cityArray[4]  = new Array("Bristol");
   cityArray[5]  = new Array("Berwick");
   cityArray[6]  = new Array("McBride","Berlin","Bristol","Bird-in-Hand","","Detroit","Hanover");
   cityArray[7]  = new Array("Springdale","");
   cityArray[8]  = new Array("Sacramento","York","Hanover");
   cityArray[9]  = new Array("Napoleon","Zanesville","Bird-in-Hand","Cincinnati","Waterford","Detroit","Dayton","Medina","Brewster","Hanover","","","","","","","","","","","","","","");
   cityArray[10] = new Array("Grant");
   cityArray[11] = new Array("Bristol", "Berwick");
   cityArray[12] = new Array("Jacksonville");   
   cityArray[13] = new Array("");  
   cityArray[14] = new Array(""); 
   cityArray[15] = new Array("White Pigeon");  
   cityArray[16] = new Array("Keenes");
 
   stateArray     = new Array(customerArray.length);
   stateArray[1]  = new Array("OH");
   stateArray[2]  = new Array("MI");
   stateArray[3]  = new Array("PA");
   stateArray[4]  = new Array("VA");
   stateArray[5]  = new Array("PA");
   stateArray[6]  = new Array("MI","PA","VA","PA","","MI","PA");
   stateArray[7]  = new Array("AR","");
   stateArray[8]  = new Array("PA","PA","PA");
   stateArray[9]  = new Array("OH","OH","PA","OH","PA","MI","OH","OH","OH","PA","","","","","","","","","","","","","","");
   stateArray[10] = new Array("MI");
   stateArray[11] = new Array("VA", "PA");
   stateArray[12] = new Array("FL");
   stateArray[13] = new Array("");
   stateArray[14] = new Array("");
   stateArray[15] = new Array("MI");
   stateArray[16] = new Array("IL");
   
   var truckCoArray = new Array("Select Company", "Lennard Ag Co", "Sunnyhill","McDade","Scott","Masser","Peasley","Dutch Country","Drew","Hastings","L&M","CH Robinson","Lupp","Stahl","Tidey", "FEI", "J+J Lennard","Total Transportation","Stowe","West Trucking","MCT","Dale Hey","Gary Edward","Jeff Young","Solunski");
 
   var varietyArray = new Array("Select Variety", "Atlantic","67","79","33","Snowden","Mega Chip","Silverton","Eva", "Canala","Kalkaska","Sel 8","Std","Reba", "MSU");
 
   var binArray     = new Array("Select Bin", "Bin 1","Bin 2","Bin 3","Bin 4","Bin 5","Bin 6","Bin 7","Bin 8","Bin 9", 
                                "Bin 10","Bin 11","Bin 12","Bin 14","Bin 15","Bin 21","Bin 22","Bin 23","Bin 24",
                                "Bin 31","Bin 31A","Bin 32","Bin 33","Bin 33A","Bin 34","Bin 35","Bin 36","Bin 37",
                                "Bin 38","Bin 39","Bin 40","Bin 41","Bin 42","Bin 43","Bin 44","Out of Field","Other"); 
 
   var fieldArray = new Array("Select Field", "L74-16-2","L74-22-6", "L74-34-2", "L74-15-4", "L74-27-5", "L74-27-6", "L75-20-6", "M77-19-8", "M77-30-1", "S810-16-3", "S810-9-9", "S810-7-4", "S810-5-2", "S810-5-8", "S810-18-5", "S59-14-2", "S59-15-3", "S79-9-6", "S79-9-9", "S79-10-5", "S69-33-7", "B68-29-1", "B68-29-5", "B68-11-7", "B78-1-6", "S89-2-3", "B77-31-3", "B77-17-2", "B77-21-8");
  
   var today = new Date();
   var yy = today.getYear();
   var thisyear = (yy < 1000) ? yy + 1900 : yy;
   var nextyear = thisyear + 1;
   
   function postError(arg){
      alert(arg);
      return false;
   }

   function checkboxChanged(){
     if (document.poForm.override.checked) {
        document.poForm.invoice.disabled=0;
     } else {
        document.poForm.invoice.disabled=1;
     }

     calcInvoice();
   }
  
   function IsNumeric(arg){
      var ValidChars = "0123456789";
      var IsNumber=true;
      var decimalFound=false;
   
      for (i = 0; i < arg.length && IsNumber == true; i++)
         if (arg.charAt(i) == '.' && !decimalFound){
            decimalFound = true;
         } else if (ValidChars.indexOf(arg.charAt(i)) == -1) 
            IsNumber = false;
   
      return IsNumber;
    } 
  
   function removeCommas(arg){
      var temp = new Array();
      var retVal = "";
 
      temp = arg.split(',');
   
      for(i=0;i<temp.length;i++)
          retVal = retVal + temp[i];
   
      return retVal;
   }
  
   function validNumber(arg){
      var temp = new Array();
 
      temp = arg.split(',');
   
      for(i=1; i < temp.length; i++)
         if(temp[i].length != 3 && temp[i].charAt(3) != '.')
            return false;
   
      return IsNumeric(removeCommas(arg)) && arg.charAt(arg.length-1) != '.';
   }
  
   function lennardLBSchanged(){
      if (!validNumber(document.poForm.lennardLBS.value))
         document.poForm.lennardLBS.value="";
   }
  
   function customerLBSchanged(){     
      if (!validNumber(document.poForm.customerLBS.value))
         document.poForm.customerLBS.value="";
   }
 
   function submitted(){
      var custBox = document.poForm.customerSelect;
      var destBox = document.poForm.destinationSelect;
   
      if (document.poForm.ponum.value == "" || document.poForm.ponum.value == "Enter the PO Number")
         return postError("Please Enter a PO Number");
   
      if (document.poForm.ponum.value == "PO Number Already Used")
         return postError("PO Number Already Used.");

      if (document.poForm.ponum.value.indexOf('#') != -1 || document.poForm.ponum.value.indexOf('&') != -1)
	 return postError("PO Number cannot contain '#' or '&'");
   
      if (custBox.selectedIndex == 0)
         return postError("Please Select a Customer");
   
      if (custBox.options[custBox.selectedIndex].value == 99 && 
         (document.poForm.customer.value == "" || document.poForm.customer.value == "Enter Customer Here"))        
 
         return postError("Please Manually Enter a Customer");
   
      if (destBox.options[destBox.selectedIndex].value == 99 && 
         (document.poForm.destination.value == "" || document.poForm.destination.value == "Destination - Address"))
 
         return postError("Please Manually Enter a Destination");
   
      if (!validDate(document.poForm.loadYear.value,document.poForm.loadMonthSelect.selectedIndex,document.poForm.loadDay.value))
         return postError("Load Date is Invalid");
   
      if (!validDate(document.poForm.deliveryYear.value,document.poForm.deliveryMonthSelect.selectedIndex,document.poForm.deliveryDay.value))
         return postError("Delivery Date is Invalid");

      for(var i = 0; i < document.poForm.contractType.length; i++) {

        var contractChecked = document.poForm.contractType[i].checked;
  
        if (contractChecked){
          break;     
        }
      }

      if (!contractChecked)
        return postError("Please Check Contact or Open");
 
      disableFields(0);
 
      document.poForm.customer.disabled=0;
      document.poForm.destination.disabled=0;
      document.poForm.truckCo.disabled=0;
      document.poForm.invoice.disabled=0;
      document.poForm.lennardLBS.value  = removeCommas(document.poForm.lennardLBS.value);
      document.poForm.customerLBS.value = removeCommas(document.poForm.customerLBS.value);
 
      return true;
   }
  
   function customerChange() {
      var selectBox = document.poForm.customerSelect;

      document.poForm.customer.value = "";
      document.poForm.destination.value = "";
      document.forms['poForm'].destinationSelect.options.length = 0;

      if (selectBox.selectedIndex > 0 && selectBox.selectedIndex < customerArray.length){
         for (i=0; i<destinationArray[selectBox.selectedIndex].length; i++)
            document.forms['poForm'].destinationSelect.options[i] = new Option(destinationArray[selectBox.selectedIndex][i],i);
 
         document.forms['poForm'].destinationSelect.options[destinationArray[selectBox.selectedIndex].length] = new Option("Other", '99');
         document.poForm.customer.disabled=1;
         document.poForm.destination.disabled=1;
 
         var cust = document.poForm.customerSelect.options[document.poForm.customerSelect.selectedIndex].value;
         var dest = document.poForm.destinationSelect.options[document.poForm.destinationSelect.selectedIndex].value; 

         if (dest != 99 && streetArray[cust][dest] !=""){
            document.poForm.destination.value = streetArray[cust][dest] + " " + cityArray[cust][dest] + ", " + stateArray[cust][dest]; 
         }
  
      } else if (selectBox.options[selectBox.selectedIndex].value == 99){
 
         document.forms['poForm'].destinationSelect.options[0] = new Option("Manually Enter",'99');
         document.poForm.customer.value = "Enter Customer Here";
         document.poForm.destination.value = "Destination - Address";
         document.poForm.customer.disabled=0;
         document.poForm.destination.disabled=0;
      }
   }
  
   function destinationChange() {
      document.poForm.destination.value = "";
  
      if (document.poForm.destinationSelect.options[document.poForm.destinationSelect.selectedIndex].value == 99){
         document.poForm.destination.value = "Destination - Address";
         document.poForm.destination.disabled=0;
 
      } else {
         document.poForm.destination.disabled=1;       
 
         var cust = document.poForm.customerSelect.options[document.poForm.customerSelect.selectedIndex].value; 
         var dest = document.poForm.destinationSelect.options[document.poForm.destinationSelect.selectedIndex].value;
  
         if (cust != 99 && dest != 99 && streetArray[cust][dest] !="")
           document.poForm.destination.value = streetArray[cust][dest] + " " + cityArray[cust][dest] + ", " + stateArray[cust][dest];
      }
 
   }
  
   function binChange() {
  
      if (document.poForm.binSelect.options[document.poForm.binSelect.selectedIndex].value == 35){

         for (i=0;i<fieldArray.length;i++)
            document.forms['poForm'].fieldSelect.options[i] = new Option(fieldArray[i],i);
      
         document.poForm.fieldSelect.disabled=0;
 
      } else {
         document.poForm.fieldSelect.disabled=1;
         document.forms['poForm'].fieldSelect.options[0] = new Option("",0);
         document.poForm.fieldSelect.selectedIndex=0;
      }
 
   }
  
   function varietyChange() {

      calcInvoice();

      document.poForm.variety.value = "";
  
      if (document.poForm.varietySelect.options[document.poForm.varietySelect.selectedIndex].value == 99){
         document.poForm.variety.disabled=0;
 
      } else {
         document.poForm.variety.disabled=1; 
      }
 
   }
  
   function locationChange() {

      calcInvoice();

      binChange();
 
   }

  
   function truckCoChange() { 
      var selectBox = document.poForm.truckCoSelect;
  
      if (selectBox.options[selectBox.selectedIndex].value == 99){
         document.poForm.truckCo.value = "Enter Company & Address Here"; 
         document.poForm.truckCo.disabled=0;
 
      } else {
         document.poForm.truckCo.value = "";
         document.poForm.truckCo.disabled=1;
      }
 
   }
  
   function seal1Changed() {
      var x = document.poForm.sealNum1.value;
      x++; 
      document.poForm.sealNum2.value = x; 
   }
  
   function clicked(arg){
 
      if (arg == "0") { 
         if (document.poForm.ponum.value == "Enter the PO Number" || document.poForm.ponum.value == "PO Number Already Used") 
            document.poForm.ponum.value = "";
 
      } else if (arg == "1") { 
         if (document.poForm.customer.value == "Enter Customer Here")
            document.poForm.customer.value = "";
 
      } else if (arg == "2") {
         if (document.poForm.destination.value == "Destination - Address")
            document.poForm.destination.value = "";
 
      } else if (arg == "3") {
         if (document.poForm.truckCo.value == "Enter Company & Address Here")
            document.poForm.truckCo.value = "";
      }       
   }
     
   function initDatePick(){ 
      document.datePickForm.startDay.value=today.getDate();
      document.datePickForm.startMonthSelect.selectedIndex=today.getMonth();
      document.datePickForm.stopDay.value=today.getDate();
      document.datePickForm.stopMonthSelect.selectedIndex=today.getMonth();
      document.datePickForm.startYear.value=thisyear;
      document.datePickForm.stopYear.value=thisyear;
   }
  
   function init(){ 
      document.poForm.loadYear.value=thisyear; 
      document.poForm.loadDay.value=today.getDate();
      document.poForm.loadMonthSelect.selectedIndex=today.getMonth(); 
      document.poForm.deliveryYear.value=thisyear; 
      document.poForm.deliveryDay.value=today.getDate()+1; 
      document.poForm.deliveryMonthSelect.selectedIndex=today.getMonth(); 
      document.poForm.customer.value=""; 
      document.poForm.destination.value=""; 
      document.poForm.truckCo.value=""; 
      document.poForm.trucker.value=""; 
      document.poForm.lennardLBS.value=""; 
      document.poForm.customerLBS.value="";
      document.poForm.potatoType[0].checked=true;
      document.poForm.invoiced.checked=false;
   
      if(document.poForm.ponum.value != "Enter the PO Number")
         document.poForm.ponum.value="Enter the PO Number";
   
      for (i=0;i<locationArray.length;i++)
         document.forms['poForm'].locationSelect.options[i] = new Option(locationArray[i],i);  
 
      for (i=0;i<customerArray.length;i++)
         document.forms['poForm'].customerSelect.options[i] = new Option(customerArray[i],i);
 
      document.forms['poForm'].customerSelect.options[customerArray.length] = new Option("Other",'99');
   
      for (i=0;i<truckCoArray.length;i++)
         document.forms['poForm'].truckCoSelect.options[i] = new Option(truckCoArray[i],i);
 
      document.forms['poForm'].truckCoSelect.options[truckCoArray.length] = new Option("Other",'99');
   
      for (i=0;i<varietyArray.length;i++) 
         document.forms['poForm'].varietySelect.options[i] = new Option(varietyArray[i],i);

      document.forms['poForm'].varietySelect.options[varietyArray.length] = new Option("Other",'99');
   
      for (i=0;i<binArray.length;i++) 
         document.forms['poForm'].binSelect.options[i] = new Option(binArray[i],i);

      
      document.poForm.fieldSelect.disabled=1;
      document.forms['poForm'].fieldSelect.options[0] = new Option("",0);
      document.poForm.fieldSelect.selectedIndex=0;
      document.poForm.locationSelect.selectedIndex=1;
   
      document.poForm.loadMonthSelect.focus(); 
      document.poForm.customer.disabled=1; 
      document.poForm.destination.disabled=1; 
      document.poForm.truckCo.disabled=1;
      document.poForm.invoice.disabled=1;
      document.poForm.fieldSelect.disabled=1;
      document.poForm.variety.disabled=1; 
      
      calcInvoice();
   }
  
   function handleCancelEdit(ponum,displayDate,filter,sort){
      window.location = "display_page.php?ponum=" + ponum + "displayDate=" + displayDate + "&filter=" + filter + "&sort=" + sort;
   }
  
   function resetPage(){
      location.reload();
   }
  
   function display(ponum,invoice,loadMonthSelect,loadDay,loadYear,deliveryMonthSelect,deliveryDay,deliveryYear,truckCo,trucker,locationSelect,customerSelect,destinationSelect,truckCoSelect,varietySelect,binSelect,customer,destination,lennardLBS,customerLBS,sealNum1,sealNum2,fieldSelect,variety,contractType,potatoType,invoiced,notes,loadNotes,deliveryTime){ 
      document.poForm.ponum.value=ponum;
      document.poForm.invoice.value=invoice;
      document.poForm.loadDay.selectedIndex=loadDay; 
      document.poForm.loadYear.value=loadYear; 
      document.poForm.deliveryDay.selectedIndex=deliveryDay;
      document.poForm.deliveryYear.value=deliveryYear;
      document.poForm.truckCo.value=truckCo;
      document.poForm.trucker.value=trucker; 
      document.poForm.locationSelect.selectedIndex=locationSelect;
      document.poForm.binSelect.selectedIndex=binSelect; 
      document.poForm.loadMonthSelect.selectedIndex=loadMonthSelect-1;
      document.poForm.deliveryMonthSelect.selectedIndex=deliveryMonthSelect-1;
      document.poForm.lennardLBS.value=lennardLBS;
      document.poForm.customerLBS.value=customerLBS; 
      document.poForm.sealNum1.value=sealNum1;
      document.poForm.sealNum2.value=sealNum2;
      document.poForm.variety.value=variety;
      document.poForm.notes.value=notes;
      document.poForm.loadNotes.value=loadNotes;
      document.poForm.deliveryTime.value=deliveryTime;

      if (invoiced == "1"){
        document.poForm.invoiced.checked = true;
      } else {
        document.poForm.invoiced.checked = false; 
      }    

      var radioLength = document.poForm.contractType.length;

      for(var i = 0; i < radioLength; i++) {
        document.poForm.contractType[i].checked = false;

        if(document.poForm.contractType[i].value == contractType) {
          document.poForm.contractType[i].checked = true;
        }
      }

      var radioLength = document.poForm.potatoType.length;

      for(var i = 0; i < radioLength; i++) {
        document.poForm.potatoType[i].checked = false;

        if(document.poForm.potatoType[i].value == potatoType) {
          document.poForm.potatoType[i].checked = true;
        }
      }
   
      if (customerSelect != "99")
         document.poForm.customerSelect.selectedIndex=customerSelect;
      else 
         document.poForm.customerSelect.selectedIndex=customerArray.length;
   
      if (truckCoSelect != "99")
         document.poForm.truckCoSelect.selectedIndex=truckCoSelect;
      else 
         document.poForm.truckCoSelect.selectedIndex=truckCoArray.length;
   
      if (varietySelect != "99")
         document.poForm.varietySelect.selectedIndex=varietySelect;
      else 
         document.poForm.varietySelect.selectedIndex=varietyArray.length;
   
      customerChange();
 
      document.poForm.customer.value=customer;
      document.poForm.destination.value=destination;
 
      if (destinationSelect != "99")
         document.poForm.destinationSelect.selectedIndex=destinationSelect;
      else if (customerSelect != "99")
         document.poForm.destinationSelect.selectedIndex=destinationArray[customerSelect].length;

      binChange();
      document.poForm.fieldSelect.selectedIndex=fieldSelect;

   }
  
   function validDate(y, m, d) {
 
      var theDay = new Date(y, m, d);
 
      return (theDay.getMonth()==m && theDay.getDate()==d);
 
   }
  
   function loadDayChange(){
      if (!validDate(document.poForm.loadYear.value,document.poForm.loadMonthSelect.selectedIndex,document.poForm.loadDay.value)){
         document.poForm.loadDay.value="";
      } else {
        var temp = parseInt(document.poForm.loadDay.value)+1;
        if (validDate(document.poForm.deliveryYear.value,document.poForm.deliveryMonthSelect.selectedIndex,temp))
           document.poForm.deliveryDay.value=temp;
        else
           document.poForm.deliveryDay.value=document.poForm.loadDay.value;
      }
      
      calcInvoice(); 
   }
    
   function loadYearChange(){
      if (document.poForm.loadYear.value != thisyear && document.poForm.loadYear.value != nextyear)
         document.poForm.loadYear.value=thisyear;         

      calcInvoice();         
 
   }
  
   function deliveryDayChange(){
      if (!validDate(document.poForm.deliveryYear.value,document.poForm.deliveryMonthSelect.selectedIndex,document.poForm.deliveryDay.value))
         document.poForm.deliveryDay.value=document.poForm.loadDay.value;
 
   }
        
   function deliveryYearChange(){
      if (document.poForm.deliveryYear.value != thisyear && document.poForm.deliveryYear.value != nextyear)
         document.poForm.deliveryYear.value=thisyear;          
 
   }
  
   function disableFields(arg){
      document.poForm.customerSelect.disabled=arg;
   }
  
   function handleCreate(displayDate,filter,sort){
      window.location = "createPO.php?displayDate=" + displayDate + "&filter=" + filter + "&sort=" + sort;
   }
  
   function handlePrintView(displayDate,filter,sort){
      window.location = "displayPOs.php?printView=1&displayDate=" + displayDate + "&filter=" + filter + "&sort=" + sort;
   }
  
   function handleView(displayDate,firstPO,filter,sort){
     var length = document.myForm.radioSelect.length; 
     
     if (!document.myForm.radioSelect.length){
        window.location = "showPO.php?ponum=" + firstPO + "&displayDate=" + displayDate + "&filter=" + filter + "&sort=" + sort;
     } else {
 
        for (i = 0; i < length; i++)
           if (document.myForm.radioSelect[i].checked)
              window.location = "showPO.php?ponum=" + document.myForm.radioSelect[i].value + "&displayDate=" + displayDate + "&filter=" + filter + "&sort=" + sort; 
     }
 
   }
   
   function handleDelete(displayDate,firstPO,filter,sort){
     var length = document.myForm.radioSelect.length;

     if (!document.myForm.radioSelect.length){
        if (confirm("Delete PO Number " + firstPO + "?"))
           window.location = "handle_deletePO.php?ponum=" + firstPO + "&displayDate=" + displayDate + "&filter=" + filter + "&sort=" + sort;

     } else {
 
        for (i = 0; i < length; i++)
           if (document.myForm.radioSelect[i].checked)
              if (confirm("Delete PO Number " + document.myForm.radioSelect[i].value + "?"))
                 window.location = "handle_deletePO.php?ponum=" + document.myForm.radioSelect[i].value + "&displayDate=" + displayDate + "&filter=" + filter + "&sort=" + sort;
     }
 
   }

   function handleDeleteFile(ponum,displayDate,filter,sort,file){
     if (confirm("Delete " + file + "?"))
        window.location = "handle_deleteFile.php?file=" + file + "&ponum=" + ponum + "&displayDate=" + displayDate + "&filter=" + filter + "&sort=" + sort;
   }

   function goTo(URL){
      window.location=URL;
 
   } 

   function isFireFox() {
      var d, dom, ie, ie4, ie5x, moz, mac, win, lin, old, ie5mac, ie5xwin, op;

      d = document;
      n = navigator;
      na = n.appVersion;
      nua = n.userAgent;
      win = ( na.indexOf( 'Win' ) != -1 );
      mac = ( na.indexOf( 'Mac' ) != -1 );
      lin = ( nua.indexOf( 'Linux' ) != -1 );

      if ( !d.layers ){
            dom = ( d.getElementById );
            op = ( nua.indexOf( 'Opera' ) != -1 );
            konq = ( nua.indexOf( 'Konqueror' ) != -1 );
            saf = ( nua.indexOf( 'Safari' ) != -1 );
            moz = ( nua.indexOf( 'Gecko' ) != -1 && !saf && !konq);
            ie = ( d.all && !op );
            ie4 = ( ie && !dom );

            /*
            ie5x tests only for functionality. ( dom||ie5x ) would be default settings. 
            Opera will register true in this test if set to identify as IE 5
            */

            ie5x = ( d.all && dom );
            ie5mac = ( mac && ie5x );
            ie5xwin = ( win && ie5x );
      }

      return moz;
   }