	function GetElement(ElementID)
	{
		var element = null;
		if (document.getElementById)
		{
			element = document.getElementById(ElementID);
		}
		else if (document.all)
		{
			element = document.all[ElementID];
		}
		else if (document.layers)
		{
			element = document.layers[ElementID];
		}
		return element;
	}
	
	
	function GetElementTop(obj) 
	{
		var top = 0;
		if (obj.offsetParent) {
			top = obj.offsetTop
			while (obj = obj.offsetParent) {
				top += obj.offsetTop
			}
		}
		return top;
	}

	function GetWindowHeight()
	{
		var height = 0;
		if (window.innerHeight)
		{
			height = window.innerHeight;
		}
		else if (document.documentElement.clientHeight)
		{
			height = document.documentElement.clientHeight;
		}
		else if (document.body.clientHeight)
		{
			height = document.body.clientHeight;
		}
		return height;
	}

	function GetWindowVerticalScroll() 
	{
		var scroll = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {
			scroll = window.pageYOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			scroll = document.body.scrollTop;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
			scroll = document.documentElement.scrollTop;
		}
		return scroll;
	}
		
	function SetQueryStringValue(rawQueryString, key, value)
	{
		var returnVal = "";
		if (!rawQueryString)
		{
			returnVal = key + "=" + value;
		}
		else
		{
			if (rawQueryString.indexOf(key + "=") == -1)
			{
				returnVal =  rawQueryString + "&" + key + "=" + value;
			}
			else
			{
				var qsValues = rawQueryString.split("&");
				var i=0;
				while (i < qsValues.length)
				{
					var item = qsValues[i].split("=");
					if (item[0] == key)
					{
						qsValues[i] = key + "=" +  value;
					}
					i +=1;
				}
				returnVal = qsValues.join("&");
			}
		}
		return returnVal;
	}
	
	// Displays hourglass cursor
	function showWaitCursor()
	{			
		document.body.style.cursor = 'wait';
	}