var mCur;
function weather()
{
 	cit=document.getElementById('city');
 	div=document.getElementById('frw');
 	url="http://www.meteoinfo.ru/informer/informer.php?ind="+cit.value+"&type=3&color=167";
 	png="http://meteopost.com/informer/"+cit.value+"-3-b-ru.png";
 	div.innerHTML="<a href=\"http://meteopost.com\"><img src=\""+png+"\" width=\"220\" height=\"200\" alt=\"Погода в Украине\" border=\"0\"></a>";
 	setc();
}
function setc()
{cit=document.getElementById('city');
today = new Date();
today.setTime(today.getTime());
expires = 10080 * 1000 * 60;
d = new Date(today.getTime() + (expires));
var coo = "pugoocity=" + cit.value + "; path=/; expires="+d.toGMTString();
document.cookie = coo;
}

function getc()
{cit=document.getElementById('city');
c_name="pugoocity";
if (document.cookie.length > 0)
{
c_start=document.cookie.indexOf(c_name + "=")
if (c_start!=-1)
{
c_start=c_start + c_name.length+1
c_end=document.cookie.indexOf(";",c_start)
if (c_end==-1) c_end=document.cookie.length
coo=unescape(document.cookie.substring(c_start,c_end))
cit.value=coo;
weather();
}
else {cit.value=29313;weather();}
}
document.f.q.focus();
}

 function tip(txt)
 { x=mCur.x; y=mCur.y;
 h=document.body.clientHeight+document.body.scrollTop;
 if (parseInt(txt.length)<53) tips.style.width="";
 else tips.style.width=350;
 tips.style.visibility="hidden"; height=(parseInt(txt.length/53)+1)*15;
 tips.style.left=x+5; tips.style.top=y+10; tips.style.opacity=1; tips.style.background="#DDFFDD"; dy=y+10+height-h;
 if (dy>0) tips.style.top=y-dy
 tips.innerHTML=txt;
 tips.style.visibility="visible";
  }

 function tipout()
 {
 tips.style.visibility="hidden";
 }

function c1()
{
document.f.se.value="g";
}
function c2()
{
document.f.se.value="y";
}

function mousePageXY(e)
{
  var x = 0, y = 0;
  if (!e) e = window.event;
  if (e.pageX || e.pageY)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else if (e.clientX || e.clientY)
  {
    x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
    y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop)- document.documentElement.clientTop;
  }
  return {"x":x, "y":y};
}

document.onmousemove = function(e){mCur = mousePageXY(e); };



