	var mousePosition = [0,0];
	if (typeof Fire == "undefined")
	{
		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
			}
		}
	}
	if (typeof getXMLHttpRequest == "undefined")
	{
		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 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);
	}

	function getMousePosition(e) 
	{
		var _x;
		var _y;
		if (!isIE) {
			_x = e.pageX;
			_y = e.pageY;
		}
		if (isIE) {
			_x = event.clientX + document.body.scrollLeft;
			_y = event.clientY + document.body.scrollTop;
		}
		mousePosition = [_x, _y];
		window.status = "[" + _x + ", " + _y + "]";
		return true;
	}

	function createCookie(name,value,hours) 
	{
		if (hours) 
		{
			var date = new Date();
			date.setTime(date.getTime()+(hours*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else 
		{
			var expires = "";
		}
		document.cookie = name+"="+value+expires+"; path=/";
	}
	function removeCookie(name)
	{
		var date = new Date();
		date.setTime(date.getTime() - (1000*60*60*24))
		var expires = "; expires="+date.toGMTString();
		document.cookie = name+"=''"+expires+"; path=/";
	}
	if(typeof imageFailure == "undefined") function imageFailure(img) { img.style.display = "none"; }
	if(typeof isIE == "undefined") function isIE() { return document.all?true:false;}
	if(typeof pageHeight == "undefined") function pageHeight(){return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;}
	if(typeof pageWidth == "undefined") function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;} 
	if(typeof String.prototype.ltrim == "undefined") String.prototype.ltrim = function(){return this.replace(/^\s+/,"");}
	if(typeof String.prototype.rtrim == "undefined") String.prototype.rtrim = function(){return this.replace(/\s+$/,"");}
	if(typeof String.prototype.trim == "undefined") String.prototype.trim = function(){var str = this.ltrim();return str.rtrim();}
	if(typeof String.prototype.right == "undefined") String.prototype.right = function(n){return this.substring(this.length - n, this.length)}
	if(typeof String.prototype.left == "undefined") String.prototype.left = function(n) { return this.substring(0, n); }
	if(typeof String.prototype.int == "undefined") String.prototype.int = function () { return parseInt(this, 10); }
	if(typeof String.prototype.digits == "undefined") String.prototype.digits = function (n) { return digits(this, n); }
	if(typeof d2h == "undefined") function d2h(d) {return d.toString(16);}
	if(typeof h2d == "undefined") function h2d(h) {return parseInt(h,16);} 
	if(typeof Convert2HexString == "undefined") function Convert2HexString(str) { var ndx = 0, asciiValue, outstr = "", hx; for (ndx = 0; ndx < str.length; ndx++) { asciiValue = str.charCodeAt(ndx); hx = d2h(asciiValue); hx = digits(hx, 2); outstr = outstr + "%" + hx; } return outstr; } 
	if(typeof Convert2String == "undefined") 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; } 
	if(typeof digits == "undefined") function digits(v, n) { while (v.length < n) { v = "0" + v; } return v; }
  if(typeof getPos == "undefined") function getPos(obj, direction, additional) { var curleft = curtop = rtn = 0; if (obj.offsetParent) { do { curleft += obj.offsetLeft; curtop += obj.offsetTop; } while (obj = obj.offsetParent); switch (direction.toLowerCase()) { case "left": case "right": rtn = curleft + additional; break; case "top": case "bottom": rtn = curtop + additional; break; } return rtn; } else return 0; } 
	if(typeof findPos == "undefined") 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]; }
	if(typeof findDim == "undefined") function findDim(obj) { return [obj.clientWidth, obj.clientHeight]; }
	if(typeof getSize == "undefined") function getSize(obj) { return [obj.clientWidth, obj.clientHeight]; }
	if(typeof String.prototype.encode == "undefined") String.prototype.encode = function ()
	                                                                            {
																																								var x = 0, newStr = ""
																																								for (x = 0; x < this.length; x++)
																																								{
																																									newStr += "%" + d2h(this.charCodeAt(x)).digits(2);
																																								}
																																								return newStr;
																																							}
	if(typeof center == "undefined") function center(obj)
	                                 {
																			var x, y;
																			var width, height;

																			width = parseInt(obj.style.width.left(obj.style.width.length - 2), 10);
																			height = parseInt(obj.style.height.left(obj.style.height.length - 2), 10);

																			x = (pageWidth() - width) / 2;
																			y = (pageHeight() - height) / 2;
																			obj.style.position = "absolute";
																			obj.style.left = x;
																			obj.style.top = y;
																	 }
	if (typeof String.prototype.debugSave == "undefined")
	{
		String.prototype.debugSave = function (str)
		                             {
																		var url = "/admin/ajax/saveURL.asp?url=" + str.Convert2HexString() + "&"
																		Fire(url)
																		return (url)
																 }
	}

function getScrollXY() {
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	return [ scrOfX, scrOfY ];
}

