var aid = getCookie("aid");
var affiliate = aid;
if (window.affiliate && window.sponsor){
	document.write("<script language=\"Javascript\" src=\"/affiliates/"+sponsor+","+affiliate+".js\"></script>");
}
function Go(uu, t){
	if (!t){
		if (uu){
			window.location = uu;
		}else{
			window.location = "/";
		}
	}else{
		dim = window.open(uu, '');
		if (!dim){
			alert("Unable to open, Perhaps you have a popup blocker installed?");
			window.location = uu;
		}
	}
}
function loaded(){
	if (window.affid && window.asl){
		d = document.getElementsByTagName('a');
		r = Math.random()*100;
		if(r){
			for (i=0;i<d.length; i++){
				if (d[i].className == "re"){
					d[i].href=rp(d[i].href, asl, affid);
					//d[i].href='http://www.google.com/url?sa=D&q='+escape(d[i].href)
				}
			}
		}
	}
	if (window.aid){
		for (i=0;i<d.length; i++){
			if (d[i].className == "aff"){
				//d[i].href=rp(d[i].href, d[i].href, d[i].href+'?'+aid);
			}
		}
	}
	
	// re enable when text images are working
	if (document.getElementsByTagName){
	  d = document.getElementsByTagName('h1');
	  for (i=0;i<d.length; i++){
		  di = d[i].innerHTML;
		 if (di.indexOf('src=') <= 0){ 	
			da='http://images.aujs.com/5002/text/0/50/stonsbi_/FFF7CC/3a3a3a/0/0/29/0/0/0/';
			da+=escape(di)+'.png';
			d[i].innerHTML='<img src="'+da+'" border="0" alt="'+di+'">';
		 }
	  }
	}
	
}


function rp(i,f,t) {
 var o='';
 while(i.length>=f.length&&i.length>0){
  if(i.substring(0,f.length)==f){
   o+=t;
   i=i.substring(f.length);
  }else{
   o+=i.substring(0,1);
   i=i.substring(1);
  }
 }
 return o+i;
}

window.onload=loaded

function over18(){
	if (document.getElementById){
		allowenter();
		var now = new Date();
		fixDate(now);
		now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
		setCookie("over18", 1, now, "/", ".adult-site-lister.com");
	}
}

function allowenter(){
	d = document;
	da = d.getElementById('age');
	if (da){
		da.style.display='none';
	}
}

// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
      //alert(curCookie);
  document.cookie = curCookie;
}

// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}
function agecode(){
	var aged = getCookie("over18");
	if (!aged){
		var winW = 630, winH = 460;
		if (parseInt(navigator.appVersion)>3) {
		 if (navigator.appName=="Netscape") {
		  winW = window.innerWidth-16;
		  winH = window.innerHeight;
		 }
		 if (navigator.appName.indexOf("Microsoft")!=-1) {
		  winW = document.body.offsetWidth-20;
		  winH = document.body.offsetHeight;
		 }
		}
		//document.write( "Window width = "+winW+"<br>"+"Window height = "+winH);
		document.write('<div id="age" style="background-color: #343434; width: 100%; height: 100%; display: block; position: absolute; z-index: 10; left: 0px; top: 0px; filter: opacity(80); moz-opacity: 80%;"><table width="100%" height="100%"><tr><td align="center" style="color: #FF6600; vertical-align: middle; font-size: 18px;"><p>This page contains adult-oriented material. If you are under 18 years of age, are offended by such material, or if it is illegal to view adult material in your community, please leave now. This site is not acting in any way to send you this information; you are choosing to receive it. Continuing means that you understand and accept responsibility for your own actions, thus releasing the creators of this Web page from all liability. <a href="http://dir.yahoo.com/Business_and_Economy/Shopping_and_Services/Communication_and_Information_Management/Internet_and_World_Wide_Web/Software/Blocking_and_Filtering/Titles/">We strongly support parental controls on the Internet.</a></p><h3><a href="#" onclick="over18();">ENTER NOW</a></h3>	<p><i>Note: If you keep getting this message then you need to enable cookies.</i></p></td></tr></table></div>');
	}
}

