//shared global vars
_jhtml = new Array();


//Global vars
_sp = new Array();
_spop = new Array();
_spL = null;
_wlc = String(window.location);
_futuredate = new Date(Date.parse("Jan 1, 2999"));

_aGn = new String(navigator.userAgent);
_aGn = _aGn.toLowerCase();
_deskL = screen.width;
_deskT = screen.height;

_hsT = location.host;
_hsP = location.pathname;
_hspro = location.protocol;
_BASE = _hspro+"//"+_hsT+"/";
ali = null;

function alilg()
{
	this._j2htm = function(item)
	{
		if(_e(item))
		_e(item).innerHTML = _jhtml[item];
	}
	this.webtop = function(item)
	{
		alert('Loading my alilg-webtop');
	}
	this.access = function(ITEM,H,W,ID,URL)
	{
		var L = (_deskL-W)/2;
		var T = (_deskT-H)/4;
		T = T - 30;
		
		ITFOLDER = "loader.php?gd="+ITEM+"&&IGD="+ID;
		
		var _newin = window.open(ITFOLDER,"carstreetracingamesgameno"+ITEM, "menubar=no,width="+W+"px,height="+H+"px,toolbar=no,status=yes,resizable=no,top="+T+"px,left="+L+"px,scrollable=no,location=no,addressbar=no");
		if(!_newin)
		{
			this.popupblocked(ITEM)
		}
		else
		{
			//_newin.window.focus()
		}
	}
	
	this.popupblocked = function(item)
	{
		alert(item+" popup box blocked by your popup clock blocker, please turn it off and try again")
	}
	this._jmenu = function(targ,selObj,restore)
	{
		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		if(restore)
		{
			selObj.selectedIndex=0;
		}
	}
	this.readmore = function()
	{
		
	}
	
	this.download = function(item, _id)
	{
		if(item.toLowerCase() == 'alinegar')
		{
			window.location = _BASE+'win_software.php?download=1&&id='+_id;
			return;
		}
		_e('tos').innerHTML = _jhtml['loading'];
		this.ajax(_BASE+"software.php?term="+item, "http", "DOWN_tos", "get");
	}
	
	this.downloaded = function()
	{
		_e('SBT').disabled = 'disabled';
		_e('SBT').value='Downloading...';
		setTimeout('_e(\'SBT\').style.backgroundImage=\'url(img/span_bt_bg_down.gif)\'',100)
	}
	
	this.clear = function()
	{
		ssession('cmname', "", new Date(0), "/");
		ssession('cmhome', "", new Date(0), "/");
		ssession('remme', "nope", _futuredate, "/");
		_e('cmname').value = "";
		_e('cmhome').value = "";
		_e('remme').checked = "";
	}
	


	this.ajaxto = function(item, _c)
	{
		if(item == "favc")
		{
			aliFA.favc(_c);
		}
		else if(item == "DOWN_tos")
		{
			_e('tos').innerHTML = _c;
			_e('tos').scrollIntoView();
		}
	}
	


	this.los = function(item)
	{
		return item.toLowerCase();
	}
	
	this.get_http = function()
	{
		if (typeof XMLHttpRequest != "undefined")
		{
			return new XMLHttpRequest();
		}
		else if (window.ActiveXObject)
		{
			var aVersions = [ "MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];
			for (var i = 0; i < aVersions.length; i++)
			{
				try {	var oXmlHttp = new ActiveXObject(aVersions[i]);
				return oXmlHttp;
				} catch (oError)
				{
					
				}
			}
		}
		else
		{
			alert("NO XML SUPPORT");
			return;
		}
	}
	
	this.iexml = function()
	{
		var aVersions = [ "MSXML2.DOMDocument.5.0", "MSXML2.DOMDocument.4.0", 
						 " MSXML2.DOMDocument.3.0", "MSXML2.DOMDocument"," Microsoft.XmlDom"];
		for (var i = 0; i < aVersions.length; i++)
		{
			try
			{
				var oXmlDom = new ActiveXObject(aVersions[i]);
				return oXmlDom;
			}
			catch (oError)
			{
				
			}
		}
		throw new Error("MSXML is not installed.");
	}
	
	this.ajax = function(xml_url, kind, ajaxfor, method)
	{
		this._kind = kind;
		this._ajaxfor = ajaxfor;
		XMLOBJECT = new this.get_http();
		
		XMLOBJECT.open(method, xml_url, true);
		if(method=="post")
		{
			XMLOBJECT.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		}
		
		
		XMLOBJECT.onreadystatechange = function ()
		{
			if (XMLOBJECT.readyState == 4)
			{
				if (XMLOBJECT.status == 200)
				{
					if(method == "get")
					{
					if(ali._kind == "http")
					{
						var ajaxed = XMLOBJECT.responseText;
					}
					else if(ali._kind == "xml")
					{
						if(_aGn.indexOf("msie") != -1 && _aGn.indexOf("opera") == -1)
						{
							var ajaxed = ali.iexml();
							ajaxed.loadXML(XMLOBJECT.responseText);
						}
						else
						{
							var ajaxed = XMLOBJECT.responseXML;
						}
					}
					}
					else
					{
						if(_aGn.indexOf("msie") != -1 && _aGn.indexOf("opera") == -1)
						{
							var ajaxed = ali.iexml();
							ajaxed.loadXML(XMLOBJECT.responseText);
						}
						else
						{
							var ajaxed = XMLOBJECT.responseXML;
						}
					}
					ali.ajaxto(ali._ajaxfor, ajaxed);
				}
			}
		}
		if(method == "get")
		{
			var narenjack = null;
		}
		else
		{
			var rrm = document.forms[0];
			var m = grb(rrm);
			var narenjack = m;
		}
		XMLOBJECT.send(narenjack);
	}
	
	var cWL = encodeURI(_wlc);
}

function alilg_pub()
{
	return "pub-6989666508364537";
}

function _e(item)
{
	var _i = document.getElementById(item);
	return _i;
}

function body_onload()
{
	ali = new alilg();
	//ali._j2htm('sponsor');
	//ali._j2htm('copyright');
	//ali._j2htm('myims');
}

$redofadeOBJ = null;
$redofade_NO = 0;


_jhtml['copyright'] = 'Copyright &copy; 2006-2009 <a href="http://www.alilg.com">AlilG Application</a> | All Rights Reserved by <a href="http://www.alilg.com/forums/user319.html">Ali Razavi</a><br />The page Validates AS <a href="http://validator.w3.org/check?uri=referer">XHTML 1.0</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS2</a> | Transitional';

_jhtml['sponsor'] = ''
		+ 'affordable <a href="http://www.dotservant.com/">web Hosting</a> with professional '
		+ '<a href="http://www.dotservant.com/php-hosting.shtml">PHP Hosting</a> support and user friendly<br />'
		+ '<span style="margin-left:20px;"><a href="http://www.dotservant.com/cpanel-hosting.shtml">Cpanel Hosting</a> control panel'
		+ ' compatible with popular CMS <a href="http://www.dotservant.com/website-hosting.shtml">website hosting</a> and </span><br /><span style="margin-left:40px;">allow multiple '
		+ '<a href="http://www.dotservant.com/domain-hosting.shtml">domain hosting</a> in single hosting account. '
		+ '<a href="http://www.boot5.com/">domain name registration at $15/year</a></span>';

_jhtml['loading'] = '<div style="padding:5px;" align="left"><img src="img/loading.gif" alt="" align="middle" /> Getting contents... please wait!</div>'

_jhtml['myims'] = '<div style="padding:3px">'
+ '<a href="ymsgr:sendim?alilg.tmnt"><img src="http://mail.opi.yahoo.com/online?u=alilg.tmnt&m=g&t=2" alt="" /></a></div>'
			+ '<br />'
			+ '<div style="width:auto;height:25px;">'
			+ '<div style="float:left"><img src="img/yahoo.gif" alt="" align="top" /></div>'
			+ '<div style="float:left;margin-left:4px;margin-top:0px;">Yahoo ID: <input type="text" value="alilg.tmnt" style="border:solid 1px #E3E3E3;padding:1px;color:#999992" readonly="readonly" onclick="this.select()" /></div></div>'
			+ '<div style="width:auto;height:25px;" align="left">'
			+ '<div style="float:left" align="left"><img src="img/aim.gif" alt="" align="top" /></div>'
			+ '<div style="float:left;margin-left:4px;margin-top:0px;">AOL ID: <input type="text" value="alilgtmnt" style="border:solid 1px #E3E3E3;padding:1px;color:#999992" readonly="readonly" onclick="this.select()" /></div></div>'
			+ '<div style="width:auto;height:25px;">'
			+ '<div style="float:left"><img src="img/google-talk.gif" alt="" align="top" /></div>'
			+ '<div style="float:left;margin-left:4px;margin-top:0px;">Google-Talk ID: <input type="text" value="alilg.tmnt" style="border:solid 1px #E3E3E3;padding:1px;color:#999992" readonly="readonly" onclick="this.select()" /></div></div>'
+ '<div style="width:auto;height:23px;">'
			+ '<div style="float:left"><img src="img/skype.gif" alt="" align="top" /></div>'
			+ '<div style="float:left;margin-left:4px;margin-top:0px;">Skype ID: <input type="text" value="alilg.tmnt" style="border:solid 1px #E3E3E3;padding:1px;color:#999992" readonly="readonly" onclick="this.select()" /></div></div>';