var aWin=null;

function makeArray(n)
{
	for (var i=0;i<n;i++)
		this[i]="";

	this.length=n;

	return this;
}

function setStatus(text)
{
	if (navigator.appVersion.indexOf('MSIE 5')!=-1)
		window.setTimeout('window.status="'+unescape(text)+'"',1);
	else
		window.status=unescape(text);

	return true;
}

function getVar(substr)
{
	var retStr = "";

	if (self.location.search != null && location.search != "" && location.search != "?")
	{
		var pos = location.search.indexOf(substr);

		if (pos >= 0)
		{
			retStr = location.search.substring(pos, location.search.length);
			retStr = retStr.substring(retStr.indexOf("=") + 1, retStr.length);

			if (retStr.indexOf("&") != -1)
				retStr = retStr.substring(0, retStr.indexOf("&"));
		}
	}

	return retStr;
}

function resetlink()
{
	if (navigator.appVersion.indexOf('MSIE 5')!=-1)
		window.setTimeout('window.status="'+window.defaultStatus+'"',1);
	else
		window.status=window.defaultStatus;

	return true;
}

function sopenWindow(imagesrc, w, h)
{
	var xl=(screen.width-w)/2;
	var yl=(screen.height-h)/2;
	var how="toolbar=no,location=no,directories=no,menubar=no,status=yes,scrollbars=no,resizable=no,left="+xl+",top="+yl+",ScreenX="+xl+",ScreenY="+yl+",height="+h+",width="+w;
	var aWin=window.open("","aWin",how);

	if (aWin!=null)
	{
		aWin.focus();

		with (aWin.document)
		{
			open();
			open();

			write('<HTML><HEAD><TITLE>GPL Addons Image Display Frame</TITLE>');
			write('<LINK rel="STYLESHEET" type="text/css" href="addons.css" title "Style1">');
			write('<SCRIPT language="javaScript" src="addons.js"></S'+'CRIPT></HEAD>');
			write('<BODY background="'+imagesrc+'" OnLoad="window.defaultStatus=\'Click on the image to close it\';return true;">');
			write('<A href="javascript:close()" OnMouseOver="window.status=\'Click on the image to close it\';return true;">');
			write('<IMG src="blank.gif" width="'+(w-20)+'" height="'+(h-20)+'" border="0"></IMG></A>');
			write('</BODY></HTML>');

			close();

			if (navigator.appVersion.indexOf('MSIE')!=-1)
				for(var i=0;i<2500;i++)
					; // MSIE sucks big time

			close();
		}
	}
}

/*
var putItThere = null;
var chasm = screen.availWidth;
var mount = screen.availHeight; //chasm and mount help calculate the center of the screen

function popupwindow (URL,popupWidth,popupHeight)
{
	if (popupWidth > chasm)
		popupWidth = chasm - 10;
	if (popupHeight > mount)
		popupHeight = mount - 40;

	putItThere = window.open(URL,"popupWindow","width=" + popupWidth + ",height=" + popupHeight + ",toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=no,left=" + ((chasm - popupWidth - 10) * .5) + ",top=" + ((mount - popupHeight - 30) * .5) + ",screenX=" + ((chasm - popupWidth - 10) * .5) + ",screenY=" + ((mount - popupHeight - 30) * .5));
}
*/

