
function printCotations(id) {
	var myWind = window.open ('cotation.php?idPays='+id+'&printable=yes', 'Imprimer' , 'height=5, width=5, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no');
	
}

function printFiche(id) {
	var myWind = window.open ('fiche_classeur.php?idFiche='+id+'&printable=yes', 'Imprimer' , 'height=700, width=770, toolbar=no, menubar=yes, scrollbars=yes, resizable=no, location=no, directories=no, status=no');
	
}

function printCotationsCom(annee) {
	var myWind = window.open ('cotationCommemo.php?annee='+annee+'&printable=yes', 'Imprimer' , 'height=5, width=5, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no');
	
}

function cotAction(td, trColor) {
	
	if($("#"+td).css("background-color") == "rgb(196, 255, 175)" || ($("#"+td).css("background-color")).toUpperCase() == "#C4FFAF" ) {
		$("#"+td).css({ background: trColor });
		$.post("manageCotation.php", { cot: td , action: "rm"  } );
		
	} else {
		
		$("#"+td).css({ background: "#C4FFAF" });
		
   		$.post("manageCotation.php", { cot: td , action: "add"  } );		
	}	
}

function cotAction2(td, tType) {

	$idTd = td.replace(';', '');
	
	if($("#"+$idTd).css("background-color") == "rgb(196, 255, 175)" || ($("#"+$idTd).css("background-color")).toUpperCase() == "#C4FFAF") {
				
		$("#"+$idTd).css({ background: "white" });
		$.post("manageCotationCom.php", { cot: td , action: "rm", type: tType  } );
		
	} else {
		$("#"+$idTd).css({ background: "#C4FFAF" });
		
   		$.post("manageCotationCom.php", { cot: td , action: "add" , type: tType } );
		
	}	
	
}

function convertir() {
	var val = document.getElementById('valeur').value; 
	var taux1 = document.getElementById('taux1').value; 
	var taux2 = document.getElementById('taux2').value;
	var convertion = (val*taux2)/taux1;
	
	document.getElementById('convertion').value = convertion.toFixed(2);
}
