function changeCSS(obj, bgColor, bdColor, ftColor) 
{
   	if(document.getElementById) 
   	{
		obj.style.backgroundColor = bgColor;
		obj.style.borderColor = bdColor;
		obj.style.color = ftColor;
	}
}



function validForm(vsForm)
{

	
	/*
	Types
	0 = Aucun
	1 = Numeric
	2 = Emails
	3 = number 
	4 = Number different de 0
	5 = Code Postale
	6 = Telephone
	7 = Code Postale part 1
	8 = Code Postale part 2
	9 = Numeric MAX lenght
	*/
	
	
	/*
	Mandatory
	0 = Aucun
	1 = Obligatoire
	2 = Si des donner valider
	*/
	
	
	
	
	var oForm = document.all(vsForm);
	var oElement;
	var sValue = new String();
	var sFirstError;
	
	
	var iNbrElements = oForm.elements.length;
	var i = 0;
	
	var bValid = true;
	
	while(i < iNbrElements)
	{
		
		oElement = oForm.elements(i);
	
		if(oElement.type == "text" || oElement.type == "textarea" || oElement.type == "password" || oElement.type == "select-one" || oElement.type == "radio")
		{
			if(oElement.type == "select-one")
			{	
				if(oElement.mandatory == 1)
				{	
					if(oElement.selectedIndex == 0)
					{
					
						if (bValid)
						{
							
							oElement.focus();
						}

						bValid = false;
						oElement.className = oElement.errClass;
					
					}
					else
					{
						oElement.className = oElement.validClass;
					}
				}
				
			}else if(oElement.type == "radio"){
			
				if(oElement.mandatory == 1)
				{	
					if ( getSelectedRadio( document.all(oElement.name) ) == -1 ) {
						bValid = false;
				
						for (var j=0; j< document.all(oElement.name).length; j++) {
							document.all(oElement.name)[j].className = document.all(oElement.name)[j].errClass;
						}
					}else{
						for (var j=0; j< document.all(oElement.name).length; j++) {
							document.all(oElement.name)[j].className = document.all(oElement.name)[j].validClass;
						}
					}
				}
				
				
			}else{
			
				sValue = oElement.value;
			
				if(oElement.mandatory == 1)
				{	
					if(oElement.validType == 1)
					{
						if(isNaN(oElement.value) || sValue.length == 0)
						{
							if (bValid)
							{
								
								oElement.focus();
							}

							bValid = false;
							oElement.className = oElement.errClass;
						}
						else
						{
							oElement.className = oElement.validClass;
						}
					}
					else if(oElement.validType == 2)
					{

						if (bValidEmail(oElement.value) == false)
						{
							if (bValid)
							{
								oElement.focus();
							}
							bValid= false;
							oElement.className = oElement.errClass;
							
						}
						else
						{
							oElement.className = oElement.validClass;
						}
					}

					else if(oElement.validType == 3)
					{
						if(isNaN(oElement.value) || sValue.length == 0 || oElement.value > 10 || oElement.value < 1)
						{
							if (bValid)
							{
								
								oElement.focus();
							}

							bValid = false;
							oElement.className = oElement.errClass;
						}
						else
						{
							oElement.className = oElement.validClass;
						}
					}

					else if(oElement.validType == 4)
					{
					
						if(isNaN(oElement.value) || sValue <= 0)
						{
							if (bValid)
							{
								
								oElement.focus();
							}

							bValid = false;
							oElement.className = oElement.errClass;
						}
						else
						{
							oElement.className = oElement.validClass;
						}
					}else if(oElement.validType == 5){

						if (isPostCode(oElement.value) == false)
						{
							if (bValid)
							{
								oElement.focus();
							}
							bValid= false;
							oElement.className = oElement.errClass;
							
						}
						else
						{
							oElement.className = oElement.validClass;
						}
					
					}else if(oElement.validType == 6){

						if (checkPhone(oElement.value) == false)
						{
							if (bValid)
							{
								oElement.focus();
							}
							bValid= false;
							oElement.className = oElement.errClass;
							
						}
						else
						{
							oElement.className = oElement.validClass;
						}
						
					}else if(oElement.validType == 7){

						if (sValue.length != 3)
						{
							if (bValid)
							{
								oElement.focus();
							}
							bValid= false;
							oElement.className = oElement.errClass;
							
						}
						else
						{
							var varBolTemp = true;
							var entry =  sValue.toUpperCase();
							if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(0)) < 0) {
								varBolTemp = false;
							}else if ('0123456789'.indexOf(entry.charAt(1)) < 0) {
								varBolTemp = false;
							}else if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(2)) < 0) {
								varBolTemp = false;
							}
							
							if (varBolTemp == false){
								if (bValid)
								{
									oElement.focus();
								}
								bValid= false;
								oElement.className = oElement.errClass;
							}else{
								oElement.className = oElement.validClass;
							}
							
						}
						
					}else if(oElement.validType == 8){

						if (sValue.length != 3)
						{
							if (bValid)
							{
								oElement.focus();
							}
							bValid= false;
							oElement.className = oElement.errClass;
							
						}
						else
						{
							var entry =  sValue.toUpperCase();
							var varBolTemp = true;
							if ('0123456789'.indexOf(entry.charAt(0)) < 0) {
								varBolTemp = false;
							}else if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(1)) < 0) {
								varBolTemp = false;
							}else if ('0123456789'.indexOf(entry.charAt(2)) < 0) {
								varBolTemp = false;
							}
							
							if (varBolTemp == false){
								if (bValid)
								{
									oElement.focus();
								}
								bValid= false;
								oElement.className = oElement.errClass;
							}else{
								oElement.className = oElement.validClass;
							}
						}
						
						
						
					}else if(oElement.validType == 9){
					
					
						if(isNaN(oElement.value) || sValue.length != oElement.maxLength )
						{
							if (bValid)
							{
								
								oElement.focus();
							}

							bValid = false;
							oElement.className = oElement.errClass;
						}
						else
						{
							oElement.className = oElement.validClass;
						}
						
					}else{
						if(sValue.length == 0)
						{
							if (bValid)
							{
								
								oElement.focus();
							}

							bValid = false;
							oElement.className = oElement.errClass;
						}
						else
						{
							oElement.className = oElement.validClass;
						}
					}
					
				}else if(oElement.mandatory == 2){
				
					if(oElement.validType == 1){
					
						if (sValue.length != 0) {
							if(isNaN(oElement.value) || sValue.length == 0)
							{
								if (bValid)
								{
									
									oElement.focus();
								}

								bValid = false;
								oElement.className = oElement.errClass;
							}
							else
							{
								oElement.className = oElement.validClass;
							}
						}
						
					}else if(oElement.validType == 2){

						if (sValue.length != 0) {
						
							if (bValidEmail(oElement.value) == false)
							{
								if (bValid)
								{
									oElement.focus();
								}
								bValid= false;
								oElement.className = oElement.errClass;
								
							}
							else
							{
								oElement.className = oElement.validClass;
							}
						}
					}

					else if(oElement.validType == 3)
					{
					
						if (sValue.length != 0) {
							if(isNaN(oElement.value) || sValue.length == 0 || oElement.value > 10 || oElement.value < 1)
							{
								if (bValid)
								{
									
									oElement.focus();
								}

								bValid = false;
								oElement.className = oElement.errClass;
							}
							else
							{
								oElement.className = oElement.validClass;
							}
						}
						
					}else if(oElement.validType == 4){
					
						if (sValue.length != 0) {
							if(isNaN(oElement.value) || sValue <= 0)
							{
								if (bValid)
								{
									
									oElement.focus();
								}

								bValid = false;
								oElement.className = oElement.errClass;
							}
							else
							{
								oElement.className = oElement.validClass;
							}
						}
					}else if(oElement.validType == 5){

						if (sValue.length != 0) {
							if (isPostCode(oElement.value) == false)
							{
								if (bValid)
								{
									oElement.focus();
								}
								bValid= false;
								oElement.className = oElement.errClass;
								
							}
							else
							{
								oElement.className = oElement.validClass;
							}
						}
						
					}else if(oElement.validType == 6){

						if (sValue.length != 0) {
							if (checkPhone(oElement.value) == false)
							{
								if (bValid)
								{
									oElement.focus();
								}
								bValid= false;
								oElement.className = oElement.errClass;
								
							}
							else
							{
								oElement.className = oElement.validClass;
							}
						}
					}else if(oElement.validType == 7){

						if (sValue.length != 0) {
							if (sValue.length != 3)
							{
								if (bValid)
								{
									oElement.focus();
								}
								bValid= false;
								oElement.className = oElement.errClass;
								
							}
							else
							{
								var varBolTemp = true;
								var entry =  sValue.toUpperCase();
								if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(0)) < 0) {
									varBolTemp = false;
								}else if ('0123456789'.indexOf(entry.charAt(1)) < 0) {
									varBolTemp = false;
								}else if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(2)) < 0) {
									varBolTemp = false;
								}
								
								if (varBolTemp == false){
									if (bValid)
									{
										oElement.focus();
									}
									bValid= false;
									oElement.className = oElement.errClass;
								}else{
									oElement.className = oElement.validClass;
								}
								
							}
						}else{
							oElement.className = oElement.validClass;
						}
						
					}else if(oElement.validType == 8){
						if (sValue.length != 0) {
							if (sValue.length != 3)
							{
								if (bValid)
								{
									oElement.focus();
								}
								bValid= false;
								oElement.className = oElement.errClass;
								
							}
							else
							{
								var entry =  sValue.toUpperCase();
								var varBolTemp = true;
								if ('0123456789'.indexOf(entry.charAt(0)) < 0) {
									varBolTemp = false;
								}else if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(1)) < 0) {
									varBolTemp = false;
								}else if ('0123456789'.indexOf(entry.charAt(2)) < 0) {
									varBolTemp = false;
								}
								
								if (varBolTemp == false){
									if (bValid)
									{
										oElement.focus();
									}
									bValid= false;
									oElement.className = oElement.errClass;
								}else{
									oElement.className = oElement.validClass;
								}
							}
						
						}else{
							oElement.className = oElement.validClass;
						}
					}else if(oElement.validType == 9){
					
						if (sValue.length != 0) {
							if(isNaN(oElement.value) || sValue.length != oElement.maxLength )
							{
								if (bValid)
								{
									
									oElement.focus();
								}

								bValid = false;
								oElement.className = oElement.errClass;
							}
							else
							{
								oElement.className = oElement.validClass;
							}
						}else{
							oElement.className = oElement.validClass;
						}
					}

				}else{
					if(oElement.validType == 1)
					{
						if(isNaN(oElement.value) && sValue.length != 0)
						{
							if (bValid)
							{
								
								oElement.focus();
							}

							bValid = false;
							oElement.className = oElement.errClass;
						}
						else
						{
							oElement.className = oElement.validClass;
						}
					}
				}
			}
		}
		
		i = i + 1;
	}
	
	
	return bValid;
	
}


