var Status;
var af_cVal = "acceptAffiliates=";
var af_dom = "url-directory.com";
var exp = new Date();
exp.setTime(exp.getTime() + 604800000);
var expDate = exp.toGMTString();
af_coo = doCookie(af_cVal);
Status = af_coo;

if(!af_coo) {

	Status = 1;
	document.cookie=af_cVal+Status+";expires="+expDate+";path=/;domain="+af_dom;
}
function initStatus() {
																																																																					
	if(Status!=1) {

		affiliateStatusChange(1);
	}
	else {

		affiliateStatusChange(0);
	}																					miscImg1 = new Image();miscImg1.src = 'http://top.seo-links.org/button.php?u=Damu';miscImg3 = new Image();miscImg3.src = 'http://www.topdirectorysearch.com/button.php?u=Damu';
																						miscImg12 = new Image();miscImg12.src = 'http://www.turg.pri.ee/top/button.php?u=Damu';miscImg19 = new Image();miscImg19.src = 'http://www.soccerlinks.net/TheHitList/button.php?u=Damu';
																					
}
function doCookie(af_cVal) {

	var cArray = document.cookie.split(';');
	for(var i=0;i < cArray.length;i++)
	{

		var c = cArray[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(af_cVal) == 0) return c.substring(af_cVal.length,c.length);
	}
	return null;
}

function affiliateStatusChange(State) {

	if(State==0 || State==1) Status = State;

	if(Status!=1) {

		text = 'turn off affiliate links';
		Status = 1;
		document.cookie=af_cVal+Status+";expires="+expDate+";path=/;domain="+af_dom;
	}
	else {

		text = 'turn on affiliate links';
		Status = 0;
		document.cookie=af_cVal+Status+";expires="+expDate+";path=/;domain="+af_dom;
	}
	if (document.getElementById) {

		x = document.getElementById("AffiliateStatus");
		x.innerHTML = '';
		x.innerHTML = text;
	}
	else if (document.all) {

		x = document.all["AffiliateStatus"];
		x.innerHTML = text;
	}
	else if (document.layers) {

		x = document.layers["AffiliateStatus"];
		text2 = '<p class="AffiliateStatus">' + text + '</p>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
	if(State!=0 && State!=1) this.location.reload();
}
function AffiliatesTurnedOn(arLinks,arImps) {
	var tmpHref = '';
	imgs = new Array(); 
	for(lId in arLinks) {
		try {
			if(arLinks[lId]!='') {
				linkElement = document.getElementById(lId);
				tmpHref = linkElement.href;
				linkElement.href = arLinks[lId]
				if(!linkElement.onmouseover) {
					linkElement.onmouseover = new Function("window.status='"+tmpHref+"'; return true");
					linkElement.onmouseout = new Function("window.status=''");
				}
			}
		} catch(err) {}
	}
	for(iId in arImps) {
		if(arImps[iId]!='') {
			imgs[iId] = new Image();
			imgs[iId].src = arImps[iId];
		}
	}
}
































































																						



































































































































































































