// permet de déterminer le navigateur en fonction de nos besoins
var dom = net = iex = false;
if (document.getElementById) dom = true; // IE5+ ou Netscape6+/Mozilla
if (document.layers) net = true; // Netscape4
if (document.all) iex = true; // IE4+
var resolutionX = screen.width;
var resolutionY = screen.height;


/*
 * Navigateur
 */
var nomNavigateur="";
var V=navigator.appVersion;
spVersion = navigator.appMinorVersion;
agentUser=navigator.userAgent;
nomNavigateur=navigator.appName; 
gecko=(typeof(navigator.product)!="undefined");
if(gecko){
	geckoVersion=navigator.productSub;
	xmlCompatible=true;
}
if(window.navigator.userAgent.search(/[^a-z,A-Z]?Opera[^a-z,A-Z]?/i)>-1){
	nomNavigateur="Opera";
}
if(window.navigator.userAgent.search(/[^a-z,A-Z]?Firefox[^a-z,A-Z]?/i)>-1){
	nomNavigateur="Firefox";
}
if(window.navigator.userAgent.search(/[^a-z,A-Z]?K-Meleon[^a-z,A-Z]?/i)>-1){
	nomNavigateur="K-Meleon";
}

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') 
	{
		windowHeight = window.innerHeight;
	}
	else {
		if (document.body && document.body.clientHeight) 
		{
			windowHeight = document.body.clientHeight;
		}
	else 
	{
		if (document.documentElement && document.documentElement.clientHeight) 
		{
			windowHeight = document.documentElement.clientHeight;
		}
	}
	}
	return windowHeight;
}
function setFooter() {

	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		var vTaille=0;
		var vWindowHeight=0;
		if (windowHeight > 0) {
		 
			var footerElement = document.getElementById('fixed');
			if (windowHeight - 60 >= 0 && footerElement!=null) 
			{
				
				if ((document.all) && (navigator.appVersion.indexOf("Mac",0)<0)) 
				{
					footerElement.style.position = 'absolute';
					vTaille = 1097;
					vWindowHeight=871;
					//if(document.body.scrollTop >= vTaille){
						footerElement.style.top = (document.body.scrollTop + windowHeight - 60) + 'px';
					//}else{
						//footerElement.style.top = (document.body.scrollTop + windowHeight - 20) + 'px';
					//}
				}
				else {
					
					//alert(document.documentElement.scrollTop);
					//vTaille = 911;
					//if(document.documentElement.scrollTop >= vTaille){
						footerElement.style.position = 'fixed';
						footerElement.style.top = (windowHeight - 60) + 'px';
					//}else{
						//if(document.documentElement.scrollTop >=100){
							//footerElement.style.position = 'absolute';
							//footerElement.style.top = (document.documentElement.scrollTop + windowHeight - 60) + 'px';
						//}else{
							//footerElement.style.position = 'fixe';
							//footerElement.style.top = 378 + 'px';
						//}
					//}
				}
			}
			else {
				if (footerElement!=null) 
				{
					footerElement.style.position = 'static';
				}
				
			}
		}
	}
}
/*
 * Evenement Onload
 */
window.onload = function() {
	setFooter();
}
/*
 * Evenement Onresize
 */
window.onresize = function() {
	setFooter();
}
/*
 * Evenement Onscroll
 */
window.onscroll = function() {
	setFooter();
}

function openFlipbook(vid){
	window.open('/flipbook.php?id='+vid,'Viewer','width=1250,height=800,resizable=yes');
}
function viewer3(vid,origine,picture, modele_home, phpLang){
	window.open('/admin/showvideo_front.php?video='+vid+'&origine='+origine+'&picture='+picture+'&modele_home='+modele_home+'&phpLang='+phpLang,'Viewer','width=500,height=500,resizable=yes');
}
/*
 * Evenement Onscroll Mozilla
 */
window.onscroll = setFooter;

		
	
