/*
    Version Control
    $URL: http://svn.quru/bonhams/Progress/Release/www/pubjs/urlParse.js $
    Last Changed: $Date: 2009-09-25 16:22:34 +0100 (Fri, 25 Sep 2009) $ $Rev: 2193 $ by $Author: lee $
*/
var msPairs = new Array();
if ((document.location.search.indexOf("?") > -1) && (document.location.search.length > 1))
	msPairs = document.location.search.substr(1).split("&");

function getParam(sTag)
{
var iPos;
	
	for (iTag = 0; iTag < msPairs.length; iTag++)
	{
		iPos = msPairs[iTag].indexOf("=");
		if ((iPos > 0) && (iPos < (msPairs[iTag].length - 1)))
		{
			if (msPairs[iTag].substr(0, iPos) == sTag)
				return msPairs[iTag].substr(iPos + 1);
		}
	}

	return "";
}

function appendParams(sURL)
{
	if (sURL.indexOf("?") == -1)
		return (sURL + document.location.search);

	if ((document.location.search.indexOf("?") == -1) || (document.location.search.length < 2))
		return sURL;

	return (sURL + "&" + document.location.search.substr(1));
}
