// JavaScript Document
function GetURL(icUrl){
	if(icUrl != "#")window.location.href = icUrl;
	else alert("pas d'url");
}

function Verif(theForm) {
	var TabVerif = new Array();
	var TabDisplay = new Array();

	TabVerif[0] = "txtNom";
	TabVerif[1] = "txtEmail";
	TabVerif[2] = "txtTel";

	TabDisplay[0] = "Nom";
	TabDisplay[1] = "E-mail";
	TabDisplay[2] = "Téléphone";

	for (i=0;i<TabVerif.length;i++)	
	{
		Valeur = theForm[TabVerif[i]].value;
		if (Valeur=="")
		{
			alert("Vous devez remplir le champ « " + TabDisplay[i] + " » avant de pouvoir valider le formulaire.");
			theForm[TabVerif[i]].focus();
			return false;
		}
	}
	return true;	
}

function ResizeContent(){
	var divContentScroll = document.getElementById("divContentScroll");
	var headerHeight = 196;//document.getElementById("divHeader").offsetHeight;
	var centreHeight = divContentScroll.offsetHeight;
	var footerHeight = 96;//document.getElementById("divFooter").offsetHeight;
	
	//-------------------------------------------------------------------------
	var avaibleHeight = 0;
	
	if (!IE)
	{
		avaibleHeight = self.innerHeight + 70;
	}	
	else if (IE6)
	{
		avaibleHeight = document.documentElement.offsetHeight-5;
	}
	else if (IE7)
	{
	    avaibleHeight = document.documentElement.offsetHeight;
	}
	else if (IE8)
	{
	    avaibleHeight = document.documentElement.offsetHeight + 70;
	}
	//-------------------------------------------------------------------------
	var diffHeight = Number(avaibleHeight-headerHeight-footerHeight-(30*2)-2);//padding-top + padding-bottom
	document.getElementById("divMenu").style.height = (diffHeight-20) + "px";
	document.getElementById("divContent").style.height = diffHeight + "px";
	document.getElementById("divFooter").style.display = "block";

	if(divContentScroll.className == "home"){
		if(Number(divContentScroll.offsetHeight) > diffHeight)divContentScroll.style.width = "713px";
		else divContentScroll.style.width = "720px";
	}else{
		if(Number(divContentScroll.offsetHeight) > diffHeight)divContentScroll.style.width = "450px";
		else divContentScroll.style.width = "470px";
	}
}

function PrintOpenerContent(){
    document.getElementById("divContentToPrint").innerHTML = window.opener.document.getElementById("divContentScroll").innerHTML;
    window.print();
    window.close();
}

myWindow = null;
function Popup(icURL, icWIdth, icHeight, ilResisable, icWindowName){
	myWindow = window.open (icURL, icWindowName, "status=0,toolbar=0,menubar=0,location=0,resizable="+ ilResisable +",scrollbars=1,fullscreen=0,directories=0,top=20,left=" + ((screen.availWidth - icWIdth) / 2) + ",height=" + icHeight + ",width=" + icWIdth);
}

var NavMenu;
function DoLayout(){
  //NavMenu = document.getElementById("NavMenu");
  ResizeContent();
}

/*
window.onresize=ResizeContent;
window.onchange=ResizeContent;
*/