function affiche_cmd() {
cmd = window.open("", "EnCoursCmd", "height=500,width=800,menubar=yes,scrollbars=yes")
}

function affiche_dem() {
dem = window.open("", "EnCoursDem", "height=500,width=800,menubar=yes,scrollbars=yes")
}

function affiche_suivi_cmd() {
scmd = window.open("", "SuiviCmd", "height=600,width=800,menubar=yes,scrollbars=yes")
}

function affiche_suivi_dem() {
sdem = window.open("", "SuiviDem", "height=600,width=800,menubar=yes,scrollbars=yes")
}

function f_open(url,wname) {
window.open(url, wname, "height=600,width=800,scrollbars=yes")
}

function entete_cmd() {
	if (document.cmdFrm02.w_nb_enreg.value!="0") {
		window.location="entcmd.jsp";
	}
}

function entete_dem() {
	if (document.cmdFrm02.w_nb_enreg.value!="0") {
		window.location="entdem.jsp";
	}
}

function valurg() {
	if (document.cmdFrm11.ent_urg[0].checked) {
		document.cmdFrm11.lib_urg.value="L'exp&eacute;dition pourra &ecirc;tre fractionn&eacute;e, selon la disponibilit&eacute; des articles";
	}
	if (document.cmdFrm11.ent_urg[1].checked) {
		document.cmdFrm11.lib_urg.value="L'exp&eacute;dition pourra &ecirc;tre fractionn&eacute;e, selon la disponibilit&eacute; des articles";
	}
} 

function valliv() {
	if (document.cmdFrm11.ent_liv[document.cmdFrm11.ent_liv.selectedIndex].value=="ENL") {
		document.cmdFrm11.lib_liv.value="Enlevé";
	}
	if (document.cmdFrm11.ent_liv[document.cmdFrm11.ent_liv.selectedIndex].value=="EXP") {
		document.cmdFrm11.lib_liv.value="Express";
	}
	if (document.cmdFrm11.ent_liv[document.cmdFrm11.ent_liv.selectedIndex].value=="MSG") {
		document.cmdFrm11.lib_liv.value="Messagerie";
	}
}

function verif_cmd() {
e=0	
	if (document.cmdFrm11.ent_lde1.value<"0") { alert("Destinataire Adresse de Livaison incorrect"); e++;}
	if (document.cmdFrm11.ent_lvoi.value<"0") { alert("Rue Adresse de Livaison incorrecte"); e++;}
	if (document.cmdFrm11.ent_lvil.value<"0") { alert("Ville Adresse de Livaison incorrecte"); e++;}
	if (document.cmdFrm11.ent_lcdp.value<"0") { alert("Code Postal Adresse de Livaison incorrect"); e++;}
	if (document.cmdFrm11.ent_refcli.value<"0") { alert("Référence de Commande incorrecte"); e++;}
	
	var numser="";
	var cc=document.cmdFrm11.wns_cc.value;
	var z1=document.cmdFrm11.wns_z1.value;
	var z2=document.cmdFrm11.wns_z2.value;
	var z5=document.cmdFrm11.wns_z5.value;
	var z6=document.cmdFrm11.wns_z6.value;
	var z7=document.cmdFrm11.wns_z7.value;
	var z8=document.cmdFrm11.wns_z8.value;
	var z9=document.cmdFrm11.wns_z9.value;
	var ns=document.cmdFrm11.wns_ns.value;
	numser=z1+z2+z5+z6+z7+z8+z9+ns
	var bl=numser.indexOf(" ");
	if (numser.length!=0) {
		if (numser.length!=14 || bl>-1) {
			if (z2.length<3) { alert("N° de Série incomplet (Zone 2)"); e++;}
			if (ns.length<5) { alert("N° de Série incorrect"); e++;}
			if (z1<"0"||z2<"0"||z5<"0"||z6<"0"||z7<"0"||z8<"0"||z9<"0"||ns<"0") { alert("N° de Série incomplet"); e++;}
			}
		}
	if (e==0) {	document.cmdFrm11.ent_numser.value="VGY"+numser; document.cmdFrm11.submit(); return false; }
}

function verif_dem() {
e=0	
	if (document.cmdFrm12.ent_refcli.value<"0") { alert("Référence de Demande de Prix incorrecte"); e++;}
	
	var numser="";
	var cc=document.cmdFrm12.wns_cc.value;
	var z1=document.cmdFrm12.wns_z1.value;
	var z2=document.cmdFrm12.wns_z2.value;
	var z5=document.cmdFrm12.wns_z5.value;
	var z6=document.cmdFrm12.wns_z6.value;
	var z7=document.cmdFrm12.wns_z7.value;
	var z8=document.cmdFrm12.wns_z8.value;
	var z9=document.cmdFrm12.wns_z9.value;
	var ns=document.cmdFrm12.wns_ns.value;
	numser=z1+z2+z5+z6+z7+z8+z9+ns
	var bl=numser.indexOf(" ");
	if (numser.length!=0) {
		if (numser.length!=14 || bl>-1) {
			if (z2.length<3) { alert("N° de Série incomplet (Zone 2)"); e++;}
			if (ns.length<5) { alert("N° de Série incorrect"); e++;}
			if (z1<"0"||z2<"0"||z5<"0"||z6<"0"||z7<"0"||z8<"0"||z9<"0"||ns<"0") { alert("N° de Série incomplet"); e++;}
			}
		}
	if (e==0) {	document.cmdFrm12.ent_numser.value="VGY"+numser; document.cmdFrm12.submit(); return false; }
}

function ecrire_ficheinfo() {
url=document.select_ficheinfo.ficheinfo[document.select_ficheinfo.ficheinfo.selectedIndex].value;
	if ( url.substr(0, 1)!=" ") {
		parent.frames[1].document.location=url;
	}
}

function ecrire_notice() {
url=document.select_notice.notice[document.select_notice.notice.selectedIndex].value
	if ( url.substr(0, 1)!=" ") {
		parent.frames[1].document.location=url;
	}
}

function affiche_garage() {
	garage=document.reseau.w_nom_garage[document.reseau.w_nom_garage.selectedIndex].value;
	if ( garage.substr(0, 1)!=" ") {
		reseau.submit();
	}
}

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_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_findObj(n, d) { //v3.0
  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); 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 MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v3.0
  var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);
  if (app.indexOf('Netscape') != -1) {
    if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
  } else if (app.indexOf('Microsoft') != -1) {
    if (version >= IEvers || verStr.indexOf(IEvers) != -1)
     {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
  } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
  if (newURL) { window.location=unescape(newURL); document.MM_returnValue=false; }
}