function OpenPhoto(img, w, h, title){
  if (w && h) {
    if (w > screen.availWidth || h > screen.availHeight) {
      if (w / screen.availWidth > h / screen.availHeight) {
        h *= screen.availWidth / w;
        w = screen.availWidth;
      }
      else {
        w *= screen.availHeight / h;
        h = screen.availHeight;
      }
    }
    if (!title) title = 'View photo';
    var win = window.open("", "_blank", "width="+w+", height="+h);
    win.document.write("<html><head>\n");
    win.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
    win.document.write("<title>"+title+"</title></head>\n");
    win.document.write("<body style=\"padding: 0; margin: 0; cursor: hand;\">\n");
    win.document.write("<img src=\""+img+"\" width=\""+w+"\" height=\""+h+"\" alt=\""+title+"\" title=\""+title+"\" onclick=\"window.close()\">\n");
    win.document.write("</body></html>");
    win.focus();
  }
}
///
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
var h = 158;
var dh = 0;

var elem = null;

function IdentMenu() {
	elem = d.getElementById?d.getElementById("leftmenu"):d.all?d.all["leftmenu"]:d.layers["leftmenu"];
	elem.style.position = "absolute";

	window.onscroll = function SetTop() {
		dh = (ns ? pageYOffset : d.documentElement && d.documentElement.scrollTop ? d.documentElement.scrollTop : d.body.scrollTop);
		elem.style.top = (dh > h ? dh : h) + "px";
	}
}
