var expirationIntl = 1*30*60*1000; // one day

function popundrShow (url) {
	var popundrWindow = window.open(url, '', 'toolbar,status,resizable,scrollbars,menubar,location,height=600,width=800');
	setTimeout( function() { popundrWindow.focus(); setTimeout( function() { popundrWindow.blur();}, 10);}, 500);
};

function popundrSetcookie (name, value, interval) {
	var expires = new Date();
	expires.setTime(expires.getTime() + interval);
	document.cookie = name + '=' + value + '; expires=' + expires.toGMTString() + '; path=/';
};

function popundrGetcookie (name) {
	var cookies = document.cookie.toString().split('; ');
	for (var i = 0; i < cookies.length; i++) {
		if (cookies[i].split('=')[0] == name) return cookies[i].split('=')[1];
	};
	return '0';
};

function popundrCheck (event) {
	var cookie = popundrGetcookie('popundr');
	if ((cookie>=0&&cookie<5)) {
		cookie++;
		switch (cookie) {
			case 1 : {
				popundrShow('http://syndication.exoclick.com/splash.php?cat=2&idsite=74593&idzone=135631&login=toby217&type=8&p=http://www.yobt.com');
				break;
			};
			default : break;
		};
		popundrSetcookie('popundr',cookie,expirationIntl);
	};
};

function popundrInitialize() {
	if (document.attachEvent) document.attachEvent( "onclick", popundrCheck);
    else {
		if (document.addEventListener) document.addEventListener( "click", popundrCheck, false);
    };
};
setTimeout( function() { popundrInitialize();}, 2000);
