function sectionS(t){
	tx+=line2V(	"&nbsp;"+t,
				Math.round(tv),Math.round(10000*Math.abs(tv)/VT),
				"#dddddd;border-width:1px 0px 1px 0px;border-color:#777777;margin-top:2px").replace("</div></div>"," %</div></div>")
}
function ligneS(t,c,a){
	getRegSoldes(c);if(a==undefined)a=1
	tv+=a*parseInt(w);
	if(w){
		tx+=	"<div style='position:relative;background-color:#ffffff;margin-top:3px;margin-bottom:5px'>"+
					"<div class=t1>"+
						"<a class=acl id=a"+Idx+" href=\"javascript:showDetail("+Idx+")\">+</a>"+
						t+
					"</div>"+
					"<div class=v1 style='background-color:#eeeeee;border-color:#aaaaaa;border-width:1px 0px 1px 0px;padding-right:3px'>"+nm2ds(Math.round(w))+"</div>"+
					"<div class=v2 style='background-color:#eeeeee;border-color:#aaaaaa;border-width:1px 0px 1px 0px;padding-right:3px'>"+nm2ds(Math.round(10000*Math.abs(w)/VT))+" %</div>"+
				"</div>"+
				"<div id=D"+Idx+" class=dn>"
					for(var i=0;i<dtls.length;i++)tx+=showOps(dtls[i][0])
		tx+=	"</div>"
		Idx++
	}
}
function sig(){
	popW=290;nbW=70;tx=styles(popW,nbW);tv=0;getAllSoldes();Idx=0
	getRegSoldes("70+71+72+73");VT=parseInt(w);tv=VT
	sectionS("VENTES DE MARCHANDISES + PRODUCTIONS");tv=0
	ligneS("Ventes de marchandises", "707+797");
	ligneS("Coût d'achat des marchandises vendues", "-607+6037+6087+6097",-1);
	sectionS("MARGE COMMERCIALE");
	ligneS("Production vendue", "70-707-7097+73");
	ligneS("Production stockée ou déstockage", "71");
	ligneS("Production immobilisée", "72");
	sectionS("PRODUCTION DE L'EXERCICE");
	ligneS("Matières premières, approvisionnements consommés", "-600+601+602+603+6080+6081+6082+6090+6091+6092-6037",-1);
	ligneS("Sous traitance directe", "-604+605+6084+6085+6094+6095",1);
	sectionS("MARGE BRUTE DE PRODUCTION");
	sectionS("MARGE BRUTE GLOBALE")
	ligneS("Autres achats et charges externes", "+606+6083+6086+6088+6089+61+62+6093+6096+6098+6099",1)
	sectionS("VALEUR AJOUTEE");
	ligneS("Subventions d'exploitation", "74");
	ligneS("Impôts, taxes et versements assimilés", "-63",-1);
	ligneS("Salaires du personnel", "-641",-1);
	ligneS("Charges sociales du personnel", "-64-641-644-646",-1);
	ligneS("Charges de l'exploitant", "-644+646");
	sectionS("EXCEDENT BRUT D'EXPLOITATION");
	ligneS("Autres produits de gestion courante", "75-755",-1);
	ligneS("Autres charges de gestion courante", "-65-655");
	ligneS("Reprises sur amortissements et provisions", "78-79-786-787-789-796-797",-1);
	ligneS("Dotations aux amortissements", "-68-6815-6816-6817-686-687-689",-1);
	ligneS("Dotations aux provisions", "-6815+6816+6817",-1);
	sectionS("RESULTAT D'EXPLOITATION");
	ligneS("Quotes parts de résultat sur opérations en commun", "755+655");
	ligneS("Produits financiers", "76+786+796");
	ligneS("Charges financières", "-66+686",-1);
	sectionS("RESULTAT COURANT", 0);
	ligneS("Produits exceptionnels", "77+787+797");
	ligneS("Charges exceptionnelles", "-67+687",-1);
	sectionS("RESULTAT EXCEPTIONNEL");
	ligneS("Impôts sur les bénéfices", "-689-695-696-697-698-699-789",-1);
	ligneS("Participation des salariés", "-69+695+696+697+698+699",-1);
	sectionS("RESULTAT NET");
	tx+=	"<div style='position:absolute;top:0px;border-width:0px 0px 0px 1px;border-color:#aaaaaa;height:100%;left:0px'>&nbsp;</div>"+
			"<div style='position:absolute;top:0px;border-width:0px 0px 0px 1px;border-color:#aaaaaa;height:100%;left:"+(popW+nbW)+"px'>&nbsp;</div>"+
			"<div style='position:absolute;top:0px;border-width:0px 0px 0px 1px;border-color:#aaaaaa;height:100%;left:"+(popW+2*nbW+3)+"px'>&nbsp;</div>"+
			"<div style='position:absolute;top:0px;border-width:0px 0px 0px 1px;border-color:#aaaaaa;height:100%;left:"+(popW+3*nbW+6)+"px'>&nbsp;</div>"
	fnt="sig()";popUp("<font color=orange><b>SOLDES INTERMÉDIAIRES DE GESTION</b></font>","<div style='position:relative;width:506px'>"+tx+"</div>")
}


