	function Fire(url)
	{
		var oRequest = getXMLHttpRequest();

		var bSSL = false
		var sURL = (bSSL ? "https://" : "http://") + self.location.hostname + (bSSL ? "/sldbaracing" : "") + url
		var obj

		oRequest.open("GET", sURL, false); // false = wait, true = dont wait
		oRequest.setRequestHeader("User-Agent", navigator.userAgent);
		oRequest.send(null);
	
		if (oRequest.status == 200)
		{
			return oRequest.responseText
		}
		else
		{
			return oRequest.responseText
		}
	}
	function getXMLHttpRequest() 
	{
		var obj;

			if (window.XMLHttpRequest)
			obj = new window.XMLHttpRequest;
			else
		{
			try
			{
				obj = new ActiveXObject("MSXML2.XMLHTTP.2.0");
			}
			catch(ex)
			{
				obj = null;
			}
			}
		if (obj == null)
			alert("Your browser is not supported.\n\nThis form has been tested with and supports:\nInternet Explorer 7.x\nInternet Explorer 8.x\nMozilla FireFox 3.5\nApple Safari 3.x\nGoogle Chrome\n\nIf you are already using one of these browsers, please verify that you have javascript enabled.");

		return obj;

	}
	function Convert2HexString(tweet)
	{
		var ndx = 0, asciiValue, outstr = "", hx
		for (ndx = 0; ndx < tweet.length; ndx++)
		{
			asciiValue = tweet.charCodeAt(ndx)
			hx = d2h(asciiValue)
			hx = digits(hx, 2)
			outstr = outstr + "%" + hx
		}
		return outstr
	}

	function Convert2String(hexstring)
	{
		if (hexstring == null)
			return null;

		var ndx = 0, asciiValue, outstr = "", dc

		var regexpChars = /\%[0-9a-f][0-9a-f]/ig
		var matches = hexstring.match(regexpChars)

		for (ndx = 0; ndx < matches.length; ndx++)
		{
			dc = h2d(matches[ndx].right(2))
			outstr += String.fromCharCode(dc)
		}
		return outstr
	}

	function digits(v, n)
	{
		while (v.length < n)
		{
			v = "0" + v
		}
		return v
	}
	function findPos(obj)
	{
		var curleft = curtop = 0;
		if (obj.offsetParent)
		{
			do
			{
				curleft += obj.offsetLeft;
				curtop += obj.offsetTop;
			} while (obj = obj.offsetParent);

			return [curleft, curtop];
		}
		else
			return [-1, -1];
	}

	function ShowHelp(element, typ)
	{
		if (document.getElementById("helpWindow") != undefined) return;
		var url = "/admin/GetHelp.asp?typ=" + typ + "&"
		var helpWindow = document.createElement("div")
		var helpID = "helpWindow"
		var one = document.getElementById("1")
		var parent = one.parentNode
		parent.appendChild(helpWindow)
		helpWindow.setAttribute("id", helpID)

		n = findPos(element)

		helpWindow.style.position = "absolute"
		helpWindow.style.left = (n[0] + 10).toString() + "px"
		helpWindow.style.top = (n[1] - 300).toString() + "px"
		helpWindow.style.width = "400px"
		helpWindow.style.height = "300px"
		helpWindow.style.display = "inline"
		helpWindow.style.zIndex = "10000"
		helpWindow.style.background = "white"
		helpWindow.style.color = "black"
		helpWindow.style.border = "outset 3pt"
		helpWindow.style.fontFamily = "arial"
		helpWindow.style.fontSize = "8pt"
		helpWindow.style.fontWeight = "normal"
		helpWindow.style.visibility = "visible"

		var hWnd = document.getElementById("helpWindow")

		var result = Fire(url)
		if (result.length > 0)
			hWnd.innerHTML = result
		else
			hWnd.innerHTML = "Page Not Found"
	}

	function CloseHelp()
	{
		var helpWindow = document.getElementById("helpWindow")
		var parent = helpWindow.parentNode;

		parent.removeChild(helpWindow);
	}

	String.prototype.ltrim = function(){return this.replace(/^\s+/,"");}
	String.prototype.rtrim = function(){return this.replace(/\s+$/,"");}
	String.prototype.trim = function(){var str = this.ltrim();return str.rtrim();}
	String.prototype.right = function(n){return this.substring(this.length - n, this.length)}
	String.prototype.left = function(n) { return this.substring(0, n); }
	function pageHeight(){return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;}
	function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;} 
	function d2h(d) {return d.toString(16);}
	function h2d(h) {return parseInt(h,16);} 