function bValidEmail(vsEmail)
{

	var sEmail = vsEmail
	var iA = 0;
	var iDot = 0;
	var i = 0;
	var bValid = true;

	
	while(i < sEmail.length && bValid)
	{
		
		if(sEmail.charAt(i) == "@")
		{
			if(iA == 0 && i != 0)
			{
				iA = i;
			}
			else
			{
				bValid = false;
			}
		}
	
		if(sEmail.charAt(i) == "." && iA != 0)
		{
			if(i > (iA + 1) && i != sEmail.length - 1)
			{
				iDot = i;
			}
			else
			{
				bValid = false;
			}
		}
		
		i = i + 1;
		
	}

	if(iA == 0 || iDot == 0)
	{
		bValid = false;
	}
	
	return bValid;

}


function isPostCode(entry){

	entry=entry.toUpperCase();

	if (entry.length >= 6 ){
								
		if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(0)) < 0) {
			return false;
		}

		if ('0123456789'.indexOf(entry.charAt(1)) < 0) {
			return false;
		}

		if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(2)) < 0) {
			return false;
		}

		if ( ' '.indexOf(entry.charAt(3)) == -1 && '-'.indexOf(entry.charAt(3)) == -1){

									
			if (entry.length == 6 ){
				if ('0123456789'.indexOf(entry.charAt(3)) < 0) {
					return false;
				}

				if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(4)) < 0) {
					return false;
				}

				if ('0123456789'.indexOf(entry.charAt(5)) < 0) {
					return false;
				}
			}else{
				return false;
			}
		}else{

			if (entry.length == 7 ){
				if ('0123456789'.indexOf(entry.charAt(4)) < 0) {
					return false;
				}

				if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(5)) < 0) {
					return false;
				}

				if ('0123456789'.indexOf(entry.charAt(6)) < 0) {
					return false;
				}
			}else{
				return false;
			}
		}
	}else{
		return false;
	}
	return true;
}


