function sousmenu(numero){
	document.getElementById('submenucontent').innerHTML=document.getElementById('sousmenu'+numero).innerHTML;
}


function survolImg(img, nomImage, type){
   		document.images[nomImage].src = img;
  //   		document.getElementById("guided"+nomImage).style.visibility = type;
   	}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function NewWindow(mypage, myname, w, h) {
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes'
		win = window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}


function preloadliens() {
	MM_preloadImages('/images/bouton-dl.gif','/images/bouton-contact.gif');
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function VerifValeur(valeur) { // fonction qui teste si la valeur entrée est bien numérique
	var exp=new RegExp("^[0-9]*([,\.][0-9]+)?$",""); // on vérifie si c'est bien un nombre
	if (exp.test(valeur)) return true;
	else return false;
}



<!-- Begin

// Copyright © 2000 by Apple Computer, Inc., All Rights Reserved.
//
// You may incorporate this Apple sample code into your own code
// without restriction. This Apple sample code has been provided "AS IS"
// and the responsibility for its operation is yours. You may redistribute
// this code, but you are not permitted to redistribute it as
// "Apple sample code" after having made changes.
//
// ************************
// layer utility routines *
// ************************

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility

function moveObject(objectId, newXCoordinate, newYCoordinate) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.left = newXCoordinate;
	styleObject.top = newYCoordinate;
	return true;
    } else {
	// we couldn't find the object, so we can't very well move it
	return false;
    }
} // moveObject




// Copyright © 2000 by Apple Computer, Inc., All Rights Reserved.
//
// You may incorporate this Apple sample code into your own code
// without restriction. This Apple sample code has been provided "AS IS"
// and the responsibility for its operation is yours. You may redistribute
// this code, but you are not permitted to redistribute it as
// "Apple sample code" after having made changes.
// ********************************
// application-specific functions *
// ********************************

// store variables to control where the popup will appear relative to the cursor position
// positive numbers are below and to the right of the cursor, negative numbers are above and to the left
var xOffset = -370;
var yOffset = -250;

function showPopup (targetObjectId, eventObj) {
    if(eventObj) {
	// hide any currently-visible popups
	hideCurrentPopup();
	// stop event from bubbling up any farther
	eventObj.cancelBubble = true;
	// move popup div to current cursor position 
	// (add scrollTop to account for scrolling for IE)
	var newXCoordinate = (eventObj.pageX)?eventObj.pageX + xOffset:eventObj.x + xOffset + ((document.body.scrollLeft)?document.body.scrollLeft:0);
	var newYCoordinate = (eventObj.pageY)?eventObj.pageY + yOffset:eventObj.y + yOffset + ((document.body.scrollTop)?document.body.scrollTop:0);
	moveObject(targetObjectId, newXCoordinate, newYCoordinate);
	// and make it visible
	if( changeObjectVisibility(targetObjectId, 'visible') ) {
	    // if we successfully showed the popup
	    // store its Id on a globally-accessible object
	    window.currentlyVisiblePopup = targetObjectId;
	    return true;
	} else {
	    // we couldn't show the popup, boo hoo!
	    return false;
	}
    } else {
	// there was no event object, so we won't be able to position anything, so give up
	return false;
    }
} // showPopup

function hideCurrentPopup() {
    // note: we've stored the currently-visible popup on the global object window.currentlyVisiblePopup
    if(window.currentlyVisiblePopup) {
	changeObjectVisibility(window.currentlyVisiblePopup, 'hidden');
	window.currentlyVisiblePopup = false;
    }
} // hideCurrentPopup



// ***********************
// hacks and workarounds *
// ***********************

// initialize hacks whenever the page loads
window.onload = initializeHacks;

// setup an event handler to hide popups for generic clicks on the document
document.onclick = hideCurrentPopup;

function initializeHacks() {
    // this ugly little hack resizes a blank div to make sure you can click
    // anywhere in the window for Mac MSIE 5
    if ((navigator.appVersion.indexOf('MSIE 5') != -1) 
	&& (navigator.platform.indexOf('Mac') != -1)
	&& getStyleObject('blankDiv')) {
	window.onresize = explorerMacResizeFix;
    }
    resizeBlankDiv();
    // this next function creates a placeholder object for older browsers
    createFakeEventObj();
}

function createFakeEventObj() {
    // create a fake event object for older browsers to avoid errors in function call
    // when we need to pass the event object to functions
    if (!window.event) {
	window.event = false;
    }
} // createFakeEventObj

