var IE = (navigator.appName.indexOf("Microsoft") != -1) && (navigator.userAgent.indexOf("Opera") == -1);
function switchVis(id){
  var div  = document.getElementById(id);
  
  if (div){
    if (div.className != 'active'){
    if (div.style.visibility == 'hidden') 
    {
      div.style.visibility = 'visible';
    } else if(div.style.visibility == 'visible') {  
       div.style.visibility = 'hidden';
     }
  }
  }
}

var newWindow;
var gimgsrc;
function enlargePic(imgsrc,width,height) {
    if (!newWindow || newWindow.closed) {
    	  var left = 10;
    var top = 10;
        newWindow = window.open("", "details", "dependent=yes,top="+top+",left="+left+",height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,screenX=" + left + ",screenY=" + top+"");
        gimgsrc = imgsrc;
        setTimeout("writePic()", 50);
    } else if (newWindow.focus) {
        newWindow.focus( );
    }
}
function writePic() {
    var newContent = "<html><head><title>Lorpen.ru</title></head>";
    newContent += "<body style='padding:0px; margin:0px;'><img src="+gimgsrc+" border=0>";
    newContent += "</body></html>";
    newWindow.document.write(newContent);
    newWindow.document.close( ); // close layout stream
}
var myWindow;
function openCWin(url,w,h) {
    var width = w;
    var height = h;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",dependent=yes,status=no,resizable=yes,left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top;
     if (!myWindow || myWindow.closed) {
        myWindow = window.open(url, "subWind", windowFeatures);
     } else {
     myWindow.close();
     myWindow = window.open(url, "subWind", windowFeatures);
     }
}