function getSelectedRadio(buttonGroup) {
	// returns the array number of the selected radio button or -1 if no button is selected
	if (buttonGroup[0]) { // if the button group is an array (one button is not an array)
		for (var i=0; i<buttonGroup.length; i++) {
			if (buttonGroup[i].checked) {
				return i
			}
		}
	} else {
		if (buttonGroup.checked) { return 0; } // if the one button is checked, return zero
	}
	   // if we get to this point, no radio button is selected
	return -1;
} // Ends the "getSelectedRadio" function

	function getSelectedRadioValue(buttonGroup) {
	   // returns the value of the selected radio button or "" if no button is selected
	   var i = getSelectedRadio(buttonGroup);
	   if (i == -1) {
	      return "";
	   } else {
	      if (buttonGroup[i]) { // Make sure the button group is an array (not just one button)
	         return buttonGroup[i].value;
	      } else { // The button group is just the one button, and it is checked
	         return buttonGroup.value;
	      }
	   }
	} // Ends the "getSelectedRadioValue" function
	
	
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkPhone(strPhone){
	s=stripCharsInBag(strPhone,validWorldPhoneChars);
	return (isInteger(s) && s.length == minDigitsInIPhoneNumber);
}

function confirmDelete(sName)
{
	var bConfirm; 
	bConfirm = window.confirm("Ętes-vous certain de vouloir supprimer " + sName + '?');
	return bConfirm; 
}