function resizeBlankDiv() {
    // resize blank placeholder div so IE 5 on mac will get all clicks in window
    if ((navigator.appVersion.indexOf('MSIE 5') != -1) 
	&& (navigator.platform.indexOf('Mac') != -1)
	&& getStyleObject('blankDiv')) {
	getStyleObject('blankDiv').width = document.body.clientWidth - 20;
	getStyleObject('blankDiv').height = document.body.clientHeight - 20;
    }
}

function explorerMacResizeFix () {
    location.reload(false);
}


//----------------------------------------------
// Affichage d'un Objet déclaré dans le document...
//----------------------------------------------
function Affiche_OBJ(){
  var Arg = arguments; // Récup liste des arguments passée à la fonction
  var Obj;
  for( var i=0; i< Arg.length; i++){ // On parcours la liste
    Obj = document.getElementById( Arg[i]); // Récup Objet correspondant
    if( Obj){
      Obj.style.visibility = "visible";
      //-- Ou autre méthode
      Obj.style.display = "block";
    }
  }
}
//----------------------------------------------
// Masquage d'un Objet déclaré dans le document...
//----------------------------------------------
function Masque_OBJ(){
  var Arg = arguments; // Récup liste des arguments passée à la fonction
  var Obj;
  for( var i=0; i< Arg.length; i++){ // On parcours la liste
    Obj = document.getElementById( Arg[i]); // Récup Objet correspondant
    if( Obj){
      Obj.style.visibility = "hidden";
      //-- Ou autre méthode
      Obj.style.display = "none";
    }
  }
}

//  End -->

//--------------------------------------------
//  Fonction Popup ajout commentaire ...
//--------------------------------------------
function commentaires(numero) { 
	window.open('commentaire/commentaires.php?num='+numero,'commentaires','top=0, left=0, resizable=no, scrollbars=no, width=630, height=200');
}

function commentaires2(numero) { 
	window.open('../application/commentaire/commentaires.php?num='+numero,'commentaires','top=0, left=0, resizable=no, scrollbars=no, width=630, height=200');
}


function focusRadio(id) { 
	document.getElementById(id).checked;
}



//----------------------------------------------------
//             Fonction clic images
//----------------------------------------------------

function check(checkboxid) {
	
	/*var oDiv = document.getElementById(divid).getElementsByTagName('img'), iI = oDiv.length;
	//alert (iI);
	for(; iI > 0; iI--){
		document.getElementById("image"+iI).className = 'noselection';
		document.getElementById("checkbox"+iI).checked = 0; 
	}
	document.getElementById("checkbox"+checkboxid).checked = "checked";
	document.getElementById("image"+checkboxid).className = "selection"; 	
	*/
	
	var iI = document.form1.visu.length;
	for(; iI > 0; iI--){
		document.getElementById("image_visu_"+iI).className = 'noselection';
		document.getElementById("checkbox_visu_"+iI).checked = 0; 
	}
	document.getElementById("checkbox_visu_"+checkboxid).checked = "checked";
	document.getElementById("image_visu_"+checkboxid).className = "selection"; 	
	
}   

function check2(checkboxid2) {

	var i=3;
	for(; i > 0; i--){
		document.getElementById("image_menu"+i).className = 'noselection_menu';
		document.getElementById("check_image_menu"+i).checked = 0;
	}
	document.getElementById("check_image_menu"+checkboxid2).checked = "checked";
	document.getElementById("image_menu"+checkboxid2).className = "selection_menu";
	document.form1.submit();
}   


//-------------------------------------------------------------------------
//				FADER -> fait apparaitre lentement un calque ....
//-------------------------------------------------------------------------

var iOpacity = 0;
var timer = 0;

function FadeById(id) {
	
	var elem = document.getElementById(id);
	elem.style.display = "block";
	elem.style.opacity = 0;
	elem.style.MozOpacity = 0;
	elem.style.KhtmlOpacity = 0;
	elem.style.filter = "alpha(opacity=0)";
	
	timer = setInterval("FadeIn('"+id+"')", 40);
}

function CancelFadeById() {
	if (timer == 0) return;
	clearInterval(timer);
	timer = 0;
}

function FadeIn(id) {
	var elem = document.getElementById(id);
	
	if (iOpacity >= 1) {
		iOpacity = 0;
		CancelFadeById();
		return;
	}
	
	iOpacity += 0.1;
	elem.style.opacity = iOpacity;
	elem.style.MozOpacity = iOpacity;
	elem.style.KhtmlOpacity = iOpacity;
	elem.style.filter = "alpha(opacity=" + iOpacity * 100 + ")";
}



