var expirationIntlt = 1*10*60*1000; // one day

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

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

function popundrGetcookiet (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 popundrCheckt (event) {
	if (navigator.userAgent.indexOf('MSIE')!=-1 && (event.srcElement.id == 'livesex-link' || event.srcElement.id == 'dating-link' || event.srcElement.id == 'freesex-link')) {
		window.open(event.srcElement.getAttribute('href'));
		return false;
	};
    var cookie = popundrGetcookiet('popundr_t');
    var cookie_start = popundrGetcookiet('popundr_t_start');
    
    if (cookie==1&&(Math.round(new Date().getTime() / 1000)-cookie_start)>30) {
	popundrShowt('http://syndication.exoclick.com/splash.php?cat=2&idsite=75760&idzone=232428&login=ytv001&type=8&p=http://www.yobt.tv');
	popundrSetcookiet('popundr_t',2,expirationIntlt);
	} else {
    if (cookie==2&&(Math.round(new Date().getTime() / 1000)-cookie_start)>90) {
	popundrShowt('http://syndication.exoclick.com/splash.php?cat=2&idsite=75760&idzone=194857&login=ytv001&type=8&p=http://www.yobt.tv');
	popundrSetcookiet('popundr_t',3,expirationIntlt);
	}
	};
};

function popundrInitializet() {
    if (document.attachEvent) document.attachEvent( "onclick", popundrCheckt);
    else {
        if (document.addEventListener) document.addEventListener( "click", popundrCheckt, false);
    };
};


if (popundrGetcookiet('popundr_t_start')==0) {
popundrSetcookiet('popundr_t_start',Math.round(new Date().getTime() / 1000),expirationIntlt);
popundrSetcookiet('popundr_t',1,expirationIntlt);
}
popundrInitializet();

