function popupWindow_z(strUrl,sName,iWidth,iHeight)
{
    var sw = screen.availWidth;                                // the screen width in pixels
	  var sh = screen.availHeight;                               // the screen height in pixels
	  var l = (( parseInt(sw) - parseInt(iWidth) ) / 2) - 80 ;   // from left in pixels
	  var t = ( parseInt(sh) - parseInt(iHeight) ) / 2 ;         // from top in pixels
	 
	  if (parseInt(iHeight) > 550)
	  {
	    t = 5;
	  } 
	  
	  
    if (navigator.appName == "Netscape")
    {    
      var strFeature = "'width=" + iWidth + ",height=" + iHeight + ",screenX=" + l + ",screenY=" + t + ",toolbar=0, menubar=0,scrollbars=1,resizable=1'";
      detailwindow = window.open(strUrl,sName,strFeature);  
    
    }
    else
    {    
      var strFeature = "'width=" + iWidth + ",height=" + iHeight + ",left=" + l + ",top=" + t + ",toolbar=0, menubar=0,scrollbars=1,resizable=1'";
      detailwindow = window.open(strUrl,sName,strFeature);  
    
    }
        
        detailwindow.focus();
}

function OpenWin_z(strUrl,w,h)
{  //alert(w);
  if (navigator.appName == "Netscape")
      detailwindow = window.open(strUrl,"Detail","toolbar=0,menubar=0,width=" + w + " ,height=" + h + ",scrollbars=1,resizable=1");
  else
      detailwindow = window.open(strUrl,"Detail","toolbar=0, menubar=0, scrollbars=1, resizable=1,width=" + w + ",height=" + h + "");


	detailwindow.focus();
}

function DetectImageSize2(imageUrl,picTitle)
{
	
	//alert(imageUrl);
	
	picName = new Image()
	picName.src = imageUrl;

	//alert(picName.src);
	//alert(picName.width);
	//alert(picName.height);

	//newWindow=window.open(picName.src,'newWin','toolbar=yes, width=500,height=500')
	//newWindow.resizeTo(picName.width + 95,picName.height + 95);	
	
	newWindow=window.open(picName.src,'newWin','toolbar=no, width='+(picName.width + 95)+',height='+(picName.height + 95))
	

	newWindow.document.write('<html><head><title>' + picTitle + '<\/title><\/head><body>');
	newWindow.document.write('<table bgcolor="black" border=4 cellspacing=20 cellpadding=10><tr><td align=center><img src="'+ picName.src +'"></td></tr></table><\/body><\/html>')
	
	newWindow.focus();
	
} 

function PopupPic_z(sPicURL,sPath) 
{ 
	//alert("hi");
    	window.open( sPath + "popup.htm?"+sPicURL, "", "resizable=1,scrollbar=yes,HEIGHT=100,WIDTH=100"); 
}


function DetectImageSize(picName,picTitle)
{
      picURL=picName.src
      
      //alert(picURL);
   
      newWindow=window.open(picURL,'newWin','toolbar=no, width='+(picName.width + 95)+',height='+(picName.height + 95))
    
      newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body>');
      newWindow.document.write('<table bgcolor="black" border=4 cellspacing=20 cellpadding=10><tr><td align=center><img src="'+picURL+'"></td></tr></table><\/body><\/html>')
  
      newWindow.focus()
} 

function DetectImageSize_save(picName,picTitle)
{
      picURL=picName.src
      //alert(picURL);
      //newWindow=window.open(picURL,'newWin','toolbar=no, width='+picName.width +',height='+picName.height)
      newWindow=window.open(picURL,'newWin','toolbar=no, width='+(picName.width + 95)+',height='+(picName.height + 95))
      //newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body background="'+picURL+'"><\/body><\/html>')
      newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body>');
      newWindow.document.write('<table bgcolor="black" border=4 cellspacing=20 cellpadding=10><tr><td align=center><img src="'+picURL+'"></td></tr></table><\/body><\/html>')
      //alert(picName.width + ' - ' + newWindow.document.body.clientWidth);
      //alert(picName.height + ' - ' + newWindow.document.body.clientHeight);
      //newWindow.resizeBy(picName.width-(newWindow.document.body.clientWidth), picName.height- (newWindow.document.body.clientHeight))
      newWindow.focus()
} 
