 
  function set_hms_cookie() {
    long_deg = document.frmObservation.long_deg.value;
    long_min  = document.frmObservation.long_min.value;
    lat_deg = document.frmObservation.lat_deg.value;
    lat_min  = document.frmObservation.lat_min.value;
    contact_name = document.frmObservation.contact_name.value;
    contact_email = document.frmObservation.contact_email.value;
    northsouth = document.frmObservation.northsouth[0].checked?"N":"S";
    eastwest = document.frmObservation.eastwest[0].checked?"E":"W";     
    lang = document.frmObservation.lang.selectedIndex;
    exp = new Date( ((new Date()).getTime()) + (3600000 * 24 * 100) );
    var tmp = "hms_settings=" + 
	escape(long_deg+"|"+long_min+"|"+lat_deg+"|"+lat_min+"|"
	+contact_name+"|"+contact_email+"|"+northsouth+"|"+eastwest+"|"+lang);
    document.cookie = tmp +";expires="+exp.toGMTString();
    alert("Settings Saved! ");
  }
  
  
  
  function get_hms_cookie() {

    var tmp = document.cookie.split(/; *|=/);
    for (i = 0; i<tmp.length; i+=2) {
      if (tmp[i]=="hms_settings") {
	tmp2 = (tmp[i+1]).split(/%7C/);
	document.frmObservation.long_deg.value=unescape(tmp2[0]);
	document.frmObservation.long_min.value=unescape(tmp2[1]);
	document.frmObservation.lat_deg.value=unescape(tmp2[2]);
	document.frmObservation.lat_min.value=unescape(tmp2[3]);
	document.frmObservation.contact_name.value=unescape(tmp2[4]); 
	document.frmObservation.contact_email.value=unescape(tmp2[5]);
	if (tmp2[6]=="N") {
	  document.frmObservation.northsouth[0].checked=true;
	  document.frmObservation.northsouth[1].checked=false;
	} else {
	  document.frmObservation.northsouth[0].checked=false;
	  document.frmObservation.northsouth[1].checked=true;
	}

	if (tmp2[7]=="E") {
	  document.frmObservation.eastwest[0].checked=true;
	  document.frmObservation.eastwest[1].checked=false;
	} else {
	  document.frmObservation.eastwest[0].checked=false;
	  document.frmObservation.eastwest[1].checked=true;
	}
	    
	if (document.reload.cookie_set.value=="") {
	  document.frmObservation.lang.selectedIndex = tmp2[8];
	  document.reload.cookie_set.value = "true";
	}
      }
    }    
    //alert("get cookie");
  }
