var  cnt_468 = 1;
var  cnt_sky = 2;
var  cnt_imu = 3;
var  cnt_hid = 4;

var cntClick = 0;

function refreshBanner(){
	//setTimeout(refreshBanner2, 1000);
}

function refreshMsn() {
	//refresh leaderboard
	var f = document.getElementById('iconsulting_leaderbord');
	if (f) {
		f.innerHTML = '<iframe width="728" height="90" scrolling="no" border="0" frameborder="0" src="http://' + LANGUAGE + '.msn.i-quiz.be/customIndexes/msn/leaderboard_frame_' + LANGUAGE + '.html"></iframe>';
	}
	//refresh imu
	f = document.getElementById('iconsulting_imu');
	if (f) {
		f.innerHTML = '<iframe width="300" height="250" scrolling="no" border="0" frameborder="0" src="http://' + LANGUAGE + '.msn.i-quiz.be/customIndexes/msn/imu_frame_' + LANGUAGE + '.html"></iframe>';
	}
}

function refreshBanner2(){
	cntClick++;
	if (cntClick == 10) {
		var boxGifts = $('kdoJck');
		if (boxGifts && boxGifts.style.display != 'none') {
			(new Effect.toggle($('kdoJck'),'Blind'));
			(new Effect.toggle($('kdoJckMaximize')));
			(new Effect.toggle($('kdoJckMinimize')));
			Ptg.changeStatus('','min');
		}
	}

	var obj_468 = document.getElementById('switchAdlinkBp');
	var obj_sky = document.getElementById('iframeSky');
	var obj_imu = document.getElementById('iframeImu');
	var obj_hid = document.getElementById('iframeHid');

 	if (obj_468) {
		if ((cnt_468 % 1) === 0) {
			if (COUNTRY == 'BE') {
				obj_468.src = 'http://www.' + LANGUAGE + '.ptg.be/banner/bonsplans_' + LANGUAGE + '.php?rnd=' + Math.floor(Math.random() * 6) + '';
			} else if (COUNTRY == 'FR') {
				obj_468.src = 'http://ads.ptg.fr/banner/iframe_468_home_fr.php?p=' + REQUEST_URI;
			} else if (COUNTRY == 'NL') {
				obj_468.src = 'http://ads.play-the-game.nl/banner/iframe_468_home_nl.php?p=' + REQUEST_URI;
			} else if (COUNTRY == 'CH') {
				obj_468.src = 'http://ads.play-the-game.ch/banner/iframe_468_home_ch.php?p=' + REQUEST_URI;
			}
		}
		cnt_468++;
	}
// REFRESH	
 	if (obj_sky) {
		if ((cnt_sky % 1) === 0) {
			if (COUNTRY == 'BE') {
				obj_sky.src = 'http://www.' + LANGUAGE + '.ptg.be/banner/bonsplans_sky_' + LANGUAGE + '.php?rnd=' + Math.floor(Math.random() * 2) + '';
			} else if (COUNTRY == 'FR') {
				obj_sky.src = 'http://ads.ptg.fr/banner/iframe_sky_home_fr.php?p=' + REQUEST_URI;
			} else if (COUNTRY == 'NL') {
				obj_sky.src = 'http://ads.play-the-game.nl/banner/iframe_sky_home_nl.php?p=' + REQUEST_URI;
			} else if (COUNTRY == 'CH') {
				obj_sky.src = 'http://ads.play-the-game.ch/banner/iframe_sky_home_ch.php?p=' + REQUEST_URI;
			}
		}			
		cnt_sky++;
	}
// SELECT count(id) FROM `PTG-BE`.oth_bonsplans WHERE refresh=1 AND sky=0 AND imu=1 AND lg = 'fr' AND land_be = '1'  AND date_start<=now() AND (date_end>=now() OR date_end='0000-00-00')

// REFRESH	
 	if (obj_imu) {
		if ((cnt_imu % 1) === 0) {
			if (COUNTRY == 'BE') {
				obj_imu.src = 'http://www.' + LANGUAGE + '.ptg.be/banner/bonsplans_imu_' + LANGUAGE + '.php?rnd=' + Math.floor(Math.random() * 1) + '';
			} else if (COUNTRY == 'FR') {
				obj_imu.src = 'http://ads.ptg.fr/banner/iframe_imu_home_fr.php?p=' + REQUEST_URI;
			} else if (COUNTRY == 'NL') {
				obj_imu.src = 'http://ads.play-the-game.nl/banner/iframe_imu_home_nl.php?p=' + REQUEST_URI;
			} else if (COUNTRY == 'CH') {
				obj_imu.src = 'http://ads.play-the-game.ch/banner/iframe_imu_home_ch.php?p=' + REQUEST_URI;
			}
		}			
		cnt_imu++;
	}
	if (obj_hid) {
		if ((cnt_hid % 1) === 0) {
			if (COUNTRY == 'BE') {
				obj_hid.src = 'http://www.' + LANGUAGE + '.ptg.be/banner/bonsplans_hidden_' + LANGUAGE + '.php?nb=1&max=19';
			}
		}
		cnt_hid++;
	}
}
