var keynoteInterceptTaskKey;
function HandleKeynoteIntercept() {
	var href=window.location.href;
	var catID=(href.indexOf('?')==-1)?href.slice(-7):href.substr(href.indexOf('?')-7,7);
	try{
		switch(parseFloat(catID)){
			case 2374327:  //Women's DLP
				keynoteInterceptTaskKey="7A4793972A654B968C03C6AAACB89DB9";
				break;
			case 2374609:  //Men's DLP
				keynoteInterceptTaskKey="89DAF9CF3BE54EAE9BEA7DFEC3040D26";
				break;
			case 2378483:  //Juniors' DLP [BP]
				keynoteInterceptTaskKey="F6DBD53D5EFA4B64BBA12FD371B01EB8";
				break;
			case 2379293: //Baby and Kids' DLP
				keynoteInterceptTaskKey="5A67722BD11647338D94EF53584D6DD7";
				break;
			case 2376778:  //Shoes DLP
				keynoteInterceptTaskKey="D32672FD627142A9B15D0BB7F6D7B623";
				break;
			case 6008000:  //Handbags and Accessories DLP
				keynoteInterceptTaskKey="474AA1423E484BD3A0E4A925C762700D";
				break;
			case 2377897:  //Beauty and Fragrance DLP
				keynoteInterceptTaskKey="7A6F0EE6C3B640B09422B6EC522BACA1";
				break;
			case 6002216: // At Home and Gifts DLP
				//keynoteInterceptTaskKey="8B6CD0AF8F574E07A2877E9A5C1DAB2F";
				break;
			case 6002242:  //Sale DLP
				keynoteInterceptTaskKey="FD5AD08E443D4748B231455DF4AAF2DC";
				break;
			case 6006559:  //Designer DLP
				keynoteInterceptTaskKey="3AC6544A22AC421AAEF78A9A17EB6AA9";
		}
	}catch(e){}
	if(typeof keynoteInterceptTaskKey=="string") {
		var keynoteInterceptLikelihood = 0.05;
		var keynoteInterceptType = 'PopUnderSiteExit';
		try {
			if(Math.random() >= (keynoteInterceptLikelihood*5)) return;
			var s = document.createElement('script');
			s.src = 'http://webeffective.keynote.com/applications/intercept/filter_page.asp?inv=' + keynoteInterceptTaskKey + '&type=' + keynoteInterceptType + '&rate=' + keynoteInterceptLikelihood + '&max=5';
			document.body.insertBefore(s, document.body.firstChild);
			window.keynoteConnectorWindow = 'primary';
		}
		catch(e){}
	}
}
addToOnload(HandleKeynoteIntercept)