   function setLocationType(type)
   {if (type=='region')
    {window.document.criteriaselector.elements["region[]"].disabled=false;
     window.document.criteriaselector.elements["region[]"].style.background='#ffffff';
     window.document.criteriaselector.elements["country[]"].disabled=true;
     window.document.criteriaselector.elements["country[]"].style.background='#dddddd';
     window.document.criteriaselector.elements["country[]"].selectedIndex=-1;
    }
    else if (type=='country')
    {window.document.criteriaselector.elements["region[]"].disabled=true;
     window.document.criteriaselector.elements["region[]"].style.background='#dddddd';
     window.document.criteriaselector.elements["region[]"].selectedIndex=-1;
     window.document.criteriaselector.elements["country[]"].disabled=false;
     window.document.criteriaselector.elements["country[]"].style.background='#ffffff';
    }
   }

   function setTimeframe(type)
   {if (type=='period')
    {window.document.criteriaselector.elements["period[]"].disabled=false;
     window.document.criteriaselector.elements["period[]"].style.background='#ffffff';
     window.document.criteriaselector.elements["year[]"].disabled=true;
     window.document.criteriaselector.elements["year[]"].style.background='#dddddd';
     window.document.criteriaselector.elements["year[]"].selectedIndex=-1;
    }
    else if (type=='year')
    {window.document.criteriaselector.elements["period[]"].disabled=true;
     window.document.criteriaselector.elements["period[]"].style.background='#dddddd';
     window.document.criteriaselector.elements["period[]"].selectedIndex=-1;
     window.document.criteriaselector.elements["year[]"].disabled=false;
     window.document.criteriaselector.elements["year[]"].style.background='#ffffff';
    }
   }

   function setDisaster(type)
   {if (type=='disastergroup')
    {window.document.criteriaselector.elements["disastergroup[]"].disabled=false;
     window.document.criteriaselector.elements["disastergroup[]"].style.background='#ffffff';
     window.document.criteriaselector.elements["disastertype[]"].disabled=true;
     window.document.criteriaselector.elements["disastertype[]"].style.background='#dddddd';
     window.document.criteriaselector.elements["disastertype[]"].selectedIndex=-1;
    }
    else if (type=='disastertype')
    {window.document.criteriaselector.elements["disastergroup[]"].disabled=true;
     window.document.criteriaselector.elements["disastergroup[]"].style.background='#dddddd';
     window.document.criteriaselector.elements["disastergroup[]"].selectedIndex=-1;
     window.document.criteriaselector.elements["disastertype[]"].disabled=false;
     window.document.criteriaselector.elements["disastertype[]"].style.background='#ffffff';
    }
   }

   function validateForm(theForm) 
   {if(
       (theForm.elements["region[]"].value=="" && theForm.elements["country[]"].value=="") ||
       (theForm.elements["period[]"].value=="" && theForm.elements["year[]"].value=="") ||
       (theForm.elements["disastergroup[]"].value=="" && theForm.elements["disastertype[]"].value=="")
      )
      {alert ("You must make three selections: \n\nRegion OR Country;  \nPeriod OR Year;  \nDisaster Group OR Disaster Type");
       return false;
      }
   }


