// Calculate the details rows
dRows = details;

// If the width or height is heigher then 100 (limitation for outsiders) make them 100
if (width > 100)
{
	width = 100;
}

if (height > 100)
{
	height = 100;
}

// If the width is smaller then 150 and there are details
if ((width < 150) && (details != 0))
{
	// Double the rows
	dRows = dRows * 2;
}

wFactor = PPR;
hFactor = PPR;

if (PPR == 0)
{
	wFactor = amount;
	hFactor = amount;
}

// If the wSpace or hSpace are 0 make them 0.00000001
if (wSpace == 0)
{
	wSpace = 0.00000001;
}

if (hSpace == 0)
{
	hSpace = 0.00000001;
}

hFactor = Math.ceil(amount / hFactor)

// Calculate the frame width and height
fWidth = (width * wFactor) + (wSpace * (wFactor + 1)); //(width + wSpace * 2) * wFactor - wSpace;
fHeight = (height * hFactor) + (hSpace * (hFactor + 1)) + ((dRows * 18) * hFactor); //(height + hSpace * 2 + (18 * dRows)) *  - wSpace;

document.write('<iframe style="margin: 0px; padding: 0px;" ' +
						'src="http://www.sclient.net/main.php?system=misc&page=picStrip&' +
						'amount=' + amount +
						'&PPR=' + PPR +
						'&bgColor=' + bgColor +
						'&width=' + width +
						'&bannedOnly=' + bannedOnly +
						'&height=' + height +
						'&wSpace=' + wSpace +
						'&hSpace=' + hSpace +
						'&servers=' + servers +
						'&details=' + details +
						'&fgColor=' + fgColor +
						'" ' +
					   'WIDTH="' + fWidth + '" ' +
					   'HEIGHT="' + fHeight + '" ' +
					   'SCROLLING="NO" ' +
					   'FRAMEBORDER="0" ' +
					   'border="0">' +
				'</iframe>');