/*

	This is the configuration JavaScript file.  Change the settings
	in the following section to match your affiliate tracking information.
	affiliate_usernameus = "15426"

*/

affiliate_username = "66371";
affiliate_profile = "aonnet";
affiliate_usernameus = "66371";
affiliate_profileus = "";
affiliate_usernamefr = "66371";
affiliate_profilefr = "";
affiliate_usernamewor = "66371";
affiliate_profilewor = "";

  ////////////////////////////////////////////////////////////////
 //                DO NOT EDIT BELOW THIS LINE                 //
////////////////////////////////////////////////////////////////

strSubAffLink = "http://adv.casinoblasters.com/index.php?" + affiliate_username;

function downloadCasinoSoft(){
	strDownloadURL = "http://www.casinotitan.com/smartdownload.php?affid=" + affiliate_username;
	if (affiliate_profile != "") strDownloadURL += "&profile=" + affiliate_profile;
	document.location = strDownloadURL;
}

function downloadCasinoSoftUS(){
	strDownloadURL = "http://www.casinotitan.com/smartdownload.php?affid=" + affiliate_usernameus;
	if (affiliate_profile != "") strDownloadURL += "&profile=" + affiliate_profileus;
	document.location = strDownloadURL;
}

function downloadCasinoSoftFr(){
	strDownloadURL = "http://www.casinotitan.com/smartdownload.php?affid=" + affiliate_usernamefr;
	if (affiliate_profile != "") strDownloadURL += "&profile=" + affiliate_profilefr;
	document.location = strDownloadURL;
}
function downloadCasinoSoftWor(){
	strDownloadURL = "http://www.casinotitan.com/smartdownload.php?affid=" + affiliate_usernamewor;
	if (affiliate_profile != "") strDownloadURL += "&profile=" + affiliate_profilewor;
	document.location = strDownloadURL;
}

function downloadPokerSoft(){
	strDownloadURL = "http://aspinallspoker.com/global/v1/lp_videopoker.php?member=" + affiliate_username;
	if (affiliate_profile != "") strDownloadURL += "&profile=" + affiliate_profile;
	document.location = strDownloadURL;
}

/*
	ExitOverlay
*/

var doExit = false;
document.getElementById('tiExitAnchor').href="http://www.AspinallsOnlineCasino.net/go-popular-casinos/casino-titan-overlay.html";
document.getElementById('tiExitAnchor').innerHTML = '<img src="http://www.AspinallsOnlineCasino.net/Casino-Titan-Screenshot.jpg" width="987" height="493" border="0" />';

function getBodySize(){
	if (document.body.scrollHeight>document.body.offsetHeight) return {x:document.body.scrollWidth,y:document.body.scrollHeight}; // all but Explorer Mac
	return {x:document.body.offsetWidth,y:document.body.offsetHeight}; // Explorer Mac;
}

function getPageScroll(){
	var offsetX=0, offsetY=0;
	if(!window.pageYOffset){
		if(!(document.documentElement.scrollTop == 0)){
			offsetY = document.documentElement.scrollTop;
			offsetX = document.documentElement.scrollLeft;
		}else{
			offsetY = document.body.scrollTop;
			offsetX = document.body.scrollLeft;
		}
	}else{
		offsetX = window.pageXOffset;
		offsetY = window.pageYOffset;
	}
	return {x:offsetX,y:offsetY};
}

function getWindowSize() {
	var myWidth=0, myHeight=0;
	if(typeof(window.innerWidth) == 'number'){
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	return {x:myWidth,y:myHeight};
}

function showDHTMLExitPop(){
		if (doExit==true && document.getElementById('dhtmlExitOverlay') && document.getElementById('dhtmlExit')){
		// the overlay and exit pop are on the page
		var objExitOverlay = document.getElementById('dhtmlExitOverlay');
		var objExit = document.getElementById('dhtmlExit');

		if ((getCookie('tx_unique_flash') != 1) && (getCookie('tx_unique_dl') != 1) && (getCookie('tx_unique_dhtmlexit') != 1)){
			// no flash click, download click, and previous dhtml exit pop - don't but our customers :)
			setCookie('tx_unique_dhtmlexit','1',1);
			var winSize = getWindowSize();
			var pageScroll = getPageScroll();
			var bodySize = getBodySize();
			var totalPageHeight = bodySize.y;
			if (winSize.y > totalPageHeight) totalPageHeight = winSize.y;
			if (pageScroll.y > 0) totalPageHeight = totalPageHeight + pageScroll.y;
			objExitOverlay.style.height = totalPageHeight+'px';
			objExitOverlay.style.display = '';
			objExit.style.display = '';
			objExit.style.top = (winSize.y / 2) - (objExit.offsetHeight / 2) + pageScroll.y +'px';
			objExit.style.left = (winSize.x / 2) - (objExit.offsetWidth / 2)+'px';
		}
	}
}

function hideDHTMLExitPop(){
	document.getElementById('dhtmlExitOverlay').style.display = 'none';
	document.getElementById('dhtmlExit').style.display = 'none';
}

function updateExitNets(){
	if (document.getElementById('exitNetLeft') && document.getElementById('exitNetRight') && document.getElementById('exitNetCenter')){
		var pageScroll = getPageScroll();
		var winSize = getWindowSize();
		
		var objNetLeft = document.getElementById('exitNetLeft');
		var objNetRight = document.getElementById('exitNetRight');
		var objNetCenter = document.getElementById('exitNetCenter');
		
		objNetLeft.style.left = '0px';
		objNetLeft.style.top = pageScroll.y +'px';
		objNetRight.style.right = '0px';
		objNetRight.style.top = pageScroll.y +'px';
		objNetCenter.style.left = '0px';
		objNetCenter.style.top = pageScroll.y +'px';
	}
	setTimeout(updateExitNets,100);
}

function setCookie(name, value, days, path, domain, secure) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	
	var curCookie = name + "=" + escape(value) + expires +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
	document.cookie = curCookie;
}

function getCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for (var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function allowExit(){
	
	doExit = true;	
}

setTimeout("allowExit()",5000);
updateExitNets();

