<!--

function popup(stranka) {
  window.open('/popup.php?img='+stranka, 'popup', 'width=650,height=650,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');
}


function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
	}
}

window.onload = externalLinks;





function show(img) {
document.getElementById("repos_big").style.background = 'url(/img/foto/full/foto_'+img+'.jpg)';
}


function commander(){

var bleu = eval(document.getElementById('rp_bleu_quantite').value);
var bleu_euro = '12.50';
var jaune = eval(document.getElementById('rp_jaune_quantite').value);
var jaune_euro = '12.50';

var count = bleu + jaune;
var reduction = 0;

if (count >= 50) {reduction = 10;}
else if (count >= 20) {reduction = 5;}
document.getElementById('taux').value = reduction + " %";

var sous = (bleu * bleu_euro) + (jaune * jaune_euro);
document.getElementById('sous').value = sous.toFixed(2) + " €";

var montant = -sous / 100 * reduction;
document.getElementById('montant').value = montant.toFixed(2) + " €";

var sous2 = sous + montant;
document.getElementById('sous2').value = sous2.toFixed(2) + " €";
document.getElementById('total').value = sous2.toFixed(2) + " €";

var tva = sous2 / 100 * 19.6;
document.getElementById('tva').value = tva.toFixed(2) + " €";

var poids = count * 0.480;
document.getElementById('poids').value = poids.toFixed(2) + " Kg";

var port = 0;
if (poids <= 0.50) {port = 5.50}
else if (poids <= 1.00) {port = 6.70}
else if (poids <= 2.00) {port = 7.65}
else if (poids <= 3.00) {port = 8.60}
else if (poids <= 5.00) {port = 10.50}
else if (poids <= 7.00) {port = 12.40}
else if (poids <= 10.00) {port = 15.25}
else if (poids <= 15.00) {port = 17.25}
else if (poids <= 30.00) {port = 23.25}
document.getElementById('port').value = port.toFixed(2) + " €";

var ttc = sous2 + tva + port;
document.getElementById('ttc').value = ttc.toFixed(2) + " €";

}

//-->
