function imgWin(fileName, folderName, imgheight, imgwidth, desc) 
{
	var floatwin;
	var winurl;
	var orient;
	var winheight;
	var winwidth;
	
	//var winheight = imgheight + 120;
	//var winwidth = imgwidth + 60
	
	//Compare height (l) and width (w) for pop-up orientation
	if (imgheight/imgwidth > 1.15)
	{
		//taller than it is wide
		//orient = "lxw";
		winheight = 500;
		winwidth = 360;
	}
	else if(imgheight/imgwidth < .85)
	{
		//wider than it is tall
		//orient = "wxl";
		winheight = 380;
		winwidth = 480;		
	}
	else
	{
		//l and w are the same
		orient = "same";
		winheight = 500;
		winwidth = 460;
	}
	
	
	var xPos = 10;
	var yPos = 10;
	
	winurl = "imgpop.php?imgpath="+URLencode(folderName+fileName)+"&desc="+desc;
	var winstring = "window"+new Date().getTime();
	
    //floatwin = window.open('',winstring,'scrollbars=no,status=no,width='+winwidth+',height='+winheight);
    floatwin = window.open('',winstring,'scrollbars=no,status=no,width='+winwidth+',height='+winheight+',left=' + xPos + ',top=' + yPos + 'screenX=' + xPos + ',screenY=' + yPos)
     floatwin.location.href = winurl;
}


function URLencode(sStr) 
{
   return escape(sStr).replace(/\+/g, '%2C').replace(/\"/g,'%22').replace(/\'/g, '%27');
}

