// JavaScript Document

function imgPop (url, w,h) {
  closePopup("winPop");
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no';
  winPop = window.open('about:blank', "Niatnam", winprops);
  with (winPop.document) {
    writeln('<html>');
    writeln('<head>');
    writeln('<title>Niat-Nam</title>');
    writeln('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />');
    writeln('<style type="text/css">body {margin:0;} img{cursor:pointer;}</style>');
    writeln('</head>');
    writeln('<body>');
    writeln('<img src="'+url+'" title="Atgal" onclick="window.close();" alt="TDI" />');
    writeln('</body>');
    writeln('</html>');
    close();
  }    
  if (parseInt(navigator.appVersion) >= 4) { 
    winPop.window.focus(); 
  }
}
function imgPopF (gid, id, sid, w, h) {
  closePopup("winPop");
  w += 20;
  if (w<300) w = 300;
  h += 45;
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=1';
  winPop = window.open('foto.php?gid='+gid+'&id='+id+'&sid='+sid, "Niatnam", winprops);
  if (parseInt(navigator.appVersion) >= 4) { 
    winPop.window.focus(); 
  }
}
function windPop (url, w,h) {
  closePopup("winPop");
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no';
  winPop = window.open(url, "Niatnam", winprops);    
  if (parseInt(navigator.appVersion) >= 4) { 
    winPop.window.focus(); 
  }
}

function closePopup(popupHandle){
if (window[popupHandle] && !window[popupHandle].closed){
window[popupHandle].close();}
}

function showHide(el) {
  if (el.style.display == 'block') {
    el.style.display = 'none';
  } else {
    el.style.display = 'block';
  }
}
  