// 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] = "selectType";
	TabVerif[1] = "selectCivilite";
	TabVerif[2] = "txtPrenom";
	TabVerif[3] = "txtNom";
	TabVerif[4] = "txtEmail";
	TabVerif[5] = "txtDemande";

	TabDisplay[0] = "Type";
	TabDisplay[1] = "Civilités";
	TabDisplay[2] = "Prénom";
	TabDisplay[3] = "Nom";
	TabDisplay[4] = "E-mail";
	TabDisplay[5] = "Demande";

	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 avaibleHeight = 0;
	if (!IE)
	{
		avaibleHeight = document.body.offsetHeight;
	}	
	else if (IE6)
	{
		avaibleHeight = document.documentElement.offsetHeight-5;
	}
	else if (IE7)
	{
	    avaibleHeight = document.documentElement.offsetHeight;
	}
	else if (IE8)
	{
	    avaibleHeight = document.documentElement.offsetHeight + 70;
	}
	
	var divHeight = 0;
	if (IE){
		divHeight = (avaibleHeight-125);
	}else{
		divHeight = (avaibleHeight-60);
	}
	document.getElementById("divAll").style.height = divHeight + "px";
	//if(bool_home == true)document.getElementById("divContent").style.height = (divHeight-105) + "px";
	if(document.getElementById("divContent").offsetHeight < (divHeight-105))document.getElementById("divContent").style.height = (divHeight-105) + "px";
	//alert(divHeight);
}

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.onload=ResizeContent;
//window.onresize=ResizeContent;
window.onchange=ResizeContent;
