var asxmlhttp = function()
{
	this.getXMLHttpRequest = function()
	{
		try
		{
			return new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				return new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				try
				{
					return new XMLHttpRequest();
				}
				catch (e)
				{
					top.document.location.href = "/";
				}
			}
		}

		return null;
	}

	this.go = function(callerObj, actionURL, sendmethod, datatosend)
	{
	    datatosend = datatosend + "&___t___=" + (new Date()).getTime();
		try
		{
			var xmlhttp = this.getXMLHttpRequest();

			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
					callerObj.doready(xmlhttp);
				}
			}

			if (sendmethod.toUpperCase() == "POST")
			{
				xmlhttp.open("POST", actionURL, true); // false = wait // true = don't wait
				xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			}
			else
			{
				xmlhttp.open("GET", actionURL, true); // false = wait // true = don't wait
			}

			xmlhttp.send(datatosend);
			return true;
		}
		catch (e)
		{
			return false;
		}
	}
}
function getTotalWeight(arr)
{
	var len = arr.length;
	var tot = 0;
	for (var i = 0; i < len; i++)
	{
		tot += parseInt(arr[i][1]);
	}

	return parseInt(tot);
}

function getAdIndex(arr, n)
{
	var len = arr.length;
	var t = 0;
	var r = parseInt(n);
	for (var i = 0; i < len; i++)
	{
		t += parseInt(arr[i][1]);
		if (r <= t)
		{
			return i;
		}
	}
	return 0;
}
var ads_videoside = new Array();
var ads_728x90 = new Array();
var ads_728x90gay = new Array();
var ads_728x90female = new Array();
var ads_500x300 = new Array();
var ads_468x60 = new Array();
var ads_120x600 = new Array();
var ads_120x240 = new Array();
var ads_120x120 = new Array();
var ads_250x250 = new Array();
var ads_250x250_2 = new Array();
var ads_footerads = new Array();
var ads_text1_1 = new Array();
var ads_text1_2 = new Array();
var ads_text1_3 = new Array();
var ads_text1_4 = new Array();
var ads_text2_1 = new Array();
var ads_text2_2 = new Array();
var ads_text2_3 = new Array();
var ads_text2_4 = new Array();
var ads_message_center = new Array();
var ads_mrc468x60 = new Array();
var ads_mio468x60 = new Array();
var ads_p468x60 = new Array();
var ads_m120x460 = new Array();
var ads_navigation = new Array();
var ads_video = new Array();
var ads_lola468x60 = new Array();
var ads_lola728x90 = new Array();
var ads_lola240x120 = new Array();
ads_728x90.push(new Array(439, 100, "<iframe id='aae4f6bd' name='aae4f6bd' src='http://ads.shanoogle.com/www/delivery/afr.php?zoneid=3&target=_blank&cb=&ct0=' framespacing='0' frameborder='no' scrolling='no' width='728' height='90' allowtransparency='true'><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=a44aa786&cb=' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=3&cb=&n=a44aa786&ct0=' border='0' alt='' /></a></iframe><br>\r\n<div style=&quot;overflow:hidden; font-size:11px; font-weight:normal; margin:0; padding:5px 0; line-height:16px; text-decoration:none; color:#999; text-align:center;&quot;>\r\n						<a href=&quot;http://www.adultspace.com/advertise_with_us.html&quot; style=&quot;text-decoration:underline; color:#777;&quot;>Adultspace Ads</a> | <a href=&quot;http://www.adultspace.com/vip_membership.html&quot; style=&quot;text-decoration:underline; color:#cf4376;&quot;>Hide</a>\r\n					</div>"));
		ads_728x90gay.push(new Array(460, 100, "<!--/* OpenX Javascript Tag v2.8.1 */-->\r\n\r\n<script type='text/javascript'><!--//<![CDATA[\r\n   var m3_u = (location.protocol=='https:'?'https://ads.shanoogle.com/www/delivery/ajs.php':'http://ads.shanoogle.com/www/delivery/ajs.php');\r\n   var m3_r = Math.floor(Math.random()*99999999999);\r\n   if (!document.MAX_used) document.MAX_used = ',';\r\n   document.write (&quot;<scr&quot;+&quot;ipt type='text/javascript' src='&quot;+m3_u);\r\n   document.write (&quot;?zoneid=76&target=_blank&quot;);\r\n   document.write ('&cb=' + m3_r);\r\n   if (document.MAX_used != ',') document.write (&quot;&exclude=&quot; + document.MAX_used);\r\n   document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));\r\n   document.write (&quot;&loc=&quot; + escape(window.location));\r\n   if (document.referrer) document.write (&quot;&referer=&quot; + escape(document.referrer));\r\n   if (document.context) document.write (&quot;&context=&quot; + escape(document.context));\r\n   if (document.mmm_fo) document.write (&quot;&mmm_fo=1&quot;);\r\n   document.write (&quot;'><\/scr&quot;+&quot;ipt>&quot;);\r\n//]]>--></script><noscript><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=adf55ebd&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=76&cb=INSERT_RANDOM_NUMBER_HERE&n=adf55ebd' border='0' alt='' /></a></noscript>"));
		ads_728x90female.push(new Array(461, 100, "<!--/* OpenX Javascript Tag v2.8.1 */-->\r\n\r\n<script type='text/javascript'><!--//<![CDATA[\r\n   var m3_u = (location.protocol=='https:'?'https://ads.shanoogle.com/www/delivery/ajs.php':'http://ads.shanoogle.com/www/delivery/ajs.php');\r\n   var m3_r = Math.floor(Math.random()*99999999999);\r\n   if (!document.MAX_used) document.MAX_used = ',';\r\n   document.write (&quot;<scr&quot;+&quot;ipt type='text/javascript' src='&quot;+m3_u);\r\n   document.write (&quot;?zoneid=78&target=_blank&quot;);\r\n   document.write ('&cb=' + m3_r);\r\n   if (document.MAX_used != ',') document.write (&quot;&exclude=&quot; + document.MAX_used);\r\n   document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));\r\n   document.write (&quot;&loc=&quot; + escape(window.location));\r\n   if (document.referrer) document.write (&quot;&referer=&quot; + escape(document.referrer));\r\n   if (document.context) document.write (&quot;&context=&quot; + escape(document.context));\r\n   if (document.mmm_fo) document.write (&quot;&mmm_fo=1&quot;);\r\n   document.write (&quot;'><\/scr&quot;+&quot;ipt>&quot;);\r\n//]]>--></script><noscript><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=afeccdbd&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=78&cb=INSERT_RANDOM_NUMBER_HERE&n=afeccdbd' border='0' alt='' /></a></noscript>"));
		ads_500x300.push(new Array(436, 100, "<script type='text/javascript'><!--//<![CDATA[\r\n   document.MAX_ct0 ='';\r\n\r\n   var m3_u = (location.protocol=='https:'?'https://ads.shanoogle.com/www/delivery/ajs.php':'http://ads.shanoogle.com/www/delivery/ajs.php');\r\n   var m3_r = Math.floor(Math.random()*99999999999);\r\n   if (!document.MAX_used) document.MAX_used = ',';\r\n   document.write (&quot;<scr&quot;+&quot;ipt type='text/javascript' src='&quot;+m3_u);\r\n   document.write (&quot;?zoneid=14&quot;);\r\n   document.write ('&cb=' + m3_r);\r\n   if (document.MAX_used != ',') document.write (&quot;&exclude=&quot; + document.MAX_used);\r\n   document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));\r\n   document.write (&quot;&loc=&quot; + escape(window.location));\r\n   if (document.referrer) document.write (&quot;&referer=&quot; + escape(document.referrer));\r\n   if (document.context) document.write (&quot;&context=&quot; + escape(document.context));\r\n   if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {\r\n       document.write (&quot;&ct0=&quot; + escape(document.MAX_ct0));\r\n   }\r\n   if (document.mmm_fo) document.write (&quot;&mmm_fo=1&quot;);\r\n   document.write (&quot;'><\/scr&quot;+&quot;ipt>&quot;);\r\n//]]>--></script><noscript><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=a36850dc&cb=' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=14&cb=&n=a36850dc&ct0=' border='0' alt='' /></a></noscript>"));
		ads_468x60.push(new Array(442, 100, "<script type='text/javascript'><!--//<![CDATA[\r\n   document.MAX_ct0 ='';\r\n\r\n   var m3_u = (location.protocol=='https:'?'https://ads.shanoogle.com/www/delivery/ajs.php':'http://ads.shanoogle.com/www/delivery/ajs.php');\r\n   var m3_r = Math.floor(Math.random()*99999999999);\r\n   if (!document.MAX_used) document.MAX_used = ',';\r\n   document.write (&quot;<scr&quot;+&quot;ipt type='text/javascript' src='&quot;+m3_u);\r\n   document.write (&quot;?zoneid=53&target=_blank&quot;);\r\n   document.write ('&cb=' + m3_r);\r\n   if (document.MAX_used != ',') document.write (&quot;&exclude=&quot; + document.MAX_used);\r\n   document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));\r\n   document.write (&quot;&loc=&quot; + escape(window.location));\r\n   if (document.referrer) document.write (&quot;&referer=&quot; + escape(document.referrer));\r\n   if (document.context) document.write (&quot;&context=&quot; + escape(document.context));\r\n   if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {\r\n       document.write (&quot;&ct0=&quot; + escape(document.MAX_ct0));\r\n   }\r\n   if (document.mmm_fo) document.write (&quot;&mmm_fo=1&quot;);\r\n   document.write (&quot;'><\/scr&quot;+&quot;ipt>&quot;);\r\n//]]>--></script><noscript><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=a7f8a68c&cb=' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=53&cb=&n=a7f8a68c&ct0=' border='0' alt='' /></a></noscript>"));
		ads_120x600.push(new Array(440, 100, "<iframe id='a90c24a8' name='a90c24a8' src='http://ads.shanoogle.com/www/delivery/afr.php?zoneid=5&target=_blank&cb=&ct0=' framespacing='0' frameborder='no' scrolling='no' width='160' height='600' allowtransparency='true'><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=a1ed8bb2&cb=' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=5&cb=&n=a1ed8bb2&ct0=' border='0' alt='' /></a></iframe>"));
		ads_120x240.push(new Array(438, 100, "<iframe id='a6f90e25' name='a6f90e25' src='http://ads.shanoogle.com/www/delivery/afr.php?zoneid=6&target=_blank&cb=&ct0=' framespacing='0' frameborder='no' scrolling='no' width='120' height='240' allowtransparency='true'><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=afe70bda&cb=' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=6&cb=&n=afe70bda&ct0=' border='0' alt='' /></a></iframe>"));
		ads_250x250.push(new Array(435, 100, "<script type='text/javascript'><!--//<![CDATA[\r\n   document.MAX_ct0 ='';\r\n\r\n   var m3_u = (location.protocol=='https:'?'https://ads.shanoogle.com/www/delivery/ajs.php':'http://ads.shanoogle.com/www/delivery/ajs.php');\r\n   var m3_r = Math.floor(Math.random()*99999999999);\r\n   if (!document.MAX_used) document.MAX_used = ',';\r\n   document.write (&quot;<scr&quot;+&quot;ipt type='text/javascript' src='&quot;+m3_u);\r\n   document.write (&quot;?zoneid=8&target=_blank&quot;);\r\n   document.write ('&cb=' + m3_r);\r\n   if (document.MAX_used != ',') document.write (&quot;&exclude=&quot; + document.MAX_used);\r\n   document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));\r\n   document.write (&quot;&loc=&quot; + escape(window.location));\r\n   if (document.referrer) document.write (&quot;&referer=&quot; + escape(document.referrer));\r\n   if (document.context) document.write (&quot;&context=&quot; + escape(document.context));\r\n   if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {\r\n       document.write (&quot;&ct0=&quot; + escape(document.MAX_ct0));\r\n   }\r\n   if (document.mmm_fo) document.write (&quot;&mmm_fo=1&quot;);\r\n   document.write (&quot;'><\/scr&quot;+&quot;ipt>&quot;);\r\n//]]>--></script><noscript><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=a52d73ed&cb=' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=8&cb=&n=a52d73ed&ct0=' border='0' alt='' /></a></noscript>"));
		ads_250x250_2.push(new Array(456, 100, "<!--/* OpenX Javascript Tag v2.8.1 (Rich Media - OpenX) */-->\r\n\r\n<script type='text/javascript'><!--//<![CDATA[\r\n   document.MAX_ct0 ='';\r\n\r\n   var m3_u = (location.protocol=='https:'?'https://ads.shanoogle.com/www/delivery/ajs.php':'http://ads.shanoogle.com/www/delivery/ajs.php');\r\n   var m3_r = Math.floor(Math.random()*99999999999);\r\n   if (!document.MAX_used) document.MAX_used = ',';\r\n   document.write (&quot;<scr&quot;+&quot;ipt type='text/javascript' src='&quot;+m3_u);\r\n   document.write (&quot;?zoneid=57&target=_blank&quot;);\r\n   document.write ('&cb=' + m3_r);\r\n   if (document.MAX_used != ',') document.write (&quot;&exclude=&quot; + document.MAX_used);\r\n   document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));\r\n   document.write (&quot;&loc=&quot; + escape(window.location));\r\n   if (document.referrer) document.write (&quot;&referer=&quot; + escape(document.referrer));\r\n   if (document.context) document.write (&quot;&context=&quot; + escape(document.context));\r\n   if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {\r\n       document.write (&quot;&ct0=&quot; + escape(document.MAX_ct0));\r\n   }\r\n   if (document.mmm_fo) document.write (&quot;&mmm_fo=1&quot;);\r\n   document.write (&quot;'><\/scr&quot;+&quot;ipt>&quot;);\r\n//]]>--></script><noscript><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=aa98b3c1&cb=' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=57&cb=&n=aa98b3c1&ct0=' border='0' alt='' /></a></noscript>"));
		ads_footerads.push(new Array(463, 100, "<iframe id='a5dd8a61' name='a5dd8a61' src='http://ads.shanoogle.com/www/delivery/afr.php?zoneid=77&amp;target=_blank&amp;cb={random}&amp;ct0={clickurl}' frameborder='0' scrolling='no' width='900' height='250' allowtransparency='true'><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=a4cc8dea&amp;cb={random}' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=77&amp;cb={random}&amp;n=a4cc8dea&amp;ct0={clickurl}' border='0' alt='' /></a></iframe>\r\n\r\n\r\n<br>\r\n<div style=&quot;overflow:hidden; font-size:11px; font-weight:normal; margin:0; padding:5px 0; line-height:16px; text-decoration:none; color:#999; text-align:center;&quot;>\r\n						<a href=&quot;http://www.adultspace.com/advertise_with_us.html&quot; style=&quot;text-decoration:underline; color:#777;&quot;>Adultspace Ads</a> | <a href=&quot;http://www.adultspace.com/vip_membership.html&quot; style=&quot;text-decoration:underline; color:#cf4376;&quot;>Hide</a>\r\n					</div>"));
		ads_mrc468x60.push(new Array(449, 100, "<script type='text/javascript'><!--//<![CDATA[\r\n   document.MAX_ct0 ='';\r\n\r\n   var m3_u = (location.protocol=='https:'?'https://ads.shanoogle.com/www/delivery/ajs.php':'http://ads.shanoogle.com/www/delivery/ajs.php');\r\n   var m3_r = Math.floor(Math.random()*99999999999);\r\n   if (!document.MAX_used) document.MAX_used = ',';\r\n   document.write (&quot;<scr&quot;+&quot;ipt type='text/javascript' src='&quot;+m3_u);\r\n   document.write (&quot;?zoneid=10&target=_blank&quot;);\r\n   document.write ('&cb=' + m3_r);\r\n   if (document.MAX_used != ',') document.write (&quot;&exclude=&quot; + document.MAX_used);\r\n   document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));\r\n   document.write (&quot;&loc=&quot; + escape(window.location));\r\n   if (document.referrer) document.write (&quot;&referer=&quot; + escape(document.referrer));\r\n   if (document.context) document.write (&quot;&context=&quot; + escape(document.context));\r\n   if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {\r\n       document.write (&quot;&ct0=&quot; + escape(document.MAX_ct0));\r\n   }\r\n   if (document.mmm_fo) document.write (&quot;&mmm_fo=1&quot;);\r\n   document.write (&quot;'><\/scr&quot;+&quot;ipt>&quot;);\r\n//]]>--></script><noscript><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=ad76e748&cb=' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=10&cb=&n=ad76e748&ct0=' border='0' alt='' /></a></noscript>"));
		ads_mio468x60.push(new Array(450, 100, "<script type='text/javascript'><!--//<![CDATA[\r\n   document.MAX_ct0 ='';\r\n\r\n   var m3_u = (location.protocol=='https:'?'https://ads.shanoogle.com/www/delivery/ajs.php':'http://ads.shanoogle.com/www/delivery/ajs.php');\r\n   var m3_r = Math.floor(Math.random()*99999999999);\r\n   if (!document.MAX_used) document.MAX_used = ',';\r\n   document.write (&quot;<scr&quot;+&quot;ipt type='text/javascript' src='&quot;+m3_u);\r\n   document.write (&quot;?zoneid=10&target=_blank&quot;);\r\n   document.write ('&cb=' + m3_r);\r\n   if (document.MAX_used != ',') document.write (&quot;&exclude=&quot; + document.MAX_used);\r\n   document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));\r\n   document.write (&quot;&loc=&quot; + escape(window.location));\r\n   if (document.referrer) document.write (&quot;&referer=&quot; + escape(document.referrer));\r\n   if (document.context) document.write (&quot;&context=&quot; + escape(document.context));\r\n   if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {\r\n       document.write (&quot;&ct0=&quot; + escape(document.MAX_ct0));\r\n   }\r\n   if (document.mmm_fo) document.write (&quot;&mmm_fo=1&quot;);\r\n   document.write (&quot;'><\/scr&quot;+&quot;ipt>&quot;);\r\n//]]>--></script><noscript><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=ad76e748&cb=' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=10&cb=&n=ad76e748&ct0=' border='0' alt='' /></a></noscript>"));
		ads_p468x60.push(new Array(451, 100, "<!--/* OpenX Javascript Tag v2.8.1 (Rich Media - OpenX) */-->\r\n\r\n<script type='text/javascript'><!--//<![CDATA[\r\n   document.MAX_ct0 ='';\r\n\r\n   var m3_u = (location.protocol=='https:'?'https://ads.shanoogle.com/www/delivery/ajs.php':'http://ads.shanoogle.com/www/delivery/ajs.php');\r\n   var m3_r = Math.floor(Math.random()*99999999999);\r\n   if (!document.MAX_used) document.MAX_used = ',';\r\n   document.write (&quot;<scr&quot;+&quot;ipt type='text/javascript' src='&quot;+m3_u);\r\n   document.write (&quot;?zoneid=10&target=_blank&quot;);\r\n   document.write ('&cb=' + m3_r);\r\n   if (document.MAX_used != ',') document.write (&quot;&exclude=&quot; + document.MAX_used);\r\n   document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));\r\n   document.write (&quot;&loc=&quot; + escape(window.location));\r\n   if (document.referrer) document.write (&quot;&referer=&quot; + escape(document.referrer));\r\n   if (document.context) document.write (&quot;&context=&quot; + escape(document.context));\r\n   if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {\r\n       document.write (&quot;&ct0=&quot; + escape(document.MAX_ct0));\r\n   }\r\n   if (document.mmm_fo) document.write (&quot;&mmm_fo=1&quot;);\r\n   document.write (&quot;'><\/scr&quot;+&quot;ipt>&quot;);\r\n//]]>--></script><noscript><a href='http://ads.shanoogle.com/www/delivery/ck.php?n=ad76e748&cb=' target='_blank'><img src='http://ads.shanoogle.com/www/delivery/avw.php?zoneid=10&cb=&n=ad76e748&ct0=' border='0' alt='' /></a></noscript>"));
		ads_m120x460.push(new Array(466, 100, "<iframe src=&quot;http://shanoogle.com/ads/hookem/sky1/hookem.html&quot; align=&quot;middle&quot; width=&quot;155&quot; height=&quot;370&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot;></iframe>"));
		var dummy = function()
{
	this.doready = function(xmlhttpresponse)
	{
		;
	}
}

