//FUNCTION CALCUL COUP DU SEJOUR LOCATION
function calculer(){
	var type = document.getElementById('type').value;
	var when = document.getElementById('when').value;
	var day = document.getElementById('day').value;
	var prix = 0;
	var resultat = 0;
	var reduc = 0;
	var vprix = 0;
	if(type == 1){
		if(when == 1)prix = 35;
		if(when == 2)prix = 29;
		if(when == 3)prix = 33;
		if(when == 4)prix = 33;
		if(when == 5)prix = 29;
		if(when == 6)prix = 39;		
		if(when == 7)prix = 29;
		if(when == 8)prix = 29;
		if(day >= 7 && day < 14){
			vprix = (day*prix);
			reduc = (vprix*(10/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 14 && day < 21){
			vprix = (day*prix);
			reduc = (vprix*(20/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 21 && day < 28){
			vprix = (day*prix);
			reduc = (vprix*(30/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 28){
			vprix = (day*prix);
			reduc = (vprix*(50/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else{
			vprix = (day*prix);
			document.getElementById('res').innerHTML = vprix+' €';
		}
	}else if(type == 2){
		if(when == 1)prix = 39;
		if(when == 2)prix = 34;
		if(when == 3)prix = 44;
		if(when == 4)prix = 44;
		if(when == 5)prix = 34;
		if(when == 6)prix = 47;
		if(when == 7)prix = 34;
		if(when == 8)prix = 34;
		if(day >= 7 && day < 14){
			vprix = (day*prix);
			reduc = (vprix*(10/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 14 && day < 21){
			vprix = (day*prix);
			reduc = (vprix*(20/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 21 && day < 28){
			vprix = (day*prix);
			reduc = (vprix*(30/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 28){
			vprix = (day*prix);
			reduc = (vprix*(50/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else{
			vprix = (day*prix);
			document.getElementById('res').innerHTML = vprix+' €';
		}
	}else if(type == 3){
		if(when == 1)prix = 45;
		if(when == 2)prix = 36;
		if(when == 3)prix = 46;
		if(when == 4)prix = 46;
		if(when == 5)prix = 36;
		if(when == 6)prix = 52;
		if(when == 7)prix = 36;
		if(when == 8)prix = 36;
		if(day >= 7 && day < 14){
			vprix = (day*prix);
			reduc = (vprix*(10/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 14 && day < 21){
			vprix = (day*prix);
			reduc = (vprix*(20/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 21 && day < 28){
			vprix = (day*prix);
			reduc = (vprix*(30/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 28){
			vprix = (day*prix);
			reduc = (vprix*(50/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else{
			vprix = (day*prix);
			document.getElementById('res').innerHTML = vprix+' €';
		}
	}else if(type == 4){
		if(when == 1)prix = 45;
		if(when == 2)prix = 36;
		if(when == 3)prix = 46;
		if(when == 4)prix = 46;
		if(when == 5)prix = 36;
		if(when == 6)prix = 52;
		if(when == 7)prix = 36;
		if(when == 8)prix = 36;
		if(day >= 7 && day < 14){
			vprix = (day*prix);
			reduc = (vprix*(10/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 14 && day < 21){
			vprix = (day*prix);
			reduc = (vprix*(20/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 21 && day < 28){
			vprix = (day*prix);
			reduc = (vprix*(30/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 28){
			vprix = (day*prix);
			reduc = (vprix*(50/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else{
			vprix = (day*prix);
			document.getElementById('res').innerHTML = vprix+' €';
		}
	}else{
		if(when == 1)prix = 45;
		if(when == 2)prix = 36;
		if(when == 3)prix = 46;
		if(when == 4)prix = 46;
		if(when == 5)prix = 36;
		if(when == 6)prix = 52;
		if(when == 7)prix = 36;
		if(when == 8)prix = 36;
		if(day >= 7 && day < 14){
			vprix = (day*prix);
			reduc = (vprix*(10/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 14 && day < 21){
			vprix = (day*prix);
			reduc = (vprix*(20/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 21 && day < 28){
			vprix = (day*prix);
			reduc = (vprix*(30/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else if(day >= 28){
			vprix = (day*prix);
			reduc = (vprix*(50/100));
			resultat = vprix-reduc;
			document.getElementById('res').innerHTML = resultat+' €';
		}else{
			vprix = (day*prix);
			document.getElementById('res').innerHTML = vprix+' €';
		}
	}
}
