function showPixa(simg, stxt, iw, ih, cltxt){
  
  var IE = document.all?true:false;

  var el = document.getElementById("pixa");

  var winW=800;
  var winH=600;
  
  var offy = 0;

  if (!iw) iw = 800;
  if (!ih) ih = 600;
  if (!cltxt) cltxt = "закрыть";

  if (IE && !window.opera) {
     winW = document.documentElement.clientWidth-20;
     winH = document.documentElement.clientHeight-20;
     offy = document.documentElement.scrollTop;
  }else{
    winW = window.innerWidth-16;
    winH = window.innerHeight-16;
    offy = window.pageYOffset;
  }
  
  if (iw>winW || ih>winH){ iw /= 2; ih /= 2;}

  if (el){
    
    el.style.visibility = "visible";

    el.innerHTML  = "<a href='javascript:closePixa();'>" + cltxt + " [x]</a>";
    el.innerHTML += "<img onclick='javascript:closePixa();' src='"+ simg + "' width='" + iw + "' height='" + ih + " '/>";

    if (stxt != "") el.innerHTML += "<p>" + stxt + "</p>";

    el.style.left = ((winW - iw)/2) + "px";
    
    if (((winH - ih)/2)<0) el.style.top = -30 + offy + 10 + "px";
    else el.style.top = -30 + ((winH - ih)/2) + offy + "px";
        
  }
  
}

//
function closePixa(){
  var el = document.getElementById("pixa");
  if (el){ el.style.visibility = "hidden"; }
}


