
// AJAX LISTS
    
   var ajax = new Array();
   
   function GetDepartList(div_dep, sel, depPrefix)
   {
       var regionCode = sel.options[sel.selectedIndex].value;
       document.getElementById(div_dep).innerHTML = "";
       if(regionCode.length>0){
           var index = ajax.length;
           ajax[index] = new sack();
           
           ajax[index].requestFile = '/sites/module/functions/getDepart.php?regionCode='+regionCode+'&depPrefix='+depPrefix; // Specifying which file to get
           ajax[index].onCompletion = function(){ createDepart(div_dep, index) };   // Specify function that will be executed after file has been found
           ajax[index].runAJAX();      // Execute AJAX function
       }
   }
   
   function createDepart(div_dep, index)
   {
       var obj = document.getElementById(div_dep);        
       obj.innerHTML = ajax[index].response; // Executing the response from Ajax as Javascript code  
   }
   
   function GetDepartText(zip)
   {
       var zipCode = zip;
       document.getElementById('div_zip').innerHTML = "";
       if(zipCode.length>0){
           var index = ajax.length;
           ajax[index] = new sack();
           
           ajax[index].requestFile = '/sites/module/functions/getDepart.php?zipCode='+zipCode; // Specifying which file to get
           ajax[index].onCompletion = function(){ createDepartText(index) };   // Specify function that will be executed after file has been found
           ajax[index].runAJAX();      // Execute AJAX function
       }
   }
   
   function createDepartText(index)
   {
       var obj = document.getElementById('div_zip');        
       eval(ajax[index].response); // Executing the response from Ajax as Javascript code  
   }
  
  
   function GetCorrespDisp(checkBox, divId)
   {
       var depCode = checkBox.value;
       
       if (depCode == "-1")
        return;
       
       document.getElementById(divId).innerHTML = "";
       if(depCode.length>0){
           var index = ajax.length;
           ajax[index] = new sack();
           
           ajax[index].requestFile = '/sites/module/functions/getDepart.php?depCode='+depCode; // Specifying which file to get
           ajax[index].onCompletion = function(){ createCorrespDisp(index, divId) };   // Specify function that will be executed after file has been found
           ajax[index].runAJAX();      // Execute AJAX function
       }
   }
   
   function createCorrespDisp(index, divId)
   {       
       var obj = document.getElementById(divId);        
       eval(ajax[index].response); // Executing the response from Ajax as Javascript code
       
       document.getElementById(divId).style.display = "block";
       
   }