function writeBanner(){
}

function bookmark(){
	if (window.external){
		window.external.AddFavorite(window.location+'?b=1', document.title);
	}else{
		alert('Please Press CTRL + D to add a bookmark');
	}
}

function showhide(id){
	if (document.getElementById){
		dd = document.getElementById(id);
		if (dd.style.display == 'block'){
			dd.style.display = 'none';
		}else{
			dd.style.display = 'block';
		}
	}
}




var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_nav2 = (is_nav && (is_major == 2));
var is_nav3 = (is_nav && (is_major == 3));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && (is_major >= 4));
var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) );
var is_nav6 = (is_nav && (is_major == 5));
var is_nav6up = (is_nav && (is_major >= 5));
var is_gecko = (agt.indexOf('gecko') != -1);
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie4up  = (is_ie && (is_major >= 4));
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
var is_aol   = (agt.indexOf("aol") != -1);
var is_aol3  = (is_aol && is_ie3);
var is_aol4  = (is_aol && is_ie4);
var is_aol5  = (agt.indexOf("aol 5") != -1);
var is_aol6  = (agt.indexOf("aol 6") != -1);
var is_opera = (agt.indexOf("opera") != -1);
var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);
var is_webtv = (agt.indexOf("webtv") != -1); 
var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
var is_AOLTV = is_TVNavigator;
var is_hotjava = (agt.indexOf("hotjava") != -1);
var is_hotjava3 = (is_hotjava && (is_major == 3));
var is_hotjava3up = (is_hotjava && (is_major >= 3));
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
var is_win16 = ((agt.indexOf("win16")!=-1) || (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("windows 16-bit")!=-1) );  
var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) || (agt.indexOf("windows 16-bit")!=-1));
var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));
var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1));
var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
var is_win32 = (is_win95 || is_winnt || is_win98 || ((is_major >= 4) && (navigator.platform == "Win32")) || (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
var is_os2   = ((agt.indexOf("os/2")!=-1) || (navigator.appVersion.indexOf("OS/2")!=-1) || (agt.indexOf("ibm-webexplorer")!=-1));
var is_mac    = (agt.indexOf("mac")!=-1);
if (is_mac && is_ie5up) is_js = 1.4;
var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) || (agt.indexOf("68000")!=-1)));
var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) || (agt.indexOf("powerpc")!=-1)));
var is_sun   = (agt.indexOf("sunos")!=-1);
var is_sun4  = (agt.indexOf("sunos 4")!=-1);
var is_sun5  = (agt.indexOf("sunos 5")!=-1);
var is_suni86= (is_sun && (agt.indexOf("i86")!=-1));
var is_irix  = (agt.indexOf("irix") !=-1);
var is_irix5 = (agt.indexOf("irix 5") !=-1);
var is_irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
var is_hpux  = (agt.indexOf("hp-ux")!=-1);
var is_hpux9 = (is_hpux && (agt.indexOf("09.")!=-1));
var is_hpux10= (is_hpux && (agt.indexOf("10.")!=-1));
var is_aix   = (agt.indexOf("aix") !=-1);
var is_aix1  = (agt.indexOf("aix 1") !=-1);    
var is_aix2  = (agt.indexOf("aix 2") !=-1);    
var is_aix3  = (agt.indexOf("aix 3") !=-1);    
var is_aix4  = (agt.indexOf("aix 4") !=-1);    
var is_linux = (agt.indexOf("inux")!=-1);
var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
var is_unixware = (agt.indexOf("unix_system_v")!=-1); 
var is_mpras    = (agt.indexOf("ncr")!=-1); 
var is_reliant  = (agt.indexOf("reliantunix")!=-1);
var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
var is_sinix = (agt.indexOf("sinix")!=-1);
var is_freebsd = (agt.indexOf("freebsd")!=-1);
var is_bsd = (agt.indexOf("bsd")!=-1);
var is_unix  = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux || is_sco ||is_unixware || is_mpras || is_reliant || is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);
var is_vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
