
function NewImage(arg)
{
	if (document.images)
	{
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function ChangeImage()
{
	if (document.images && (preloadFlag == true))
	{
		for (var i=0; i<ChangeImage.arguments.length; i+=2)
		{
			if (document.getElementById(ChangeImage.arguments[i]))
			{
				document.getElementById(ChangeImage.arguments[i]).src = ChangeImage.arguments[i+1];
			}
			else document[ChangeImage.arguments[i]].src = ChangeImage.arguments[i+1];
		}
	}
}

// FlashManager
function FlashManager(strFile, intWidth, intHeight, strBackgroundColour)
{
	var window_mode = 'transparent' //set this to transparent to make flash movie sit in the document order correctly

	document.write('<object\n');
	document.write('id="RokVSA"\n');
	document.write('classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"\n');
	document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"\n');
	document.write('width="'+intWidth+'"\n');
	document.write('height="'+intHeight+'"\n');
	document.write('align="center">\n');
	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
	document.write('<param name="movie" value="'+strFile+'" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="bgcolor" value="'+strBackgroundColour+'" />\n');
	document.write('<param name="wmode" value="'+window_mode+'" />\n');
	document.write('<embed\n');
	document.write('src="'+strFile+'"\n');
	document.write('quality="high"\n');
	document.write('bgcolor="'+strBackgroundColour+'"\n');
	document.write('width="'+intWidth+'"\n');
	document.write('height="'+intHeight+'"\n');
	document.write('name="rok"\n');
	document.write('align="left"\n');
	document.write('wmode="'+window_mode+'"\n');
	document.write('allowScriptAccess="sameDomain"\n');
	document.write('type="application/x-shockwave-flash"\n');
	document.write('pluginspage="http://www.macromedia.com/go/getflashplayer"\n');
	document.write('/>\n');
	document.write('</object>\n');
}

//
// arg1: a unique id
// arg1: URL to display
// arg2: popup width
// arg3: popup height
//
function ShowPopup2(strWinId, strUrl, intIfrWidth, intIfrHeight, strTitle)
{
	//
	// Configuration
	// The paths here will change from one project to another
	// ...same with colours
	var blnRemoveOnClose = true; // Set this to false to leave the page in place || false reloads each time it's opened
	var intBackgroundOpacity = 75; // Overall percentage opacity of greyed out background
	var hexBgColour = "#344";
	var blnRemoveScrollBar = false;

	// Top control area
	var intTopMenuHeight = 26; // height in pixels to top bar
	var intBackgroundOpacity = 75; // Percentage
	var hexTopBarColour = "#888 url('/local/dejoria.com/images/winTopBg.jpg') repeat-x";
	var strWinTopClose = '<img src="/local/dejoria.com/images/winTopClose.gif" style="float:right;" alt="Close" />';
	strWinTopClose += '<div style="float:right;margin:5px 3px 0 0;cursor:pointer;color:#666;">CLOSE</div>';
	var topbarPadding = "4px 0 0 7px";
	var topbarFontColor = "#666";
	var topbarFontWeight = "bold";
	var topbarFontSize = "13px";

	// Dependencies
	if(typeof GetWindowHeight != 'function') alert("The javascript function ShowPopup() is dependent on another function which isn't present: GetWindowHeight()");
	if(typeof GetWindowWidth != 'function') alert("The javascript function ShowPopup() is dependent on another function which isn't present: GetWindowWidth()");
	if(typeof CreateElement != 'function') alert("The javascript function ShowPopup() is dependent on another function which isn't present: CreateElement()");

	var strContainerDivId = strWinId+"_contDiv";
	var strCentreDivId = strWinId+"_centDiv";
	var strControlDivId = strWinId+"_ctrDiv";
	var strContainerIfrId = strWinId+"_contIfr";

	// Constants
	var intWinWidth = GetWindowWidth();
	var intWinHeight = GetWindowHeight();
	var objMasterDiv = document.getElementById(strContainerDivId); // test whether it has already been created
	var objCenterDiv = document.getElementById(strCentreDivId); // test whether it has already been created

	// Create objects
	if (objMasterDiv == null)
	{
		// Adjust document.body
		// This is to remove the scroll bar
		if (blnRemoveScrollBar)
		{
			document["body"]["style"]["overflow"] = "hidden";
		}

		// Create master div container
		var objMasterDiv = CreateElement("div", strContainerDivId, 0, 0, intWinWidth, intWinHeight, hexBgColour, 101, intBackgroundOpacity);
		document.body.appendChild(objMasterDiv);

 		// Create central div
 		intLeft = parseInt((intWinWidth/2) - (intIfrWidth/2))+"px";
 		intTop = parseInt((intWinHeight/2) - (intIfrHeight/2) - (intTopMenuHeight*2)+intTopMenuHeight)+"px";
		var objCentreDiv = CreateElement("div", strCentreDivId, intLeft, intTop, intIfrWidth, intIfrHeight+20, hexBgColour, 102, 100);
		document.body.appendChild(objCentreDiv);

		// Create top control area
		var objCtrDiv = CreateElement("div", strControlDivId, 0, 0, intIfrWidth, intTopMenuHeight, hexTopBarColour, 103, 100);
		objCtrDiv["style"]["textAlign"] = "left";
		objCentreDiv.appendChild(objCtrDiv);

		// Create close link
		var objLink = document.createElement("a");
		objLink.setAttribute("href", "javascript:void(0);");
		if (navigator.userAgent.indexOf("MSIE") != -1) objLink.onclick = function() {ShowPopup(strWinId)};
		else objLink.setAttribute("onclick", "return ShowPopup('"+strWinId+"');"); // For other browsers
		objLink["innerHTML"] = strWinTopClose;
		objLink["style"]["color"] = topbarFontColor;
		objLink["style"]["margin"] = "0";
		objCtrDiv.appendChild(objLink);

		// Create box title
		if (strTitle != undefined)
		{
			var objDiv = document.createElement("div");
			objDiv["style"]["width"] = parseInt(intIfrWidth/2)+"px";
			objDiv["style"]["height"] = intTopMenuHeight+"px";
			objDiv["style"]["textAlign"] = "left";
			objDiv["style"]["margin"] = "0";
			objDiv["style"]["padding"] = topbarPadding;
			objDiv["style"]["color"] = topbarFontColor;
			objDiv["style"]["fontWeight"] = topbarFontWeight;
			objDiv["style"]["fontSize"] = topbarFontSize;
			objDiv["style"]["position"] = "absolute";
			objDiv["style"]["display"] = "block";

			objDiv["innerHTML"] = strTitle;
			objCtrDiv.appendChild(objDiv);
		}

		var objNewIfr = CreateElement("iframe", strContainerIfrId, 0, intTopMenuHeight, intIfrWidth, intIfrHeight, hexBgColour, 104, 100);
		objNewIfr.setAttribute("name", strContainerIfrId);
		objNewIfr.setAttribute("src", strUrl);
		objNewIfr.setAttribute("scrolling", "auto");
		objNewIfr.setAttribute("frameborder", "0");
		objCentreDiv.appendChild(objNewIfr);
	}

	else // Switch display
	{
		// Reset body area scrollbar
		if (blnRemoveScrollBar) document["body"]["style"]["overflow"] = "auto";

		// Close and remove
		if (blnRemoveOnClose && objMasterDiv["style"]["display"] != "none")
		{
			document.body.removeChild(objCenterDiv);
			document.body.removeChild(objMasterDiv);
		}

		// Close
		else if (objMasterDiv["style"]["display"] != "none")
		{
			objMasterDiv["style"]["display"] = "none";
			objCenterDiv["style"]["display"] = "none";
		}

		// Open
		else
		{
			objMasterDiv["style"]["display"] = "block";
			objCenterDiv["style"]["display"] = "block";
		}
	}

	return false;
}

//
// arg1: a unique id
// arg2: URL to display
// arg3: popup width
// arg4: popup height
// arg5: topbar win title
//
function ShowPopup(strWinId, strUrl, intIfrWidth, intIfrHeight, strTopBarTitle, intLeftPos, intTopPos)
{
	// http://www.codeproject.com/KB/aspnet/JsOOP1.aspx
	var objPopup = new ClassPopup();

	// Basic properties
	var objPopupProperties = new Object;
	if (intLeftPos) objPopupProperties["intLeftPos"] = intLeftPos;
	if (intTopPos) objPopupProperties["intTopPos"] = intTopPos;
	objPopupProperties["strWinId"] = strWinId;
	objPopupProperties["strUrl"] = strUrl;
	objPopupProperties["intIfrWidth"] = intIfrWidth;
	objPopupProperties["intIfrHeight"] = intIfrHeight;
	objPopupProperties["strTopBarTitle"] = strTopBarTitle;
	objPopupProperties["intMasterDivOpacity"] = 75; // Overall percentage opacity of greyed out background
	objPopupProperties["hexMasterDivBgColour"] = "#344";
	objPopupProperties["strTopBarinnerHTML"] = '<img src="/local/dejoria.com/images/winTopClose.gif" style="float:right;" alt="Close" /><div style="float:right;margin:5px 3px 0 0;cursor:pointer;color:#666;text-decoration: none;">CLOSE</div>';
	objPopupProperties["hexTopBarAnchorColor"] = "#fff";
	objPopup.SetProperties(objPopupProperties);

	// These are standard css styles
	// Names are appropriate for javascript
	var objTopBarStyle = new Object;
	objTopBarStyle["height"] = 26;
	objTopBarStyle["background"] = "#888 url('/local/dejoria.com/images/winTopBg.jpg') repeat-x";
	objTopBarStyle["padding"] = "4px 0 0 7px";
	objTopBarStyle["margin"] = "0";
	objTopBarStyle["color"] = "#666";
	objTopBarStyle["fontWeight"] = "bold";
	objTopBarStyle["fontSize"] = "13px";
	objPopup.SetTopBarCss(objTopBarStyle);

	objPopup.BuildWindow();
	return false;
}

function ClassPopup()
{
	//
	// PRIVATE PROPERTIES only available from within the class
	// ...must have var prefix
	//
	var intCounter = 0;
	var _zIndex = 100;
	var objCentreDiv = null;
	var _hshTopBarCss = new Object;
	var _hshProperties = new Object;

	// Public setter arg needs to be a hash
	this["SetProperties"] = _SetProperties;
	this["SetTopBarCss"] = _SetTopBarCss;
	this["BuildWindow"] = _BuildWindow;
	this["_CreateElement"]  = _CreateElement;
	this["_GetWindowHeight"] = _GetWindowHeight;
	this["_GetWindowWidth"] = _GetWindowWidth;
	this["_intRightMarginWidth"] = 16;
	// this["_Tween"] = _Tween;

	// Constants
	this["intWinWidth"] = GetWindowWidth();
	this["intWinHeight"] = GetWindowHeight();
	var arrScrollXY = GetScrollXY();
	this["intWinScrollX"] = arrScrollXY[0];
	this["intWinScrollY"] = arrScrollXY[1];

	// INITIALISATION
	// - without this line ... appears to causes a problem ie8!
	this["_zIndex"] = _zIndex;

	function _BuildWindow()
	{
		// System check
		/*
		var str = "DEBUG\n\n";
		for (key in this)
		{
			if (key == "BuildWindow" || key == "_CreateElement" || key == "_GetWindowHeight" || key == "_GetWindowWidth") continue;
			str += key + ":" +this[key]+"\n";
		}
		str += "\n";
		for (key in _hshProperties)
		{
			str += key + ":" +_hshProperties[key]+"\n";
		}
		*/
		var strContainerDivId = _hshProperties["strWinId"]+"_contDiv";
		var strCentreDivId = _hshProperties["strWinId"]+"_centDiv";
		var strControlDivId = _hshProperties["strWinId"]+"_ctrDiv";
		var strContainerIfrId = _hshProperties["strWinId"]+"_contIfr";

		// These are used mainly for closing the window
		var objMasterDiv = document.getElementById(strContainerDivId); // test whether it has already been created
		var objCenterDiv = document.getElementById(strCentreDivId); // test whether it has already been created
		var objContainerIfrId = document.getElementById(strContainerIfrId);

		// Doesn't already exist
		if (objMasterDiv == null)
		{
			// Create reference to common "body" across doctypes
			var standardbody = (document.compatMode=="CSS1Compat")?document.documentElement:document.body;
			// standardbody["style"]["overflow"] = "hidden";

			if (navigator.userAgent.indexOf("IE") != -1)
			{
				standardbody["style"]["overflow"] = "hidden";
			}

			else
			{
				standardbody["style"]["overflowY"] = "hidden";
			}

			// Hide the scroll bar
			var intBodyMarginRight = (standardbody["style"]["marginRight"] != "")?parseInt(standardbody["style"]["marginRight"]):0;
			standardbody["style"]["marginRight"] = intBodyMarginRight+this["_intRightMarginWidth"]+"px";

			// Create master div container
			var objMasterDiv = this._CreateElement
			(
				"div",
				strContainerDivId,
				this["intWinScrollX"],
				this["intWinScrollY"],
				this["intWinWidth"],
				this["intWinHeight"],
				_hshProperties["hexMasterDivBgColour"],
				this["_zIndex"]++,
				_hshProperties["intMasterDivOpacity"]
			);
			document.body.appendChild(objMasterDiv);

			// Create central div
			// All other objects are created inside this div
			var intVerticalAdjustment = 30;

			if (_hshProperties["intLeftPos"]) var intLeftPos = parseInt(_hshProperties["intLeftPos"])+"px";
			else
			{
				var intLeftPos = parseInt((this["intWinWidth"]/2) - (_hshProperties["intIfrWidth"]/2))+this["intWinScrollX"]+"px";
			}

			if (_hshProperties["intTopPos"]) var intTopPos = parseInt(_hshProperties["intTopPos"])+"px";
			else
			{
				var intTopPos = parseInt((this["intWinHeight"]/2) - (_hshProperties["intIfrHeight"]/2)
						- (_hshTopBarCss["height"]*2)+_hshTopBarCss["height"]+intVerticalAdjustment)+this["intWinScrollY"]+"px";
			}

			objCentreDiv = this._CreateElement
			(
				"div",
				strCentreDivId,
				intLeftPos,
				intTopPos,
				10, // _hshProperties["intIfrWidth"],
				10, // _hshProperties["intIfrHeight"],
				"#333", // _hshProperties["hexMasterDivBgColour"],
				this["_zIndex"]++,
				100
			);
			objCentreDiv["style"]["overflow"] = "hidden";
			document.body.appendChild(objCentreDiv);

			// Create top control area
			var objCtrDiv = this._CreateElement
			(
				"div",
				strControlDivId,
				0,
				0,
				_hshProperties["intIfrWidth"],
				_hshTopBarCss["height"],
				_hshTopBarCss["background"],
				this["_zIndex"]++,
				100
			);
			objCentreDiv.appendChild(objCtrDiv);

			// Create close link
			var objLink = document.createElement("a");
			objLink.setAttribute("href", "javascript:void(0);");
			var strWinId = _hshProperties["strWinId"];
			if (navigator.userAgent.indexOf("MSIE") != -1) objLink.onclick = function() {ShowPopup(strWinId)};
			else objLink.setAttribute("onclick", "return ShowPopup('"+strWinId+"');"); // For other browsers
			objLink["innerHTML"] = _hshProperties["strTopBarinnerHTML"];
			objLink["style"]["color"] = _hshProperties["hexTopBarAnchorColor"];
			objCtrDiv.appendChild(objLink);

			// Create box title
			if (_hshProperties["strTopBarTitle"] != undefined)
			{
				var objDiv = document.createElement("div");
				// objDiv["style"]["width"] = parseInt(_hshProperties["intIfrWidth"]/2)+"px";
				objDiv["style"]["height"] = _hshTopBarCss["height"]+"px";
				objDiv["style"]["textAlign"] = "left";
				objDiv["style"]["margin"] = _hshTopBarCss["margin"];
				objDiv["style"]["padding"] = _hshTopBarCss["padding"];
				objDiv["style"]["color"] = _hshTopBarCss["color"];
				objDiv["style"]["fontWeight"] = _hshTopBarCss["fontWeight"];
				objDiv["style"]["fontSize"] = _hshTopBarCss["fontSize"];

				objDiv["innerHTML"] = _hshProperties["strTopBarTitle"];
				objCtrDiv.appendChild(objDiv);
			}

			var objNewIfr = this._CreateElement
			(
				"iframe",
				strContainerIfrId,
				0,
				_hshTopBarCss["height"],
				_hshProperties["intIfrWidth"],
				_hshProperties["intIfrHeight"],
				"#fff",
				this["_zIndex"]++,
				100
			);
			objNewIfr.setAttribute("name", strContainerIfrId);
			objNewIfr.setAttribute("src", _hshProperties["strUrl"]);
			objNewIfr.setAttribute("scrolling", "auto");
			objNewIfr.setAttribute("frameborder", "0");
			objCentreDiv.appendChild(objNewIfr);

			_Tween();

			return false;
		}

		else // Switch display
		{
			// Get the body object
			// ... for IE6
			var standardbody = (document.compatMode=="CSS1Compat")?document.documentElement:document.body;

			// Reveal the scroll bar
			if (navigator.userAgent.indexOf("IE") != -1)
			{
				standardbody["style"]["overflow"] = "auto";
			}

			else
			{
				standardbody["style"]["overflowY"] = "scroll";
				// standardbody["style"]["overflowX"] = "scroll";
			}

			// Adjust right margin
			var intBodyMarginRight = (standardbody["style"]["marginRight"] != "")?parseInt(standardbody["style"]["marginRight"]):0;
			standardbody["style"]["marginRight"] = intBodyMarginRight - this["_intRightMarginWidth"]+"px";

			// Close and remove
			objContainerIfrId["src"] = ""; // Take out the iframe - causes problem with ie8
			document.body.removeChild(objCenterDiv);
			document.body.removeChild(objMasterDiv);

			return false;
		}
	}

	function _Tween()
	{
		if (objCentreDiv["offsetWidth"] < _hshProperties["intIfrWidth"])
		{
			// To avoid making width too great
			var intCurrWidth = 0;
			if ((objCentreDiv["offsetWidth"]+50) > _hshProperties["intIfrWidth"]) intCurrWidth = _hshProperties["intIfrWidth"];
			else intCurrWidth = parseInt(objCentreDiv["offsetWidth"]+50)

			// Make the width change
			objCentreDiv["style"]["width"] = intCurrWidth+"px";

			setTimeout(_Tween, 10);
		}

		else if (objCentreDiv["offsetHeight"] < parseInt(_hshTopBarCss["height"]+_hshProperties["intIfrHeight"]))
		{
			var intChange = 20;
			var intCurrHeight = 0;

			// Ease out tween
			var intCurrDiff = _hshProperties["intIfrHeight"] - (objCentreDiv["offsetHeight"]+intChange);
			if (intCurrDiff < 100 && intCounter < intChange)
			{
				intChange = intChange - intCounter;
				intCounter++;
			}

			// To avoid making height too great
			if ((objCentreDiv["offsetHeight"]+intChange) > _hshProperties["intIfrHeight"]) intCurrHeight = _hshProperties["intIfrHeight"];
			else intCurrHeight = parseInt(objCentreDiv["offsetHeight"]+intChange)

			// Make the height change
			objCentreDiv["style"]["height"] = intCurrHeight+"px";
			setTimeout(_Tween, 10);
		}

		else // Fall through - a final correction
		{
			objCentreDiv["style"]["height"] = parseInt(_hshTopBarCss["height"]+_hshProperties["intIfrHeight"])+"px";
			objCentreDiv["style"]["width"] = _hshProperties["intIfrWidth"]+"px";
			intCounter = 0;
		}
	}

	function _SetProperties(hshProperties)
	{
		_hshProperties = hshProperties;
	}

	function _SetTopBarCss(hshTopBarCss)
	{
		_hshTopBarCss = hshTopBarCss;
	}

	function _CreateElement(strElementType, strId, intLeft, intTop, intWidth, intHeight, strBackground, intZindex, intBackgroundOpacity)
	{
		var objPointer = document.createElement(strElementType);
		objPointer.setAttribute("id", strId);

		// Set these for all
		// Both following lines may be reset if necessary using the returned object
		objPointer["style"]["position"] = "absolute";
		objPointer["style"]["display"] = "block";

		// Style elements
		if (intLeft > 0) objPointer["style"]["left"] = intLeft+"px";
		else objPointer["style"]["left"] = intLeft;

		if (intTop > 0) objPointer["style"]["top"] = intTop+"px";
		else objPointer["style"]["top"] = intTop;

		objPointer["style"]["width"] = intWidth+"px";
		objPointer["style"]["height"] = intHeight+"px";
		objPointer["style"]["background"] = strBackground;
		objPointer["style"]["zIndex"] = intZindex;

		if (intBackgroundOpacity != 100)
		{
			objPointer["style"]["filter"] = "alpha(opacity="+intBackgroundOpacity+") Shadow(Color=#00FF00, Direction=225)";
			objPointer["style"]["-moz-opacity"] = "."+intBackgroundOpacity;
			objPointer["style"]["opacity"] = "."+intBackgroundOpacity;
			objPointer["style"]["-khtml-opacity"] = "0."+intBackgroundOpacity;
		}
		return objPointer;
	}

	function _GetWindowHeight()
	{
		var intHeight = 0;
		if( typeof( window.innerWidth) == "number")
		{
			intHeight = window.innerHeight;
		}

		else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
		{
			intHeight = document.documentElement.clientHeight;
		}

		else if(document.body && (document.body.clientWidth || document.body.clientHeight))
		{
			intHeight = document.body.clientHeight;
		}
		return intHeight;
	}

	function _GetWindowWidth()
	{
		var intWidth = 0;
		if( typeof( window.innerWidth) == "number")
		{
			intWidth = window.innerWidth;
		}

		else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
		{
			intWidth = document.documentElement.clientWidth;
		}

		else if(document.body && (document.body.clientWidth || document.body.clientHeight))
		{
			intWidth = document.body.clientWidth;
		}
		return intWidth;
	}

	//
	// OmniWeb 4.2-, NetFront 3.3- and Clue browser do not provide any way to do this.
	// Safari and OmniWeb 4.5+ have bugs that do not affect this script+, which return -8 if the scrolling is 0,
	// but get all other scrolling offsets correct. However, as they correctly provide window.pageXOffset/pageYOffset,
	// this function will not have any problems.
	//
	function GetScrollXY()
	{
		var scrOfX = 0, scrOfY = 0;

		//Netscape compliant
		if( typeof( window.pageYOffset ) == 'number' )
		{
			scrOfY = window.pageYOffset;
			scrOfX = window.pageXOffset;
		}

		//DOM compliant
		else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
		{
			scrOfY = document.body.scrollTop;
			scrOfX = document.body.scrollLeft;
		}

		//IE6 standards compliant mode
		else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
		{
			scrOfY = document.documentElement.scrollTop;
			scrOfX = document.documentElement.scrollLeft;
		}
		return [scrOfX, scrOfY];
	}

	return false;
}

//
// Get the height of the working window for any browser
// Generic
//
function GetWindowHeight()
{
	var intHeight = 0;
	if( typeof( window.innerWidth) == "number")
	{
		intHeight= window.innerHeight;
	}

	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
	{
		intHeight= document.documentElement.clientHeight;
	}

	else if(document.body && (document.body.clientWidth || document.body.clientHeight))
	{
		intHeight= document.body.clientHeight;
	}
	return intHeight;

}

function GetWindowWidth()
{
	var intWidth = 0;
	if( typeof( window.innerWidth) == "number")
	{
		intWidth= window.innerWidth;
	}

	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
	{
		intWidth= document.documentElement.clientWidth;
	}

	else if(document.body && (document.body.clientWidth || document.body.clientHeight))
	{
		intWidth= document.body.clientWidth;
	}
	return intWidth;

}

function CreateElement(strElementType, strId, intLeft, intTop, intWidth, intHeight, strBackground, intZindex, intBackgroundOpacity)
{
	var objPointer = document.createElement(strElementType);
	objPointer.setAttribute("id", strId);

	// Set these for all
	// Both following lines may be reset if necessary using the returned object
	objPointer["style"]["position"] = "absolute";
	objPointer["style"]["display"] = "block";

	// Style elements
	if (intLeft > 0) objPointer["style"]["left"] = intLeft+"px";
	else objPointer["style"]["left"] = intLeft;

	if (intTop > 0) objPointer["style"]["top"] = intTop+"px";
	else objPointer["style"]["top"] = intTop;

	objPointer["style"]["width"] = intWidth+"px";
	objPointer["style"]["height"] = intHeight+"px";
	objPointer["style"]["background"] = strBackground;
	objPointer["style"]["zIndex"] = intZindex;

	if (intBackgroundOpacity != 100)
	{
		objPointer["style"]["filter"] = "alpha(opacity="+intBackgroundOpacity+") Shadow(Color=#00FF00, Direction=225)";
		objPointer["style"]["-moz-opacity"] = "."+intBackgroundOpacity;
		objPointer["style"]["opacity"] = "."+intBackgroundOpacity;
		objPointer["style"]["-khtml-opacity"] = "0."+intBackgroundOpacity;
	}
	return objPointer;

}

//
// Typical Usage
//
/*
var page = new PageQuery(location.search);
var myValue = page.getValue("a");
if (myValue == "-1") myValue = "history.html";
*/
function PageQuery(q)
{
	if(q.length > 1) this.q = q.substring(1, q.length);
	else this.q = null;
	this.keyValuePairs = new Array();
	if(q)
	{
		for(var i=0; i < this.q.split("&").length; i++)
		{
			this.keyValuePairs[i] = this.q.split("&")[i];
		}
	}
	this.getKeyValuePairs = function() { return this.keyValuePairs; }
	this.getValue = function(s) {
		for(var j=0; j < this.keyValuePairs.length; j++)
		{
			if(this.keyValuePairs[j].split("=")[0] == s)
				return this.keyValuePairs[j].split("=")[1];
		}
		return -1;
	}
	this.getParameters = function()
	{
		var a = new Array(this.getLength());
		for(var j=0; j < this.keyValuePairs.length; j++)
		{
			a[j] = this.keyValuePairs[j].split("=")[0];
		}
		return a;
	}
     this.getLength = function() { return this.keyValuePairs.length; }
}

