var probeg = 0
a = new Array (4);
a[0] = ["0", "стандартный с лимитом пробега"];
a[1] = ["1", "стандартный без лимита пробега"];
a[2] = ["2", "ВЫХОДНОГО ДНЯ"];
a[3] = ["3", "РАБОЧАЯ НЕДЕЛЯ"];

function itogo() {
var date_from = document.getElementById('date_from').value;
var date_to = document.getElementById('date_to').value;
var objTextarea = document.getElementById('count');
var selectTariff = document.getElementById('tarif');
var selectCar = document.getElementById('car').value;
if (date_from && date_to) {

		var tarif=document.getElementById('tarif').value;
		DateArray = new Array (3);
		DateArray = date_from.split("-");
		var d1 = new Date(parseInt(DateArray[2],10),(parseInt(DateArray[1],10)-1),parseInt(DateArray[0],10),0,0,0);
		
		DateArray = new Array (3);
		DateArray = date_to.split("-");
		var d2 = new Date(parseInt(DateArray[2],10),(parseInt(DateArray[1],10)-1),parseInt(DateArray[0],10),0,0,0);
		
		var offset = 24*60*60*1000;
		var daycount = Math.floor((d2-d1)/offset);
		var probeg = daycount*300; //300 км в день
		
		var price = 0;

		if (daycount<4)  price=1;
		if (daycount>3&&Math.floor((d2-d1)/offset)<8)  price=2;
		if (daycount>7&&Math.floor((d2-d1)/offset)<16)  price=3;
		if (daycount>15&&Math.floor((d2-d1)/offset)<31) price=4;
		if (daycount>30) price=5;
		
		if( d1.getDay()==1 && d2.getDay()==5 && tarif==3 && carsprice1[selectCar][8]!=0){
			price=8;
		}
		if( d1.getDay()==5 && d2.getDay()==1 && tarif==2 && carsprice1[selectCar][7]!=0){
			price=7;
		}
		if (tarif==0) objTextarea.value = carsprice1[selectCar][0]+ " по тарифу: стандартный с лимитом пробега "+probeg+" км"+" Стоимость: "+carsprice1[selectCar][price]*daycount+"р."
		if (tarif==1) objTextarea.value = carsprice1[selectCar][0]+ " по тарифу: стандартный без лимита пробега Стоимость: "+carsprice2[selectCar][price]*daycount+"p."
		if (tarif==2) objTextarea.value = carsprice1[selectCar][0]+ " по тарифу: ВЫХОДНОГО ДНЯ. Стоимость: "+carsprice1[selectCar][price]+"p."
		if (tarif==3) objTextarea.value = carsprice1[selectCar][0]+ " по тарифу: РАБОЧАЯ НЕДЕЛЯ. Стоимость: "+carsprice1[selectCar][price]+"p."
	}
	else document.getElementById('count').innerHTML = "Укажите дату С и По"


}
function testDate(){
	var date_from = document.getElementById('online_date_from').value;
	var date_to = document.getElementById('online_date_to').value;

	DateArray = new Array (3);
	DateArray = date_from.split("-");
	var d1 = new Date(parseInt(DateArray[2],10),(parseInt(DateArray[1],10)-1),parseInt(DateArray[0],10),0,0,0);

	DateArray = new Array (3);
	DateArray = date_to.split("-");
	var d2 = new Date(parseInt(DateArray[2],10),(parseInt(DateArray[1],10)-1),parseInt(DateArray[0],10),0,0,0);

	var offset = 24*60*60*1000;
	var daycount = Math.floor((d2-d1)/offset);
	if(daycount<=0){
		alert('Выбирайте корректное значение даты.');
		document.getElementById('online_date_to').value = '';
	}
}
function SelectTarif(){
	var selectTariff = document.getElementById('tarif');
	var date_from = document.getElementById('date_from').value;
	var date_to = document.getElementById('date_to').value;
	var selectCar = document.getElementById('car').value;
	
	if (date_from && date_to) {


		DateArray = new Array (3);
		DateArray = date_from.split("-");
		var d1 = new Date(parseInt(DateArray[2],10),(parseInt(DateArray[1],10)-1),parseInt(DateArray[0],10),0,0,0);
	
		DateArray = new Array (3);
		DateArray = date_to.split("-");
		var d2 = new Date(parseInt(DateArray[2],10),(parseInt(DateArray[1],10)-1),parseInt(DateArray[0],10),0,0,0);
		
		
		var offset = 24*60*60*1000;
		var daycount = Math.floor((d2-d1)/offset);
		if(daycount<=0){
			alert('Выбирайте корректное значение даты.');
			document.getElementById('date_to').value = '';
		}

		if( d1.getDay()==1 && d2.getDay()==5  && daycount<6 && carsprice1[selectCar][8]!=0){
			selectTariff.options.length = 0;
			selectTariff.options[selectTariff.options.length] = new Option("стандартный с лимитом пробега", "0", true, true);
			selectTariff.options[selectTariff.options.length] = new Option("стандартный без лимита пробега", "1", false, false);
			selectTariff.options[selectTariff.options.length] = new Option("рабочая неделя", "3", false, false);
			itogo();

		}else if( d1.getDay()==5 && d2.getDay()==1 && daycount<4  && carsprice1[selectCar][7]!=0){
			selectTariff.options.length = 0;
			selectTariff.options[selectTariff.options.length] = new Option("стандартный с лимитом пробега", "0", true, true);
			selectTariff.options[selectTariff.options.length] = new Option("стандартный без лимита пробега", "1", false, false);
			selectTariff.options[selectTariff.options.length] = new Option("выходного дня", "2", false, false);
			itogo();
		}else{
			selectTariff.options.length = 0;
			selectTariff.options[selectTariff.options.length] = new Option("стандартный с лимитом пробега", "0", true, true);
			selectTariff.options[selectTariff.options.length] = new Option("стандартный без лимита пробега", "1", false, false);
			itogo();
		}
	}	
}
     <!--
     setTimeout("blink1()", 500);

     function blink1() {
     	document.getElementById('onlineb').style.color = '#de0000';
     	setTimeout("blink2()", 500);
     }

     function blink2() {
     	document.getElementById('onlineb').style.color = '#ffffff';
     	setTimeout("blink1()", 500);
     }
     -->