if(!(parent.frames["bas"] && parent.frames["haut"]))
	{
		timer = setTimeout("location.replace('Films8mm_i.htm')", 2*1000);
	}

var Remise='-10%';
var PxMin=0; // Prix à la minute Quantitatif
var PxMin0=1.3200; // Px de base pour 1 Min. <=30
var PxMin1=PxMin0 * 0.90; // Px 1 pour 1 Min. <=60
var PxMin2=PxMin1 * 0.90; // Px 2 pour 1 Min. <=90
var PxMin3=PxMin2 * 0.90; // Px 3 pour 1 Min. <=120
var PxMin4=PxMin3 * 0.90; // Px 4 pour 1 Min. >120

var Divis=60; // Unité de traitement en Min.
var Bob=0.25; // Traitement de Nettoyage à la bobine.
var PxPrep=2; // Px de Préparation pour 'Divis' Min.
var PxAcqui1=3; // Px d'acuisition 1 pour 1/2 'Divis' Min.
var PxAcqui2=4; // Px option Traitement image pour 1 'Divis' Min.
var PxAcqui3=3; // Px bande son pour pour 1 'Divis' Min.
var PxFin=9; // Px de Gravage pour 1,5 x 'Divis' Min.
var PxLog1=13.75; // Px Livr. Colissimo.
var PxLog2=25.05; // Px Livr. Contre Remb.
var PxLog3=0; // Px Livr. sur Place
var Freeday='31/12/09';
var Tarifs='01/01/09';
var Eco=41;
var EcoBase=120;

var TxTVA=1.196;

var CoefType1=1;//8mm
var CoefType2=1.05;//S8mm
var CoefType3=1.15;//S8mm Son
var CoefType4=1.55;//9.5mm
var CoefType5=1.65;//16mm
var CoefType=CoefType1;

var BaseDuree1=4;
var BaseDuree2=8;
var BaseDuree3=16;
var BaseDuree4=24;
var BaseDuree5=32;

var CoefDuree1=1;//duree 8mm
var CoefDuree2=0.9;//duree S8mm
var CoefDuree3=0.9;//duree S8mm Son
var CoefDuree4=0.6;//duree 9.5mm
var CoefDuree5=0.5;//duree 16mm
var CoefDuree=CoefDuree1;

var tBob=0;
var tBob1=0;
var tBob2=0;
var tBob3=0;
var tBob4=0;
var tBob5=0;

var tot1=0;
var totD1=0;

var tot2=0;
var totD2=0;

var tot3=0;
var totD3=0;

var tot4=0;
var totD4=0;

var tot5=0;
var totD5=0;

var totDT=0;
var totPxDT=0;

var Base1=0;
var Base2=0;
var Base3=0;
var Base4=0;
var Base5=0;

var totG1=0;
var totG2=0;
var totG3=0;
var totG4=0;
var totG5=0;
var totGLB=0;

var totHT=0;
var totCOP=0;
var totLOG=0;
var totTVA=0;
var totTTC=0;

var OPT1=1;
var OPT2=1;
var OPT3=3;

