/*
This code was created by and is copywritten 2004 by 
www.operabydesign.com
====================================================
If you wish to use this code, please go to our website at
www.operabydesign.com/contact.php and send us an e-mail
*/


function imgWin(fileName, folderName, imgwidth, imgheight, strdesc) 
{
	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 = 680;
		winwidth = 530;
	}
	else if(imgwidth/imgheight < .85)
	{
		//wider than it is tall
		//orient = "wxl";
		winheight = 540;
		winwidth = 660;		
	}
	else
	{
		//l and w are the same
		orient = "same";
		winheight = 680;
		winwidth = 640;
	}
	
	
	var xPos = 10;
	var yPos = 10;
	
	winurl = "imgpop.php?imgpath="+URLencode(folderName+fileName)+"&desc="+URLencode(strdesc);
	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');
}

