function loadpage(ident){
	switch (ident)
   {
	   //Les cas "à l'ancienne"
      case 1:
		 document.location.hash='#/univers-cyclus';
         break;
      
      case 2:
		 document.location.hash='#/produits-cyclus';
         break;
         
      case 3:
		 document.location.hash='#/ou-nous-trouver';
         break;
		 
	  case 4:
		 document.location.hash='#/extranet';
         break;
		 
	  case 5:
		 document.location.hash='#/parutions-presse';
         break;
		 
	  case 6:
		 document.location.hash='#/telechargements';
         break;
                        
	  case 7:
		 document.location.hash='#/contact';
         break;			
		 
	  case 8:
		 document.location.hash='#/photographe-du-mois';
         break;


	  default:
		  document.location.hash='#/';
         break;
   }
}

function addOnLoad(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

function getWindowHeight() {
	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 setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('wrapper').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'relative';
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}
addOnLoad(function() {
	setFooter();
});

window.onresize = function() {
	setFooter();
}
