function getWindowHeight() {
	
	/* Get window height */
	
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function setContentHeight(nceh) { // notContentElementHeights

	if (document.getElementById) {

		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
				if ((document.getElementById('content').offsetHeight + nceh) < windowHeight) {
					document.getElementById('content').style.height = (windowHeight - nceh) + 'px';
				}	
		}
	}
}
function scroll_gallery(gstart,max,gnb,gtime) {
	
	merchant = new Array (max);
	merchant[9] = "3suisses.jpg";
	merchant[8] = "mypix.gif";
	merchant[7] = "wengo.jpg";
	merchant[6] = "bebloom.gif";							
	merchant[5] = "ecompil.gif";
	merchant[4] = "clickgames.jpg";
	merchant[3] = "gameloft.jpg";
	merchant[2] = "zeturf.jpg";
	merchant[1] = "mob.gif";

	
	mlinks = new Array (max);
	mlinks[9] = "1";
	mlinks[8] = "1";
	mlinks[7] = "2";
	mlinks[6] = "7";
	mlinks[5] = "13";
	mlinks[4] = "3";
	mlinks[3] = "3";
	mlinks[2] = "3";
	mlinks[1] = "2";
															
	switch(gstart) {
		
		case 2 :
			gnext 	= 1; 
			gfirst 	= 2;
			gsecond = 1;
			gthird 	= max; 
			break;
			
		case 1 :
			gnext 	= 0; 
			gfirst 	= 1;
			gsecond = max; 
			gthird 	= max - 1; 
			break;
			
		case 0 :
			gnext 	= max;
			gfirst 	= max;
			gsecond	= max - 1;
			gthird 	= max - 2; 
			break;
		
		default :
			gnext 	= gstart - 1; 
			gfirst 	= gstart;
			gsecond = gstart - 1;
			gthird 	= gstart - 2;
			break;
													
	}	
	scroll_img_path = "https://www.neomiles.com/c_images/logos/";
	document.images.img_gallery3.src = scroll_img_path + merchant[gfirst]; 
	document.images.img_gallery2.src = scroll_img_path + merchant[gsecond];
	document.images.img_gallery1.src = scroll_img_path + merchant[gthird];
	
	gallery_path = "http://www.myneosurf.com/public/fr/merchant_gallery.php?category=";
	document.getElementById("merchant_link3").href = gallery_path + mlinks[gfirst];
	document.getElementById("merchant_link2").href = gallery_path + mlinks[gsecond];
	document.getElementById("merchant_link1").href = gallery_path + mlinks[gthird];
	
	window.setTimeout("scroll_gallery(" + gnext + "," + max + "," + (gnb + 1) + "," + gtime + ")" , gtime );
	
	return true;
}					

function open_popup(page,largeur,hauteur) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"page","top="+top+",left="+left+",width="+largeur+",height="+hauteur+", toolbar=0,location=0,directories=0,status=1,scrollbars=0,resizable=0,copyhistory=0,menuBar=0,");
}

function open_popup_2(page,largeur,hauteur) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"page","top="+top+",left="+left+",width="+largeur+",height="+hauteur+", toolbar=0,location=0,directories=0,status=1,scrollbars=1,resizable=1,copyhistory=0,menuBar=0,");
}