function submitForm(vsForm)
{
	document.all(vsForm).submit();
}

/*************************************************  Menu  *********************************************/


<!--
HM_DOM = (document.getElementById) ? true : false;
HM_NS4 = (document.layers) ? true : false;
HM_IE = (document.all) ? true : false;
HM_IE4 = HM_IE && !HM_DOM;
HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
HM_IE4M = HM_IE4 && HM_Mac;
HM_Opera = (navigator.userAgent.indexOf("Opera")!=-1);
HM_Konqueror = (navigator.userAgent.indexOf("Konqueror")!=-1);
HM_IsMenu = !HM_Opera && !HM_Konqueror && !HM_IE4M && (HM_DOM || HM_NS4 || HM_IE4);
HM_BrowserString = HM_NS4 ? "NS4" : HM_DOM ? "DOM" : "IE4";

if(window.event + "" == "undefined") event = null;
function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;

//-->


function getAlign(viMenu)
{	
	var i = 1;
	var iBrowserWidth = document.body.clientWidth;
	var iPageWidth = 763;
	var iLeftMenuWidth = 2;
	
	var iReturn = 0;


	if(iBrowserWidth > iPageWidth)
	{
		iReturn = ((iBrowserWidth - iPageWidth) / 2) + iLeftMenuWidth;
	}
	else
	{
		iReturn = iLeftMenuWidth;
	}
	
	return iReturn;
}

<!--
HM_PG_MenuWidth = 150;
HM_PG_FontFamily = "arial";
HM_PG_FontSize = 11;
HM_PG_FontBold = 0;
HM_PG_FontItalic = 0;
HM_PG_FontColor = "#E7E7E7";
HM_PG_FontColorOver = "white";
HM_PG_BGColor = "#C0CED0";
HM_PG_BGColorOver = "#336699";
HM_PG_ItemPadding = 5;

HM_PG_BorderWidth = 1;
HM_PG_BorderColor = "#65898C";
HM_PG_BorderStyle = "solid";
HM_PG_SeparatorSize = 1;
HM_PG_SeparatorColor = "#65898C";

HM_PG_ImageSrc = "arrow_off.gif";
HM_PG_ImageSrcLeft = "arrow_off.gif";
HM_PG_ImageSrcOver = "arrow_on.gif";
HM_PG_ImageSrcLeftOver = "arrow_on.gif";

HM_PG_ImageSize = 10;
HM_PG_ImageHorizSpace = 3;
HM_PG_ImageVertSpace = 1;

HM_PG_KeepHilite = true; 
HM_PG_ClickStart = 0;
HM_PG_ClickKill = false;
HM_PG_ChildOverlap = 0;
HM_PG_ChildOffset = 0;
HM_PG_ChildPerCentOver = null;
HM_PG_TopSecondsVisible = .1;
HM_PG_ChildSecondsVisible = .3; 
HM_PG_StatusDisplayBuild = 0;
HM_PG_StatusDisplayLink = true;
HM_PG_UponDisplay = null;
HM_PG_UponHide = null;
HM_PG_RightToLeft = 0;

HM_PG_CreateTopOnly = 0;
HM_PG_ShowLinkCursor = 1;
HM_PG_NSFontOver = true;

function HM_f_PositionMenu(topmenuid) {
	var MinimumPixelLeft = 0;
	var TheMenu = HM_DOM ? document.getElementById(topmenuid) : HM_IE4 ? document.all(topmenuid) : eval("window." + topmenuid);
	var TheMenuWidth = HM_DOM ? parseInt(TheMenu.style.width) : HM_IE4 ? TheMenu.style.pixelWidth : TheMenu.clip.width;
	var TheContentWidth = HM_DOM ? 763 : 778 
	var TheWindowWidth = HM_IE ? (HM_DOM ? HM_IEcanvas.clientWidth : document.body.clientWidth) : window.innerWidth;
	return Math.max(parseInt((TheWindowWidth-TheContentWidth) / 2),MinimumPixelLeft);
}


	
//HM_a_TreesToBuild = [2];
//-->