var dmy = new dummy();
var show_ad_ids = new Array();
var httpxml = new asxmlhttp();

var rotate_interval = 300000;
window.setInterval('start_ads()', rotate_interval);
function start_ads()
{
	show_ad_ids = new Array();

	var bvideoside = document.getElementById("bvideoside");
	var b728x90 = document.getElementById("b728x90");
	var b728x90gay = document.getElementById("b728x90gay");
	var b728x90female = document.getElementById("b728x90female");
	var b468x80 = document.getElementById("btext1");
	var b120x600 = document.getElementById("b120x600");
	var b120x240 = document.getElementById("b120x240");
	var b120x120 = document.getElementById("b120x120");
	var b250x250 = document.getElementById("b250x250");
	var b250x250_2 = document.getElementById("b250x250_2");

	var mrc468x60 = document.getElementById("mrc468x60");
	var mio468x60 = document.getElementById("mio468x60");
	var p468x60 = document.getElementById("p468x60");
	var m120x460 = document.getElementById("m120x460");

	// LOLA
	var lola468x60 = document.getElementById("lola468x60");
	var lola728x90 = document.getElementById("lola728x90");
	var lola240x120 = document.getElementById("lola240x120");

	//var btext1 = document.getElementById("btext1");
	var btext2 = document.getElementById("btext2");

	var bfooterads = document.getElementById("footerads");
	var bmessage_center = document.getElementById("bmessage_center");
	var bnavigation = document.getElementById("bnavigation");

	var bpopup = document.getElementById("bpopup");

	var a = new Array();
	var m = 0;
	if(bvideoside && ads_videoside.length > 0){
		a = ads_videoside; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		bvideoside.innerHTML = banner_code(banner, 300, 250);
		show_ad_ids.push(getAdId(banner));
	}
	if(b728x90 && ads_728x90.length > 0){
		//var banner = ads_728x90[Math.round(Math.random() * (ads_728x90.length-1))];
		a = ads_728x90; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		b728x90.innerHTML = banner_code(banner, 728, 90);
		show_ad_ids.push(getAdId(banner));
	}
	if(b728x90gay && ads_728x90gay.length > 0){
		a = ads_728x90gay; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		b728x90gay.innerHTML = banner_code(banner, 728, 90);
		show_ad_ids.push(getAdId(banner));
	}
	if(b728x90female && ads_728x90female.length > 0){
		a = ads_728x90female; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		b728x90female.innerHTML = banner_code(banner, 728, 90);
		show_ad_ids.push(getAdId(banner));
	}
	if(b120x600 && ads_120x600.length > 0){
		//var banner = ads_120x600[Math.round(Math.random() * (ads_120x600.length-1))];
		a = ads_120x600; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		b120x600.innerHTML = banner_code(banner, 160, 600);
		show_ad_ids.push(getAdId(banner));
	}
	if(b120x240 && ads_120x240.length > 0){
		//var banner = ads_120x240[Math.round(Math.random() * (ads_120x240.length-1))];
		a = ads_120x240; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
<!--		b120x240.innerHTML = banner_code(banner, 120, 240);-->
		b120x240.innerHTML = banner_code(banner, 120, 468);   <!--Vlad edited ticket no. 17879-->
		show_ad_ids.push(getAdId(banner));
	}
	if(b120x120 && ads_120x120.length > 0){
		//var banner = ads_120x120[Math.round(Math.random() * (ads_120x120.length-1))];
		a = ads_120x120; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		b120x120.innerHTML = banner_code(banner, 120, 120);
		show_ad_ids.push(getAdId(banner));
	}
	if(b468x80 && ads_468x60.length > 0){
		//var banner = ads_468x60[Math.round(Math.random() * (ads_468x60.length-1))];
		a = ads_468x60; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		b468x80.innerHTML = banner_code(banner, 468, 80);
		show_ad_ids.push(getAdId(banner));
	}

	if(mrc468x60 && ads_mrc468x60.length > 0){
		//var banner = ads_mrc468x60[Math.round(Math.random() * (ads_mrc468x60.length-1))];
		a = ads_mrc468x60; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		mrc468x60.innerHTML = banner_code(banner, 468, 80);
		show_ad_ids.push(getAdId(banner));
	}
	if(mio468x60 && ads_mio468x60.length > 0){
		//var banner = ads_mio468x60[Math.round(Math.random() * (ads_mio468x60.length-1))];
		a = ads_mio468x60; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		mio468x60.innerHTML = banner_code(banner, 468, 80);
		show_ad_ids.push(getAdId(banner));
	}
	if(p468x60 && ads_p468x60.length > 0){
		//var banner = ads_p468x60[Math.round(Math.random() * (ads_p468x60.length-1))];
		a = ads_p468x60; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		p468x60.innerHTML = banner_code(banner, 468, 60);
		show_ad_ids.push(getAdId(banner));
	}
	if(m120x460 && ads_m120x460.length > 0){
		//var banner = ads_m120x460[Math.round(Math.random() * (ads_m120x460.length-1))];
		a = ads_m120x460; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		m120x460.innerHTML = banner_code(banner, 120, 460);
		show_ad_ids.push(getAdId(banner));
	}

	// LOLA
	if(lola468x60 && ads_lola468x60.length > 0){
		//var banner = ads_lola468x60[Math.round(Math.random() * (ads_lola468x60.length-1))];
		a = ads_lola468x60; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		lola468x60.innerHTML = banner_code(banner, 468, 60);
		show_ad_ids.push(getAdId(banner));
	}
	if(lola728x90 && ads_lola728x90.length > 0){
		//var banner = ads_lola728x90[Math.round(Math.random() * (ads_lola728x90.length-1))];
		a = ads_lola728x90; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		lola728x90.innerHTML = banner_code(banner, 728, 90);
		show_ad_ids.push(getAdId(banner));
	}
	if(lola240x120 && ads_lola240x120.length > 0){
		//var banner = ads_lola240x120[Math.round(Math.random() * (ads_lola240x120.length-1))];
		a = ads_lola240x120; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		lola240x120.innerHTML = banner_code(banner, 240, 120);
		show_ad_ids.push(getAdId(banner));
	}

	if(bmessage_center && ads_message_center.length > 0){
		//var banner = ads_message_center[Math.round(Math.random() * (ads_message_center.length-1))];
		a = ads_message_center; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		bmessage_center.innerHTML = banner_code(banner, 120, 120);
		show_ad_ids.push(getAdId(banner));
	}
	if(b250x250 && ads_250x250.length > 0){
		//var banner = ads_250x250[Math.round(Math.random() * (ads_250x250.length-1))];
		a = ads_250x250; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		b250x250.innerHTML = banner_code(banner, 300, 250);
		show_ad_ids.push(getAdId(banner));
	}
	if(b250x250_2 && ads_250x250_2.length > 0){
		a = ads_250x250_2; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		b250x250_2.innerHTML = banner_code(banner, 300, 300);
		show_ad_ids.push(getAdId(banner));
	}
	if(bfooterads && ads_footerads.length > 0){
		a = ads_footerads; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
		var banner = a[m];
		bfooterads.innerHTML = banner_code(banner, 900, 250);
		show_ad_ids.push(getAdId(banner));
	}

	if(btext2 && (ads_text2_1.length > 0 || ads_text2_2.length > 0 || ads_text2_3.length > 0 || ads_text2_4.length > 0)){
		var s_code = '<table cellpadding="1" cellspacing="0" width="100%"><tr>';
		if(ads_text2_1.length > 0){
			//var banner = ads_text2_1[Math.round(Math.random() * (ads_text2_1.length-1))];

			a = ads_text2_1; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
			var banner = a[m];

			s_code = s_code+'<td>'+ banner_code(banner, 220, 70)+'</td>';
			show_ad_ids.push(getAdId(banner));
		}
		if(ads_text2_2.length > 0){
			//var banner = ads_text2_2[Math.round(Math.random() * (ads_text2_2.length-1))];

			a = ads_text2_2; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
			var banner = a[m];

			s_code = s_code+'<td>'+ banner_code(banner, 220, 70)+'</td>';
			show_ad_ids.push(getAdId(banner));
		}
		if(ads_text2_3.length > 0){
			//var banner = ads_text2_3[Math.round(Math.random() * (ads_text2_3.length-1))];

			a = ads_text2_3; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
			var banner = a[m];

			s_code = s_code+'<td>'+ banner_code(banner, 220, 70)+'</td>';
			show_ad_ids.push(getAdId(banner));
		}
		if(ads_text2_4.length > 0){
			//var banner = ads_text2_4[Math.round(Math.random() * (ads_text2_4.length-1))];

			a = ads_text2_4; m = getAdIndex(a, (Math.ceil(Math.random() * getTotalWeight(a))));
			var banner = a[m];

			s_code = s_code+'<td>'+ banner_code(banner, 220, 70)+'</td>';
			show_ad_ids.push(getAdId(banner));
		}
		s_code = s_code+"</tr></table>";
		btext2.innerHTML = s_code;
	}

	if (document.getElementById("swfbox"))
	{
		document.getElementById("swfbox").innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="490" height="338" id="flash2" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="http://files.adultspace.com/images/nov09/flash3.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#333333" />	<embed src="http://files.adultspace.com/images/nov09/flash3.swf" quality="high" bgcolor="#333333" width="490" height="338" name="flash2" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /><param name="movie" value="http://files.adultspace.com/images/nov09/flash3.swf"></object>';
	}

	redirect_links();
}