function arrondir(nombre, decimales) {
  if (isNaN(nombre)) return "";
  if (nombre==0) return "0.00";
  if (decimales == 0) {
     var n = Math.round(nombre);
     return n.toString();
  }
  else if (decimales > 0) {
     if (document.all) var undefined; // Netscape 4 ne connaît pas la constante "undefined" 
     var p10 = Math.pow(10, decimales);
     var n = Math.round(nombre * p10); 
     n = n.toString();
     var point = n.length - decimales;
     if (point >= 0) n = n.substring(0, point) + "." + n.substring(point);
     else n = "0." + formater(n, decimales);
  }
  else {
     var p10 = Math.pow(10, -decimales);
     var n = Math.round(nombre / p10) * p10;
     n = n.toString();
  }
  if (nombre.signe_decimal == undefined) return n;
  else return n.replace(".", nombre.signe_decimal);
}

	function c1() {
		if (OPT1==1) {OPT1=0;}
		else {OPT1=1;}
		window.document.F9.MonOp3.click();
		window.document.F12.MonTotOp.click();
	}

	function c2() {
		if (OPT2==1) {OPT2=0;}
		else {OPT2=1;}
		window.document.F10.MonOp4.click();
		window.document.F12.MonTotOp.click();
	}

	function c3(TypTransp) {
		if (TypTransp==1) {OPT3=1;}
		if (TypTransp==2) {OPT3=2;}
		if (TypTransp==3) {OPT3=3;}
		window.document.F13.GlobTot.click();
	}

	function c4(nbCOP) {
		if (totCOP==0){totCOP = 0;} else {totCOP = totCOP - 1;}
	}
	function c5(nbCOP) {
		totCOP = totCOP + 1;
	}

	function total_global(resHT,resTVA,resTTC,resLOG,resCOP,nbCOP) {
	
		if (totCOP>=1)
			{resCOP.value = parseFloat(totCOP) * parseFloat(totG5);}
		else
			{resCOP.value = 0;}
		
		nbCOP.value = totCOP;
		
		resCOP.value = parseFloat(totCOP) * parseFloat(totG5);
		
		resHT.value = parseFloat(totPxDT) + parseFloat(totGLB) + parseFloat(resCOP.value);
		resHT.value = Math.ceil(resHT.value * 100)/100;
		totHT = resHT.value;
		
		if (OPT3==1) {resLOG.value=parseFloat(PxLog1)};
		if (OPT3==2) {resLOG.value=parseFloat(PxLog2)};
		if (OPT3==3) {resLOG.value=parseFloat(PxLog3)};

		totLOG = resLOG.value;

		resTTC.value = parseFloat(totHT) + parseFloat(totLOG);
		resTTC.value = Math.ceil(resTTC.value * parseFloat(TxTVA)*100)/100;
		totTTC = resTTC.value;

		resTVA.value = parseFloat(totTTC) - parseFloat(totHT) - parseFloat(totLOG);
		resTVA.value = Math.ceil(resTVA.value * 100)/100;
		totTVA = resTVA.value;

		resCOP.value = arrondir(resCOP.value,"2");
		resLOG.value = arrondir(resLOG.value,"2");
		resHT.value = arrondir(resHT.value,"2");
		resTVA.value = arrondir(resTVA.value,"2");
		resTTC.value = arrondir(resTTC.value,"2");

		return false
	}	
	
	function total1(res0,totD) {
		totD.value = parseFloat(totD1) + parseFloat(totD2) + parseFloat(totD3) + parseFloat(totD4) + parseFloat(totD5);
		totD.value = arrondir(totD.value,"2");
		totDT=totD.value;
		
		if (totDT<=30) {PxMin=PxMin0};
		if (totDT>30 && totDT<=60) {PxMin=PxMin1};
		if (totDT>60 && totDT<=90) {PxMin=PxMin2};
		if (totDT>90 && totDT<=120) {PxMin=PxMin3};
		if (totDT>120) {PxMin=PxMin4};

		// RAjoute Coef Type Bobine
		PxMin = PxMin * CoefType	
		
		res0.value = parseFloat(totD.value * PxMin);
		res0.value = Math.ceil(res0.value * 100)/100;
		res0.value = arrondir(res0.value,"2");
		totPxDT=res0.value;

		// Change Economie
		EcoBase=totDT;
		document.all.IdEcoBase.innerText=arrondir(EcoBase,"0");

		Eco = parseFloat(Base1) + parseFloat(Base2);
		Eco += parseFloat(Base3) + parseFloat(Base4);
		Eco += parseFloat(Base5) - parseFloat(totPxDT);
		document.all.IdEco.innerText=arrondir(Eco,'0');

		window.document.F7.MonOp1.click();
		window.document.F8.MonOp2.click();
		window.document.F9.MonOp3.click();
		window.document.F10.MonOp4.click();
		window.document.F11.MonOp5.click();
		window.document.F12.MonTotOp.click();

		return false
	}
	function total2(res10,totDHM) {
		totDHM.value = Math.ceil(totDT/Divis); //Nb heures
		res10.value = parseFloat((totDHM.value * PxPrep) + (tBob * Bob)); // montant Prépa horaire + montant Prépa à la bobine
		totG1=res10.value;
		res10.value = arrondir(res10.value,"2");
		return false
	}
	function total3(res21,totDHP1) {
		totDHP1.value = Math.ceil(totDT/(Divis/2)); //Nb heures
		res21.value = parseFloat(totDHP1.value * PxAcqui1); // montant
		totG2=res21.value;
		res21.value = arrondir(res21.value,"2");
		return false
	}
	function total4(res22,totDHP2) {
		totDHP2.value = OPT1*(Math.ceil(totDT/Divis)); //Nb 1 heures ou 0 si pas coché
		res22.value = OPT1 * parseFloat(totDHP2.value * PxAcqui2); // montant ou 0 si pas coché
		totG3=res22.value;
		res22.value = arrondir(res22.value,"2");
		return false
	}
	function total5(res23,totDHP3) {
		totDHP3.value = OPT2*(Math.ceil(totDT/Divis)); //Nb 1 heures ou 0 si pas coché
		res23.value = OPT2 * parseFloat(totDHP3.value * PxAcqui3); // montant ou 0 si pas coché
		totG4=res23.value;
		res23.value = arrondir(res23.value,"2");
		return false
	}
	function total6(res24,totDHP4) {
		totDHP4.value = Math.ceil(totDT/(Divis*1.5)); //Nb de 1,5 heures
		res24.value = parseFloat(totDHP4.value * PxFin); // montant
		totG5=res24.value;
		res24.value = arrondir(res24.value,"2");
		return false
	}
	function total7(res25) {
		res25.value = parseFloat(totG1) + parseFloat(totG2) + parseFloat(totG3) + parseFloat(totG4) + parseFloat(totG5);
		totGLB=res25.value;
		res25.value = arrondir(res25.value,"2");
		window.document.F13.GlobTot.click();
		return false
	}

	function calc1(v11,v21,res1) {
		if(isNaN(v11.value)||(v11.value=="")) v11.focus()
		else if(isNaN(v21.value)||(v21.value=="")) v21.focus()
		else res1.value=parseFloat(v11.value)*parseFloat(v21.value)*parseFloat(PxMin0)*CoefType;tot1=res1.value;totD1=parseFloat(v11.value)*parseFloat(v21.value);tBob1=v11.value;tBob=parseFloat(tBob1) + parseFloat(tBob2) + parseFloat(tBob3) + parseFloat(tBob4) + parseFloat(tBob5);
		Base1=res1.value;
		res1.value = arrondir(res1.value,"2");
		window.document.F6.MonTot1.click();
		return false
	}
	function calc2(v12,v22,res2) {
		if(isNaN(v12.value)||(v12.value=="")) v12.focus()
		else if(isNaN(v22.value)||(v22.value=="")) v22.focus()
		else res2.value=parseFloat(v12.value)*parseFloat(v22.value)*parseFloat(PxMin0)*CoefType;tot2=res2.value;totD2=parseFloat(v12.value)*parseFloat(v22.value);tBob2=v12.value;tBob=parseFloat(tBob1) + parseFloat(tBob2) + parseFloat(tBob3) + parseFloat(tBob4) + parseFloat(tBob5);
		Base2=res2.value;
		res2.value = arrondir(res2.value,"2");
		window.document.F6.MonTot1.click();
		return false
	}
	function calc3(v13,v23,res3) {
		if(isNaN(v13.value)||(v13.value=="")) v13.focus()
		else if(isNaN(v23.value)||(v23.value=="")) v23.focus()
		else res3.value=parseFloat(v13.value)*parseFloat(v23.value)*parseFloat(PxMin0)*CoefType;tot3=res3.value;totD3=parseFloat(v13.value)*parseFloat(v23.value);tBob3=v13.value;tBob=parseFloat(tBob1) + parseFloat(tBob2) + parseFloat(tBob3) + parseFloat(tBob4) + parseFloat(tBob5);
		Base3=res3.value;
		res3.value = arrondir(res3.value,"2");
		window.document.F6.MonTot1.click();
		return false
	}
	function calc4(v14,v24,res4) {
		if(isNaN(v14.value)||(v14.value=="")) v14.focus()
		else if(isNaN(v24.value)||(v24.value=="")) v24.focus()
		else res4.value=parseFloat(v14.value)*parseFloat(v24.value)*parseFloat(PxMin0)*CoefType;tot4=res4.value;totD4=parseFloat(v14.value)*parseFloat(v24.value);tBob4=v14.value;tBob=parseFloat(tBob1) + parseFloat(tBob2) + parseFloat(tBob3) + parseFloat(tBob4) + parseFloat(tBob5);
		Base4=res4.value;
		res4.value = arrondir(res4.value,"2");
		window.document.F6.MonTot1.click();
		return false
	}
	function calc5(v15,v25,res5) {
		if(isNaN(v15.value)||(v15.value=="")) v15.focus()
		else if(isNaN(v25.value)||(v25.value=="")) v25.focus()
		else res5.value=parseFloat(v15.value)*parseFloat(v25.value)*parseFloat(PxMin0)*CoefType;tot5=res5.value;totD5=parseFloat(v15.value)*parseFloat(v25.value);tBob5=v15.value;tBob=parseFloat(tBob1) + parseFloat(tBob2) + parseFloat(tBob3) + parseFloat(tBob4) + parseFloat(tBob5);
		Base5=res5.value;
		res5.value = arrondir(res5.value,"2");
		window.document.F6.MonTot1.click();
		return false
	}

	function CHGTF(MONTF) 
	{
		//alert(MONTF);
		if (MONTF=="1") {
		var CCH = document.TYPEFILM.src;
    		document.TYPEFILM.src = CCH.substring(0,CCH.length - 12)  + "_" + "08mm_ns.jpg" ;
		CoefType=CoefType1; // Tarif par Type
		var CoefDuree=CoefDuree1; // Type de Film
		window.document.F1.v21.value = arrondir(BaseDuree1 * CoefDuree,"2");
		window.document.F1.MonL1.click();
		window.document.F2.v22.value = arrondir(BaseDuree2 * CoefDuree,"2");
		window.document.F2.MonL2.click();
		window.document.F3.v23.value = arrondir(BaseDuree3 * CoefDuree,"2");
		window.document.F3.MonL3.click();
		window.document.F4.v24.value = arrondir(BaseDuree4 * CoefDuree,"2");
		window.document.F4.MonL4.click();
		window.document.F5.v25.value = arrondir(BaseDuree5 * CoefDuree,"2");
		window.document.F5.MonL5.click();
		window.document.F6.MonTot1.click();
		return false;}

		if (MONTF=="2") {
		var CCH = document.TYPEFILM.src;
    		document.TYPEFILM.src = CCH.substring(0,CCH.length - 12)  + "_" + "S8mm_ns.jpg" ;
		CoefType=CoefType2;
		var CoefDuree=CoefDuree2; // Type de Film
		window.document.F1.v21.value = arrondir(BaseDuree1 * CoefDuree,"2");
		window.document.F1.MonL1.click();
		window.document.F2.v22.value = arrondir(BaseDuree2 * CoefDuree,"2");
		window.document.F2.MonL2.click();
		window.document.F3.v23.value = arrondir(BaseDuree3 * CoefDuree,"2");
		window.document.F3.MonL3.click();
		window.document.F4.v24.value = arrondir(BaseDuree4 * CoefDuree,"2");
		window.document.F4.MonL4.click();
		window.document.F5.v25.value = arrondir(BaseDuree5 * CoefDuree,"2");
		window.document.F5.MonL5.click();
		window.document.F6.MonTot1.click();
		return false;}

		if (MONTF=="3") {
		var CCH = document.TYPEFILM.src;
    		document.TYPEFILM.src = CCH.substring(0,CCH.length - 12)  + "_" + "S8mm_so.jpg" ;
		CoefType=CoefType3;
		var CoefDuree=CoefDuree3; // Type de Film
		window.document.F1.v21.value = arrondir(BaseDuree1 * CoefDuree,"2");
		window.document.F1.MonL1.click();
		window.document.F2.v22.value = arrondir(BaseDuree2 * CoefDuree,"2");
		window.document.F2.MonL2.click();
		window.document.F3.v23.value = arrondir(BaseDuree3 * CoefDuree,"2");
		window.document.F3.MonL3.click();
		window.document.F4.v24.value = arrondir(BaseDuree4 * CoefDuree,"2");
		window.document.F4.MonL4.click();
		window.document.F5.v25.value = arrondir(BaseDuree5 * CoefDuree,"2");
		window.document.F5.MonL5.click();
		window.document.F6.MonTot1.click();
		return false;}

		if (MONTF=="4") {
		var CCH = document.TYPEFILM.src;
    		document.TYPEFILM.src = CCH.substring(0,CCH.length - 12)  + "_" + "09mm_ns.jpg" ;
		CoefType=CoefType4;
		var CoefDuree=CoefDuree4; // Type de Film
		window.document.F1.v21.value = arrondir(BaseDuree1 * CoefDuree,"2");
		window.document.F1.MonL1.click();
		window.document.F2.v22.value = arrondir(BaseDuree2 * CoefDuree,"2");
		window.document.F2.MonL2.click();
		window.document.F3.v23.value = arrondir(BaseDuree3 * CoefDuree,"2");
		window.document.F3.MonL3.click();
		window.document.F4.v24.value = arrondir(BaseDuree4 * CoefDuree,"2");
		window.document.F4.MonL4.click();
		window.document.F5.v25.value = arrondir(BaseDuree5 * CoefDuree,"2");
		window.document.F5.MonL5.click();
		window.document.F6.MonTot1.click();
		return false;}

		if (MONTF=="5") {
		var CCH = document.TYPEFILM.src;
    		document.TYPEFILM.src = CCH.substring(0,CCH.length - 12)  + "_" + "16mm_ns.jpg" ;
		CoefType=CoefType5;
		var CoefDuree=CoefDuree5; // Type de Film
		window.document.F1.v21.value = arrondir(BaseDuree1 * CoefDuree,"2");
		window.document.F1.MonL1.click();
		window.document.F2.v22.value = arrondir(BaseDuree2 * CoefDuree,"2");
		window.document.F2.MonL2.click();
		window.document.F3.v23.value = arrondir(BaseDuree3 * CoefDuree,"2");
		window.document.F3.MonL3.click();
		window.document.F4.v24.value = arrondir(BaseDuree4 * CoefDuree,"2");
		window.document.F4.MonL4.click();
		window.document.F5.v25.value = arrondir(BaseDuree5 * CoefDuree,"2");
		window.document.F5.MonL5.click();
		window.document.F6.MonTot1.click();
		return false;}
		
	}