function Init(F) { var V; Doc = document.F; if (Doc.Dimanche.checked) {V=0} else {V=1}; Doc.Lundi.checked = V; Doc.Mardi.checked = V; Doc.Mercredi.checked= V; Doc.Jeudi.checked = V; Doc.Vendredi.checked= V; Doc.Samedi.checked = V; Doc.Dimanche.checked= V; Frais(F); } function Frais(F) { var RM, HS, I, An, Handi, FR, SM, FGBrut=0; var J = "", H, T=0, R, Warn; var PropOpt = 0; // PropOpt Doc = document.forms[F]; Style("New", "fontFamily","&fontFamily", "fontSize","100%", "textAlign","center"); Style("Set", Doc.RDI) Style("New", "borderStyle","none", "textAlign","center", "fontFamily","&fontFamily", "fontSize","100%", "fontWeight", "bold", "color",0, "value"," "); Style("Mod", "color", "#FF0000", "backgroundColor", "#99FF99"); Style("Set", Doc.PRHIE, Doc.PREI); Style("Mod", "color", 0); Style("Set", Doc.PRE, Doc.PRHE); Style("Mod", "backgroundColor","#FFFFCC"); Style("Set", Doc.RT, Doc.RTT, Doc.RME, Doc.RMET); Style("Mod", "backgroundColor","#fffff0", "fontWeight","normal"); Style("Set", Doc.Hor); Style("Mod", "backgroundColor","#FFFFCC", "verticalAlign", "middle", "fontSize","95%"); if (PropOpt) {Style("Set", Doc.FG)} // PropOpt RM = Math.abs(Doc.RDI.value) if (Doc.Lundi.checked) {J+= "L"}; if (Doc.Mardi.checked) {J+= "M"}; if (Doc.Mercredi.checked){J+= "M"}; if (Doc.Jeudi.checked) {J+= "J"}; if (Doc.Vendredi.checked){J+= "V"}; if (Doc.Samedi.checked) {J+= "S"}; if (Doc.Dimanche.checked){J+= "D"}; if (J == "") return; H = parseFloat(Doc.H.value); // PropOpt if (PropOpt) { switch (true) { case (Doc.FGBrut[0].checked) : FGBrut = 0; break; case (Doc.FGBrut[1].checked) : FGBrut = 1; break; case (Doc.FGBrut[2].checked) : FGBrut = 2; break; case (Doc.FGBrut[3].checked) : FGBrut = 3; break; default : FGBrut = 4; break; } } T = FGx(H, J, 1, 0, FGBrut); if (6*T >=RM) {R = RM; Doc.RT.value = ARx(R/(12*T)*100, 0) + " %"; Doc.RMET.value = "Plafond atteint"} else {R = 6*T; Doc.RT.value = "Limit"+KEA+"e "+KAG+" " + ARx(R/(12*T)*100, 0) + " %"; Doc.RMET.value = ""}; HS = ARx(J.length * Math.abs(H) * KWM,2); Doc.Hor.value = ARx(J.length * Math.abs(H),2) + " heures par semaine soit " + HS + " heures par mois"; if (Doc.Franc.checked) {FR=1; T=T*KEcu; R=R*KEcu; SM=" F"; FraisG=FraisG*KEcu} else {FR=0; SM = " "+KEuro}; if (PropOpt) {Doc.FG.value = Ed(ARx(FraisG,2)) + SM + " soit " + Ed(ARx(FraisG/HS,2)) + SM + "/1h" } // PropOpt Doc.PRE.value = Ed(ARx(T, 0)) + SM; Doc.RME.value = Ed(ARx(R, 0)) + SM; Doc.PREI.value = Ed(ARx(T-(R/12), 0)) + SM; if (R/(12*T)) {Doc.RTT.value="de la d"+KEA+"pense"} else{Doc.RTT.value=""}; if (Math.abs(H) >= 12) {Warn = "(*) "} else {Warn = ""}; Doc.PRHE.value = Warn + Ed(ARx(T/HS, 2)) + SM; Doc.PRHIE.value = Warn + Ed(ARx((T*12-R)/(HS*12), 2)) + SM; }