function showImg(x){
  var pom;
  pom=x.src.substring(0, x.src.length-4);
  x.src=pom+'-big.gif';
}

function hideImg(x){
  var pom;
  pom=x.src.substring(0, x.src.length-8);
  x.src=pom+'.gif';
}

function clear_textarea(){
  if(objGet('text').value == "..text vzkazu..")
    objGet('text').value = "";
}

function validate_task(){
  if(objGet('text').value != "..text vzkazu.." || objGet('text').value != "")
    objGet('submit').disabled= false;
  else
    objGet('submit').disabled= true;
}

function objGet(id) 
{
   if (Boolean(document.getElementById))
      return document.getElementById(id);
   else if (Boolean(document.all))
      return eval('document.all.'+id);
   else
      return eval('document.'+id);
}

function openImage(id, alt, root){
  url = root+'photo.php?id='+id+'&alt='+alt;
  win = window.open(url, id,'resizable=1,top=20,left=20,menubar=0,scrollbars=0,status=0,location=0,width=' + 300 + ',height=' + 225);
  win.focus()
}

function fit_window(){
  pictureWidth = objGet('pic').width;
  pictureHeight = objGet('pic').height;
  window.resizeTo(pictureWidth+8, pictureHeight+82);  
}
