
  var oInterval = "";

  function initTsk(){
    setDate();
    startRef();
  }

  function setDate(){
    d = new Date();
      //========================
  var    g=d.getUTCFullYear();
  var t;
  for (var j=0; j<4; j++) { 
	t=g-j;
                    document.request.s_year.options[j].text=t;
                   document.request.s_year.options[j].value=t;
} 

    //=================
    document.request.s_year.value = d.getUTCFullYear();
    m = d.getUTCMonth() + 1;
    if(m<10) m = "0" + m;
    document.request.s_month.value = m;
    n = d.getUTCDate();
    if(n<10) n = "0" + n;
    document.request.s_day.value = n;
    getMap();
  }

  function getMap(){
    mapref = "http://cliware.meteo.ru/deegree/deegreewms?WMTVER=1.0.0&REQUEST=map&SRS=EPSG:4326&BBOX=-180,-90,180,90&WIDTH=800&HEIGHT=400&LAYERS=world,Rivers,Lakes,WorldBorder,Tes_Meteo,Buoy_Meteo,Bt_Meteo&STYLES=default,rivers,lakes,wb,Tes_Meteo,Buoy_Meteo,Bt_Meteo&FORMAT=jpg&BGCOLOR=0xfff8ff&TRANSPARENT=FALSE&EXCEPTIONS=INIMAGE&FEATUREFILTER=";
     countref="http://cliware.meteo.ru/imagecount/imagecount?VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&HEIGHT=50&WIDTH=800&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&BBOX=-180,-90,180,90&LAYERS=TES_METEO,BT_METEO,BUOY_METEO&STYLES=blue,blue,blue&PERIOD=";
      fts = "Tes_Meteo;Station_ID;period,";
    fbl = "*Buoy_Meteo;Station_ID;period,";
    fbt = "*Bt_Meteo;Station_ID;period,";
    slYear = document.request.s_year.value;
    slMonth = document.request.s_month.value;
    slDay = document.request.s_day.value;
    slbDate = slYear + "-" + slMonth + "-" + slDay + " " + "00:00";
    sleDate = slYear + "-" + slMonth + "-" + slDay + " " + "23:59";
    slDate = slbDate + "," + sleDate;
//  alert(slDate);
    map.src = mapref + fts + slDate + fbl + slDate + fbt + slDate;
    count.src=countref+slDate;
//  2004-05-15 06:00,2004-05-15 07:59 Example of date
  }

    function doRef(){
      if(document.request.ref.checked){
        setDate();
      }
    }

  function startRef(){
    oInterval = window.setInterval("doRef()", 300000); // 5 minutes
  }
  function stopRef(){
    window.window.clearInterval(oInterval);
  }