function getAdId(raw_code)
{
	//return parseInt(raw_code.substr(0, raw_code.indexOf("|")));
	return raw_code[0];
}
function getAdWeight(raw_code)
{
	//return parseInt(raw_code.substr(raw_code.indexOf("|")+1, raw_code.indexOf("|", raw_code.indexOf("|")+1)-raw_code.indexOf("|")-1));
	return raw_code[1];
}
function banner_code(raw_code, width, height){
	var id = raw_code[0];
	var banner = raw_code[2];

	if((banner.indexOf("<script", banner) > -1) || (banner.indexOf("<SCRIPT", banner) > -1)) {
		return '<iframe ALLOWTRANSPARENCY="true" transparency="true" src="http://www.adultspace.com/aduri/'+id+'.html" width="'+width+'" height="'+height+'" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" bgcolor="none" style="padding:0px;margin:0px"></iframe>';
	}
	else{
		//raw_code = raw_code.substr(raw_code.indexOf("|", raw_code.indexOf("|")+1)+1);
		raw_code = raw_code[2];
		raw_code = raw_code.replace(/&quot;/g, '"');
		raw_code = raw_code.replace(/\n/, "\n");
		raw_code = raw_code.replace(/\r/, "\r");return raw_code;
	}
}
function bookmark_site(){
	var url = "http://www.adultspace.com/";
	var title = "Adultspace.com | A Stimulating Social Network For the Adult Community - Special Edition";
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
		window.external.AddFavorite(url,title);
	} else if (navigator.appName == "Netscape") {
		window.sidebar.addPanel(title,url,"");
	} else {
		alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
	}
}
function check_checkboxes(el, checkbox_name){
	with(el.form){
		for(i=0;i<elements.length;i++){
			if(elements[i].type == "checkbox" && elements[i].name == checkbox_name){
				elements[i].checked = el.checked;
			}
		}
	}
}

