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_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_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 clear_textbox(Id)
	{			
		document.getElementById(Id).value = "";
	} 
	
function changePhoto(no,w,h)
{window.document.monimage.src= no;
window.document.monimage.width= w;
window.document.monimage.height= h;}

function newwin(ref)
{window.open(ref,'ref','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=200,height=170');}
function changePhoto(no,w,h)
{window.document.monimage.src= no;
window.document.monimage.width= w;
window.document.monimage.height= h;}

function whatever(url){
		if (url == -1) {
					window.location = "Index.aspx";
		}
}


function dispHandle(obj) 
							{
			obj.style.display = "";
							}
  
   function hideHandle(obj) 
							{	
			obj.style.display = "none";
							}

		
			
	function showAll()
	{
	var nombre=document.Form1.DD_NBRC.options[document.Form1.DD_NBRC.options.selectedIndex].value;
	
						hideHandle(DD1);
						hideHandle(DD2);
						hideHandle(DD3);
						hideHandle(DD4);
						hideHandle(DD5);
						hideHandle(DD6);
						hideHandle(DD7);
						hideHandle(DD8);
						hideHandle(DD9);
						hideHandle(DD10);
				if(nombre>=1)
					{
						dispHandle(DD1);
						hideHandle(DD2);
						hideHandle(DD3);
						hideHandle(DD4);
						hideHandle(DD5);
						hideHandle(DD6);
						hideHandle(DD7);
						hideHandle(DD8);
						hideHandle(DD9);
						hideHandle(DD10);
					}

					if(nombre>=2)
					{
						dispHandle(DD1);
						dispHandle(DD2);
						hideHandle(DD3);
						hideHandle(DD4);
						hideHandle(DD5);
						hideHandle(DD6);
						hideHandle(DD7);
						hideHandle(DD8);
						hideHandle(DD9);
						hideHandle(DD10);
					}
					if(nombre>=3)
					{
						dispHandle(DD1);
						dispHandle(DD2);
						dispHandle(DD3);
						hideHandle(DD4);
						hideHandle(DD5);
						hideHandle(DD6);
						hideHandle(DD7);
						hideHandle(DD8);
						hideHandle(DD9);
						hideHandle(DD10);
					}
					if(nombre>=4)
					{
						dispHandle(DD1);
						dispHandle(DD2);
						dispHandle(DD3);
						dispHandle(DD4);
						hideHandle(DD5);
						hideHandle(DD6);
						hideHandle(DD7);
						hideHandle(DD8);
						hideHandle(DD9);
						hideHandle(DD10);
					}
					if(nombre>=5)
					{
						dispHandle(DD1);
						dispHandle(DD2);
						dispHandle(DD3);
						dispHandle(DD4);
						dispHandle(DD5);
						hideHandle(DD6);
						hideHandle(DD7);
						hideHandle(DD8);
						hideHandle(DD9);
						hideHandle(DD10);
					}
					if(nombre>=6)
					{
						dispHandle(DD1);
						dispHandle(DD2);
						dispHandle(DD3);
						dispHandle(DD4);
						dispHandle(DD5);
						dispHandle(DD6);
						hideHandle(DD7);
						hideHandle(DD8);
						hideHandle(DD9);
						hideHandle(DD10);
					}

					if(nombre>=7)
					{
						dispHandle(DD1);
						dispHandle(DD2);
						dispHandle(DD3);
						dispHandle(DD4);
						dispHandle(DD5);
						dispHandle(DD6);
						dispHandle(DD7);
						hideHandle(DD8);
						hideHandle(DD9);
						hideHandle(DD10);
					}

					if(nombre>=8)
					{
						dispHandle(DD1);
						dispHandle(DD2);
						dispHandle(DD3);
						dispHandle(DD4);
						dispHandle(DD5);
						dispHandle(DD6);
						dispHandle(DD7);
						dispHandle(DD8);
						hideHandle(DD9);
						hideHandle(DD10);
					}

					if(nombre>=9)
					{
						dispHandle(DD1);
						dispHandle(DD2);
						dispHandle(DD3);
						dispHandle(DD4);
						dispHandle(DD5);
						dispHandle(DD6);
						dispHandle(DD7);
						dispHandle(DD8);
						dispHandle(DD9);
						hideHandle(DD10);
					}

					if(nombre>=10)
					{
						dispHandle(DD1);
						dispHandle(DD2);
						dispHandle(DD3);
						dispHandle(DD4);
						dispHandle(DD5);
						dispHandle(DD6);
						dispHandle(DD7);
						dispHandle(DD8);
						dispHandle(DD9);
						dispHandle(DD10);
					}
	}
	
		function validate_func(source, arguments)
       {
              var  max_var=parseInt(document.Form1.DD_NBRA.options[document.Form1.DD_NBRA.options.selectedIndex].value)+parseInt(document.Form1.DD_NBRE.options[document.Form1.DD_NBRE.options.selectedIndex].value);
              var  min_var=Math.ceil((parseInt(document.Form1.DD_NBRA.value)+parseInt(document.Form1.DD_NBRE.value))/4);
             
             if(min_var<= parseInt(document.Form1.DD_NBRC.options[document.Form1.DD_NBRC.options.selectedIndex].value) && max_var >=parseInt(document.Form1.DD_NBRC.options[document.Form1.DD_NBRC.options.selectedIndex].value))
                 { 
					arguments.IsValid = true;
					showAll();
                  }
                  else
                  {
                  arguments.IsValid = false;
                  } 
                  
       }
       