function masquerCalque(id){
	var elem = document.getElementById(id);
	elem.style.opacity = 0;
	elem.style.MozOpacity = 0;
	elem.style.KhtmlOpacity = 0;
	elem.style.filter = "alpha(opacity=0)";
	clearInterval(timer);
	timer = 0;
	iOpacity = 0;
	elem.style.display = "none";
}



// EFFECTS JS ********************** AJAX ****************** AJOUTER PAR OP *********************************

function $(id){
return document.getElementById(id);
}
function STO(_24,_25){
return window.setTimeout(_24,_25);
}
function DecToHexa(_26){
var _27=parseInt(_26).toString(16);
if(_26<16){
_27="0"+_27;
}
return _27;
}
function addslashes(str){
str=str.replace(/\"/g,"\\\"");
str=str.replace(/\'/g,"\\'");
return str;
}
function $toggle(id){
if(act_height(id)==0){
$blinddown(id);
}else{
$blindup(id);
}
}
function act_height(id){
height=$(id).clientHeight;
if(height==0){
height=$(id).offsetHeight;
}
return height;
}
function act_width(id){
width=$(id).clientWidth;
if(width==0){
width=$(id).offsetWidth;
}
return width;
}
function max_height(id){
var ids=$(id).style;
ids.overflow="hidden";
if(act_height(id)!=0){
return act_height(id);
}else{
origdisp=ids.display;
origheight=ids.height;
origpos=ids.position;
origvis=ids.visibility;
ids.visibility="hidden";
ids.height="";
ids.display="block";
ids.position="absolute";
height=act_height(id);
ids.display=origdisp;
ids.height=origheight;
ids.position=origpos;
ids.visibility=origvis;
return height;
}
}

function $blindup(id,_2f){
if(!_2f){
_2f=200;
}
acth=act_height(id);
maxh=max_height(id);
if(acth==maxh){
$(id).style.display="block";
var _30;
_30=Math.ceil(_2f/acth);
for(i=0;i<=acth;i++){
newh=acth-i;
STO("$('"+id+"').style.height='"+newh+"px'",_30*i);
}
}
}
function $blinddown(id,_32){
if(!_32){
_32=200;
}
acth=act_height(id);
if(acth==0){
maxh=max_height(id);
$(id).style.display="block";
$(id).style.height="0px";
var _33;
_33=Math.ceil(_32/maxh);
for(i=1;i<=maxh;i++){
STO("$('"+id+"').style.height='"+i+"px'",_33*i);
}
}
}

function $opacity(id,_35,_36,_37){
if($(id).style.width==0){
$(id).style.width=act_width(id);
}
var _38=Math.round(_37/100);
var _39=0;
if(_35>_36){
for(i=_35;i>=_36;i--){
STO("changeOpac("+i+",'"+id+"')",(_39*_38));
_39++;
}
}else{
if(_35<_36){
for(i=_35;i<=_36;i++){
STO("changeOpac("+i+",'"+id+"')",(_39*_38));
_39++;
}
}
}
}

function pulsate(id,num,speed){
if (!speed) speed = 300;
for(i = 1; i <= num; i++) {
numx=i*((speed*2)+100)-(speed*2);
STO("$opacity('"+id+"', 100, 0, "+speed+")",numx);
STO("$opacity('"+id+"', 0, 100, "+speed+")",numx+speed+100);
}
}
function changeOpac(_3a,id){
var ids=$(id).style;
ids.opacity=(_3a/100);
ids.MozOpacity=(_3a/100);
ids.KhtmlOpacity=(_3a/100);
ids.filter="alpha(opacity="+_3a+")";
}
function $shiftOpacity(id,_3e){
if($(id).style.opacity<0.5){
$opacity(id,0,100,_3e);
}else{
$opacity(id,100,0,_3e);
}
}
function currentOpac(id,_40,_41){
var _42=100;
if($(id).style.opacity<100){
_42=$(id).style.opacity*100;
}
$opacity(id,_42,_40,_41);
}

function highlight(id,_44,_45,_46){
	if(_44){
		milli=_44;
	}else{
		milli=900;
	}
	if(_45){
		endcol=_45;
	}else{
		endcol="#f1f1f1";
	}
	if(_46){
		origcol=_46;
	}else{
		origcol="#ffffcc";
	}
	$colorize(origcol,endcol,id,milli,"high");
}

function $textColor(id,_48,_49,_4a){
if(_4a){
milli=_4a;
}else{
milli=900;
}
$colorize(_48,_49,id,milli,"text");
}
function $morphColor(id,_4c,_4d,_4e,_4f,_50,_51,_52){
if(_52){
milli=_52;
}else{
milli=900;
}
$colorize(_4c,_4d,id,milli,"text");
$colorize(_4e,_4f,id,milli,"back");
if(_50!=false){
$colorize(_50,_51,id,milli,"border");
}
}
function $colorize(_53,end,id,_56,_57){
dr=parseInt(_53.substring(1,3),16);
dg=parseInt(_53.substring(3,5),16);
db=parseInt(_53.substring(5,7),16);
fr=parseInt(end.substring(1,3),16);
fg=parseInt(end.substring(3,5),16);
fb=parseInt(end.substring(5,7),16);
steps=_56/10;
cr=dr;
cg=dg;
cb=db;
sr=(fr-dr)/steps;
sg=(fg-dg)/steps;
sb=(fb-db)/steps;
var zzi=10;
for(var x=0;x<steps;x++){
color="#"+DecToHexa(cr)+DecToHexa(cg)+DecToHexa(cb);
if(x==(steps-1)){
if(_57=="high"){
color="";
}else{
color=end;
}
}
mytime=(x);
if(_57=="back"||_57=="high"){
newfonc="$(\""+id+"\").style.backgroundColor=\""+color+"\";";
}else{
if(_57=="text"){
newfonc="$(\""+id+"\").style.color=\""+color+"\";";
}else{
if(_57=="border"){
newfonc="$(\""+id+"\").style.borderColor=\""+color+"\";";
}
}
}
STO(newfonc,zzi);
cr+=sr;
cg+=sg;
cb+=sb;
zzi+=10;
}
}

/**********************************************************************************************************
*									!!! SELECT DE TABLEAU !!!
***********************************************************************************************************/


var id_select;

/* colore la ligne en transparent*/
function transp(ligne)
{
    ligne.style.background='transparent';
}

/* colore la ligne */
function lavend(ligne, Nbligne)
{
	if(document.getElementById("choix_devis"+Nbligne).checked == 0) {
		ligne.style.background='#ffffcc'; 
	}
}




function selec(ligne, Nbligne)
{
	var NbResult = document.form1.choix_devis.length;
	var elem = document.getElementById(ligne);


	if(NbResult==2) {
		
		if(document.getElementById("choix_devis"+Nbligne).checked == 0) {
	
			if(NbResult==Nbligne) {
				
				// Déselection
				$opacity('divtab1',100,35,1000);
				document.getElementById("1_1").className="tab_defaut2";
				document.getElementById("1_2").className="tab_defaut2";
				document.getElementById("1_3").className="tab_defaut2";
				document.getElementById("ico1_1_moins").style.display = "none";
				document.getElementById("ico1_1_plus").style.display = "none";
				document.getElementById("ico1_2_moins").style.display = "none";
				document.getElementById("ico1_2_plus").style.display = "none";
				document.getElementById("1_1_1").className="fondtab2";
				document.getElementById("1_2_2").className="fondtab2";
				document.getElementById("1_3_3").className="fondtab2";
	
				// Sélection
				document.getElementById("div_visu").style.display = "block";
				document.getElementById(Nbligne+"_1").className="tab_defaut";
				document.getElementById(Nbligne+"_2").className="tab_defaut";
				document.getElementById(Nbligne+"_3").className="tab_defaut";
				ligne.style.background='transparent';
				document.getElementById(Nbligne+"_1_1").className="fondtab";
				document.getElementById(Nbligne+"_2_2").className="fondtab";
				document.getElementById(Nbligne+"_3_3").className="fondtab";
				
				$opacity("divtab"+Nbligne,35,100,1000);
				document.getElementById("choix_devis"+Nbligne).checked = "checked";
				document.getElementById("tsf"+Nbligne+"_2").checked = "checked";
				document.getElementById("tsp"+Nbligne+"_1").checked = "checked";
				document.getElementById("ico"+Nbligne+"_1_moins").style.display = "block";
				document.getElementById("ico"+Nbligne+"_2_moins").style.display = "block";
				document.getElementById("div_visu").style.display = "block";
				highlight("divtab"+Nbligne, 1000);
		
			}else{
				
				// Déselection ...
				$opacity('divtab2',100,35,1000);
				document.getElementById("2_1").className="tab_defaut2";
				document.getElementById("2_2").className="tab_defaut2";
				document.getElementById("2_3").className="tab_defaut2";
				document.getElementById("ico2_1_moins").style.display = "none";
				document.getElementById("ico2_1_plus").style.display = "none";
				document.getElementById("ico2_2_moins").style.display = "none";
				document.getElementById("ico2_2_plus").style.display = "none";
				document.getElementById("2_1_1").className="fondtab2";
				document.getElementById("2_2_2").className="fondtab2";
				document.getElementById("2_3_3").className="fondtab2";
		
				// Sélection
				document.getElementById("div_visu").style.display = "block";
				document.getElementById(Nbligne+"_1").className="tab_defaut";
				document.getElementById(Nbligne+"_2").className="tab_defaut";
				document.getElementById(Nbligne+"_3").className="tab_defaut";
				ligne.style.background='transparent';
				document.getElementById(Nbligne+"_1_1").className="fondtab";
				document.getElementById(Nbligne+"_2_2").className="fondtab";
				document.getElementById(Nbligne+"_3_3").className="fondtab";
				
				$opacity("divtab"+Nbligne,35,100,1000);
				document.getElementById("choix_devis"+Nbligne).checked = "checked";
				document.getElementById("tsf"+Nbligne+"_2").checked = "checked";
				document.getElementById("tsp"+Nbligne+"_1").checked = "checked";
				document.getElementById("ico"+Nbligne+"_1_moins").style.display = "block";
				document.getElementById("ico"+Nbligne+"_2_moins").style.display = "block";
				document.getElementById("div_visu").style.display = "block";
				highlight("divtab"+Nbligne, 1000);
		
			}
		}
		
	}else{ // Si une seul solution proposée -> Solution Exact
		
		if(document.getElementById("choix_devis"+Nbligne).checked == 0) {
			
			document.getElementById("div_visu").style.display = "block";
			document.getElementById(Nbligne+"_1").className="tab_defaut";
			document.getElementById(Nbligne+"_2").className="tab_defaut";
			document.getElementById(Nbligne+"_3").className="tab_defaut";
			document.getElementById(Nbligne+"_1_1").className="fondtab";
			document.getElementById(Nbligne+"_2_2").className="fondtab";
			document.getElementById(Nbligne+"_3_3").className="fondtab";
			
			document.getElementById("choix_devis"+Nbligne).checked = "checked";
			document.getElementById("tsf"+Nbligne+"_2").checked = "checked";
			document.getElementById("tsp"+Nbligne+"_1").checked = "checked";
			document.getElementById("ico"+Nbligne+"_1_moins").style.display = "block";
			document.getElementById("ico"+Nbligne+"_2_moins").style.display = "block";
		}
	}
}

function icomoins(id)
{
	document.getElementById("ico"+id+"_moins").style.display = "none";
	document.getElementById("ico"+id+"_plus").style.display = "block";
	document.getElementById(id).className="tab_defaut2";
	
	if(id=="1_2" || id=="2_2"){
		document.getElementById("tsf"+id).checked = 0;
		document.getElementById(id+"_2").className="fondtab2";
	}
	if(id=="1_1" || id=="2_1"){
		
		document.getElementById("div_visu").style.display = "none";
		document.getElementById("tsp"+id).checked = 0;
		document.getElementById(id+"_1").className="fondtab2";
		id2 = id.substring(0,1);
		document.getElementById("tsf"+id2+"_2").checked = 0;
		document.getElementById(id2+"_2_2").className="fondtab2";
		document.getElementById("ico"+id2+"_2_moins").style.display = "none";
		document.getElementById("ico"+id2+"_2_plus").style.display = "none";
		document.getElementById(id2+"_2").className="tab_defaut2";


	}
}

function icoplus(id)
{
    //alert(id);
	document.getElementById("ico"+id+"_moins").style.display = "block";
	document.getElementById("ico"+id+"_plus").style.display = "none";
	document.getElementById(id).className="tab_defaut";

	if(id=="1_2" || id=="2_2"){
		document.getElementById("tsf"+id).checked = "checked";
		document.getElementById(id+"_2").className="fondtab";
	}
	if(id=="1_1" || id=="2_1"){
		
		document.getElementById("div_visu").style.display = "block";
		document.getElementById("tsp"+id).checked = "checked";
		document.getElementById(id+"_1").className="fondtab";
		id2 = id.substring(0,1);
		document.getElementById("ico"+id2+"_2_plus").style.display = "block";
	}
}
