var phpads_errorhandler = null;

if (window.captureEvents && Event.ERROR)
	window.captureEvents (Event.ERROR);

function phpads_onerror(e) {
	window.onerror = phpads_errorhandler;
	return true;
}

function phpads_31_pop() {
	phpads_errorhandler = window.onerror;
	window.onerror = phpads_onerror;

	var X = 720;
	var Y = 300;

	if(!window.resizeTo) {
		X = X + 20;
		Y = Y + 20;
	}

	window.phpads_31 =  window.open('', 'phpads_31', 'height=' + Y + ',width=' + X + ',toolbar=no,location=no,menubar=no,status=no,resizable=no,scrollbars=no');
	if (window.phpads_31.document.title == '' || window.phpads_31.location == 'about:blank' || window.phpads_31.location == '') {
		if (window.resizeTo) {
			if(phpads_31.innerHeight) {
				var diffY = phpads_31.outerHeight - Y;
				var diffX = phpads_31.outerWidth - X;
				var outerX = X + diffX;
				var outerY = Y + diffY;
			} else {
				phpads_31.resizeTo(X, Y);
				var diffY = phpads_31.document.body.clientHeight - Y;
				var diffX = phpads_31.document.body.clientWidth - X;
				var outerX = X - diffX;
				var outerY = Y - diffY;
			}
			phpads_31.resizeTo(outerX, outerY);
		}
		phpads_31.location = 'http://ads.starpulse.com/ads/adcontent.php?bannerid=31&zone=3&source=&timeout=0';
		window.focus();
	}
	window.onerror = phpads_errorhandler;
	return true;
}

phpads_31_pop();