function Upper(e,r)
{
	r.value = r.value.toUpperCase();
} 
   
function Lower(e,r)
{
	r.value = r.value.toLowerCase();
} 


function DisableNonNumericCharacters(fld, e, allowSpace,isDouble)
{
	var space='';
	var strCheck;
	if(allowSpace!=null && allowSpace==true)
		space=' ';
	if (isDouble !=null && isDouble == true)
	 strCheck = '0123456789.' + space;
	else
	 strCheck = '0123456789' + space;
	 
	var aux = aux2 = '';
	var whichCode = (window.Event) ? e.which : e.keyCode;
	if (whichCode == 13) return true;  // Enter
	key = String.fromCharCode(whichCode);  // Get key value from key code
	if (strCheck.indexOf(key) == -1)
		return false;  // Not a valid key
	return true;
}

function urlProg(url)
{
location.href=url;
}

function plusInfo(info)
{
	alert(info);
}

function Copy_De_Facturation_Livraison()
 {
		 document.Form1.AdrL_Nom.value		= document.Form1.AdrF_Nom.value;
		 document.Form1.AdrL_Prenom.value	= document.Form1.AdrF_Prenom.value;
		 document.Form1.AdrL_Adr.value		= document.Form1.AdrF_Adr.value;
		 document.Form1.AdrL_POS.value		= document.Form1.AdrF_POS.value;
		 document.Form1.AdrL_Ville.value	= document.Form1.AdrF_Ville.value;
		 document.Form1.AdrL_Pays.value		= document.Form1.AdrF_Pays.value;
		 
		 document.Form1.AdrL_TelD.value		= document.Form1.AdrF_TelD.value;
		 document.Form1.AdrL_TelM.value		= document.Form1.AdrF_TelM.value;
		 document.Form1.AdrL_TelP.value		= document.Form1.AdrF_TelP.value;
 }



var gAutoPrint = true; // Flag for whether or not to automatically call the print function
function printSpecial()
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';

		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
		
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
			var hh = html;
			hh.replace('DEVIS','CAP UNIVERS - DEVIS RECAPITULATIF');	
			html = hh;
		}
		
		html += '\n</HE' + 'AD>\n<BODY>\n';
		
		var printReadyElem = document.getElementById("printReady");
				
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else

		{

			alert("Could not find the printReady section in the HTML");
			return;

		}

		html += '\n</BO' + 'DY>\n</HT' + 'ML>';		

		var printWin =window.open("","printSpecial");

		printWin.document.open();

		printWin.document.write(html);

		printWin.document.close();

		if (gAutoPrint)

			printWin.print();

	}

	else

	{

		alert("Sorry, the print ready feature is only available in modern browsers.");

	}

}


function bonvolalert()
{
alert("Ce service n'est pas disponible en ligne \n Pour de plus amples renseignements \n Appelez le 0892 70 71 70")
}

	
		function verify_email()
		 {
					var themessage = "";
					if (document.Form1.cle_email.value=="") {
					themessage = themessage + " \n- Email est un champ obligatoire\n";
					}
								
					if (themessage != "") 
					{
						alert(themessage);
						return false;
					}
					else
					{
						document.Form1.action="clientemail.aspx?cle_email="+document.Form1.cle_email.value+"&s_cle_code=0";
						document.Form1.submit();
					}
					
					
		}
	


