
  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;
} 

    //=================
    y = d.getUTCFullYear();
    m = d.getUTCMonth();
    if(m<1){
      m = "12";
      y = y-1;
    }
    if(m<10) m = "0" + m;
    document.request.s_year.value = y;
    document.request.s_month.value = m;
    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,ClimatI&STYLES=default,rivers,lakes,wb,ClimatI&FORMAT=jpg&BGCOLOR=0xfff8ff&TRANSPARENT=FALSE&EXCEPTIONS=INIMAGE&FEATUREFILTER=ClimatI;Station_NM;period,";
    countref="http://cliware.meteo.ru/imagecount/imagecount?VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&HEIGHT=20&WIDTH=800&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&BBOX=-180,-90,180,90&LAYERS=climati&STYLES=red&PERIOD=";

    slYear = document.request.s_year.value;
    slMonth = document.request.s_month.value;
    slDate = slYear + "-" + slMonth + "-01 00:00";
//  alert(slDate);
    map.src = mapref + slDate + "," + slDate;
    count.src=countref+slDate + "," + 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()", 60000);
  }
  function stopRef(){
    window.window.clearInterval(oInterval);
  }
