log = new Image(); log.src = "http://www5.addfreestats.com/cgi-bin/connect.cgi?usr=00523761Pauto&js=1&title=" + escape(window.document.URL) + "&url=" + escape(window.document.URL) + "&refer=" + escape(document.referrer) + "&rand=" + Math.floor(Math.random()*99999999);

function GetXmlHttpObject ()
{
	var xmlHttp = null;

	try
	{
		xmlHttp = new XMLHttpRequest();
	}
	catch(e)
	{
        	try
		{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}

	return xmlHttp;
}

function post (url, param, success_function)
{
	xmlHttp = GetXmlHttpObject();
	if (xmlHttp == null)
	{
		return
	}

	xmlHttp.onreadystatechange = success_function;
	xmlHttp.open("POST", url, true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.send(param);
}

function roratead (type)
{
	document.write(getad(type));
}

function getad (type)
{
	var ad = '';

	if (!window.ads)
	{
		window.ads = [];
		window.ads['728x90'] = [
					'<iframe src="http://www.bannerflux.com/work.php?n=2343&amp;size=12&amp;c=1-3-2" width="728" height="90" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>',
					'<iframe src="http://www.bannerflux.com/work.php?n=2343&amp;size=12&amp;c=1-3-2" width="728" height="90" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>'
				];

		window.ads['160x600'] = [
					'<iframe src="http://www.bannerflux.com/work.php?n=2343&amp;size=13&amp;c=1-3-2" width="160" height="600" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>',
					'<iframe src="http://www.bannerflux.com/work.php?n=2343&amp;size=13&amp;c=1-3-2" width="160" height="600" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>'
				];

		window.ads['300x250'] = [
					'<iframe src="http://www.bannerflux.com/work.php?n=2343&amp;size=11&amp;c=1-3-2" width="300" height="250" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>',
					'<iframe src="http://www.bannerflux.com/work.php?n=2343&amp;size=11&amp;c=1-3-2" width="300" height="250" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>'
				];

		window.ads['skin'] = [
					'<iframe src="http://www.bannerflux.com/work.php?n=2343&amp;size=13&amp;c=1-3-2" width="160" height="600" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>',
					'<iframe src="http://www.bannerflux.com/work.php?n=2343&amp;size=13&amp;c=1-3-2" width="160" height="600" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>'
				];
	}

	if (ads[type].length>0)
	{
		var key = Math.round (Math.random () * (ads[type].length-1));
		return ads[type].splice (key, 1);
	}
}

function skinads()
{
	var sa_width = 1003;
	var sa_offset_top = 110;
	var sa_offset_left = 10;
	var sa_offset_right = 10;
	var sa_ad_right = 1;
	var sa_ad_left = 1;
	var sa_ad_scroll = 1;
	var sa_ad_width = 160;
	var sa_ad_height = 600;

	var width = Math.round((screen.width-sa_width)/2);

	if (width<160+sa_offset_left) sa_ad_left = 0;
	if (width<160+sa_offset_right) sa_ad_right = 0;

	if (sa_ad_left==1 || sa_ad_right==1)
	{
		var sa_ad_pos_left = Math.round((sa_width)/2)+sa_ad_width+sa_offset_left;
		var sa_ad_pos_right = Math.round((sa_width)/2)+sa_offset_right;
		var pos = 'absolute';

		if (sa_ad_scroll==0)
		{
			pos = 'fixed';
		}

		sa_str  = '';
		sa_str += '<div style="visibility: hidden; position: '+pos+'; overflow: hidden; width: 100%; height: '+sa_ad_height+'px; left: 0px; top: '+sa_offset_top+'px;">';

		if (sa_ad_left==1)
		{
			sa_str += '<div style="visibility: visible; position: absolute; left: 50%; margin-left: -'+sa_ad_pos_left+'px">'+getad('skin')+'</div>';
		}

		if (sa_ad_right==1)
		{
			sa_str += '<div style="visibility: visible; position: absolute; left: 50%; margin-left: '+sa_ad_pos_right+'px">'+getad('skin')+'</div>';
		}

		sa_str += '</div>';

		document.write (sa_str);
	}
}
