  

 function openwin(file, image_w, image_h) {  
    newwin = window.open(PATH + "media.php?i="+file, "", "width="+image_w+",height="+(Math.min(image_h,GetPageHeight()+30))+",menubar=no,resizable=no,scrollbars=no,status=no,top=30,left=30");
    if (window.focus) {newwin.focus()}
    return false;
  }

  function openwinp(dir,file) {
    newwin = window.open(PATH + "media_photo.php?d="+dir+"&p="+file);
    if (window.focus) {newwin.focus()}
    return false;
  }
  
  function openwing(file,sizex,sizey) {
    newwin = window.open(PATH + "media_program.php?p="+file,"","");
    
    if (window.focus) {newwin.focus()}
    return false;
  }
  
  function openwinlnk(link,sizex,sizey) {
    if(sizex > 0 && sizey > 0) {
      newwin = window.open(link,"","width="+sizex+",height="+sizey+",menubar=no,resizable=no,scrollbars=no,status=no,top=30,left=30");
    } else {
      newwin = window.open(link, "", "width=800,height=600");
    }
    
    if (window.focus) {newwin.focus()}
    return false;
  }


function resizeImg() {
    var id=document.getElementById('image');
    if(id.height > GetPageHeight()) {
        id.style.height = GetPageHeight() + 'px';
    }
}

