 function lib_open_img_window(src,width,height){ 
   if(width==0)
     width=500;
   width+=20;
   if(height==0)
     height=400;
   height+=20;
   if(height>600)
     height=600;
   var left = (screen.availWidth/2) - (width/2);
   var top = (screen.availHeight/2) - (height/2);
   info=window.open('/img_preview.php?src='+src,'info','resizable=1, scrollbars=1, toolbar=0, status=0, width='+width+', height='+height+', left='+left+', top='+top);
   info.focus();
 }

function open_window(win,params,width,height){
   if(width==0)
     width=650;
   width+=20;
   if(height==0)
     height=650;
   height+=20;
   if(height>750)
     height=750;
   var left = (screen.availWidth/2) - (width/2);
   var top = (screen.availHeight/2) - (height/2);

   if(params!='')
     win+=params
   info=window.open(win,'info','resizable=1, scrollbars=0, toolbar=0, status=0, width='+width+', height='+height+', left='+left+', top='+top);
   info.focus();
 }
 
  function open_img_window(id,width,height,text){ 
   if(width==0)
     width=800;
   width+=40;
   
   if(height==0)
     height=600;
   height+=20;
   if(text!=0)
     height+=30;
   if(height>700)
     height=700;
   var left = (screen.availWidth/2) - (width/2);
   var top = (screen.availHeight/2) - (height/2);
   info=window.open('/photos_view.php?id='+id,'info','resizable=1, scrollbars=1, toolbar=0, status=0, width='+width+', height='+height+', left='+left+', top='+top);
   info.focus();
 }
 
  function open_img_window2(id,width,height,text){ 
   if(width==0)
     width=500;
   width+=40;
   
   if(height==0)
     height=400;
   height+=20;
   if(text!=0)
     height+=30;
   if(height>700)
     height=700;
   var left = (screen.availWidth/2) - (width/2);
   var top = (screen.availHeight/2) - (height/2);
   info=window.open('/fotogalery_view.php?id='+id,'info','resizable=1, scrollbars=1, toolbar=0, status=0, width='+width+', height='+height+', left='+left+', top='+top);
   info.focus();
 }

function menu2(eImg, id) {
    var item = null;
    if (document.getElementById) {
        item = document.getElementById(id);
    }
    else if (document.all) {
        item = document.all[id];
    }
    else if (document.layers) {
        item = document.layers[id];
    }
    if (!item) {
    }
    else if (item.style) {
        if (item.style.display == "none") {
            item.style.display = "";
            document.images[eImg].src="/img/arrow_on.gif";
        }
        else {
            item.style.display = "none";
            document.images[eImg].src="/img/arrow.gif";
        }
    }
    else {
        item.visibility = "show";
        document.images[eImg].src="/img/arrow_on.gif";
    }
}

function MM_preloadImages() { //v1.2
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    var preloadArray = new Array();
    for (var i=0; i<imgFiles.length; i++) {
      preloadArray[i] = new Image;
      preloadArray[i].src = imgFiles[i];
    }
  }
}