function uncheck_checkboxes(el, checkbox_name){
	with(el.form){
		for(i=0;i<elements.length;i++){
			if(elements[i].type == "checkbox" && elements[i].name == checkbox_name){
				elements[i].checked = false;
			}
		}
	}
}

var winReference = null;
function openPositionedWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName){
	var agent = navigator.userAgent.toLowerCase();
	if (agent.indexOf("mac") != -1 && agent.indexOf("msie") != -1 && (agent.indexOf("msie 4") != -1 || agent.indexOf("msie 5.0") != -1) ) {
		height += (status) ? 17 : 2;
	}
	width += (scrollbars != '' && scrollbars != null && agent.indexOf("mac") == -1) ? 16 : 0;
	var properties = 'width=' + width + ',height=' + height + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ((status) ? ',status' : '') + ',scrollbars' + ((scrollbars) ? '' : '=no') + ((moreProperties) ? ',' + moreProperties : '');
	var reference = openWindow(url, name, properties, openerName);
	return false;
}
function openCenteredWindow(url, name, width, height, status, scrollbars, moreProperties, openerName){
	var x, y = 0;
	if (screen) {
		x = (screen.availWidth - width) / 2;
		y = (screen.availHeight - height) / 2;
	}
	if (!status) status = '';
	if (!openerName) openerName = '';
	var reference = openPositionedWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName);
	return false;
}
function openWindow(url, name, properties, openerName) {
	var agent = navigator.userAgent.toLowerCase();
	if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) == 4 && agent.indexOf("msie 5") == -1 && agent.indexOf("msie5") == -1 && agent.indexOf("win") != -1 && url.indexOf('http://') == 0) {
		winReference = window.open('about:blank', name, properties);

		setTimeout('if (winReference && !winReference.closed) winReference.location.replace("' + url + '")', 300);
	}
	else {
		winReference = window.open(url, name, properties);
	}
	setTimeout('if (winReference && !winReference.closed) winReference.focus()', 200);
	if (openerName) self.name = openerName;
	return winReference;
}

function minmax (obj_name)
{
	return;
	var v = document.getElementById(obj_name);
	if (v.className == "minimized")
	{
		v.className = "maximized";
	}
	else
	{
		v.className = "minimized";
	}
}

function redirect_links()
{
	try
	{
		var A = document.getElementsByTagName('A');

		for (var i = 0; i < A.length; i++)
		{
			if (A[i].href.indexOf('.adultspace.com') > 0 || A[i].href.indexOf('//') == -1)
			{
			;
			}
			elseif (document.location.indexOf('adultspace.com/index.php?action=redirect') == -1)
			{
				//A[i].href = '/index.php?action=redirect&u=' + A[i];
				//A[i].setAttribute('target', '_blank');
			}
		}
	}
	catch (e)
	{
		;
	}
}
