var PEDEVE = 1.23;
var CDV = (12/PEDEVE);
var PAI = (5/PEDEVE);
var PDV = 1;
var PRICE;
var CHILD = (8/PEDEVE);

function getQ() {
	var pr = window.document.reservation2.quote.value;
	window.document.reservation2.quote_final.value = pr;
}

function inc_cedeve() {
    var days = window.document.reservation2.days.value;
    var che = window.document.reservation2.cdw.checked;
    if (che == true) {
    var cijena = window.document.reservation2.quote.value;
    cijena = cijena/PEDEVE;
    var CEDV = CDV * days;
    window.document.reservation2.cedw.value = Math.round(CEDV*100)/100;	
    PRICE = CEDV + cijena;
    window.document.reservation2.quote.value = Math.round((PRICE*PEDEVE)*100)/100;
    window.document.reservation2.quote_final.value = Math.round((PRICE*PEDEVE)*100)/100;
    var SKUPA = (PRICE*PEDEVE);
    var BEZ = SKUPA/PEDEVE;
    var REZ = SKUPA - BEZ;
    window.document.reservation2.vat.value = Math.round(REZ*100)/100; 
    }

    if (che == false) {
      window.document.reservation2.cedw.value = 0;
      var trenutna = window.document.reservation2.quote.value;
      trenutna = trenutna/PEDEVE;
      var CEDEV = CDV * days;
      trenutna = trenutna - CEDEV;
      PRICE = trenutna;
      var ante = window.document.reservation2.mladen.value;
      var ante1 = window.document.reservation2.cedw.value;
      var ante2 = window.document.reservation2.paj.value;
      var REZA = ((PRICE*PEDEVE) - ante - ante1 - ante2); 
      window.document.reservation2.vat.value = Math.round(REZA*100)/100;
      window.document.reservation2.quote.value = Math.round((PRICE*PEDEVE)*100)/100;
      window.document.reservation2.quote_final.value = Math.round((PRICE*PEDEVE)*100)/100;
    }
}

function inc_pai() {
  
    var days = window.document.reservation2.days.value;
    var che = window.document.reservation2.pai.checked;
    
    if (che == true) {
      var cijena = window.document.reservation2.quote.value;
      cijena = cijena/PEDEVE;
      var PAID = PAI * days;     
      window.document.reservation2.paj.value = Math.round(PAID*100)/100; 
     PRICE = PAID + cijena; 
      window.document.reservation2.quote.value = Math.round((PRICE*PEDEVE)*100)/100;
      window.document.reservation2.quote_final.value = Math.round((PRICE*PEDEVE)*100)/100;
     var SKUPA = (PRICE*PEDEVE);
    var BEZ = SKUPA/PEDEVE;
    var REZ = SKUPA - BEZ;
    window.document.reservation2.vat.value = Math.round(REZ*100)/100;
    }
    if (che == false) {
      window.document.reservation2.paj.value = 0;
      var cijena = window.document.reservation2.quote.value;
	cijena = cijena/PEDEVE;
	var PAIDE = PAI * days;
	cijena = cijena - PAIDE;
	PRICE = cijena; 
	var ante = window.document.reservation2.mladen.value;
      var ante1 = window.document.reservation2.cedw.value;
      var ante2 = window.document.reservation2.paj.value;
      var REZA = ((PRICE*PEDEVE) - ante - ante1 - ante2);
      window.document.reservation2.vat.value = Math.round(REZA*100)/100;
      window.document.reservation2.quote.value = Math.round((PRICE*PEDEVE)*100)/100; 
      window.document.reservation2.quote_final.value = Math.round((PRICE*PEDEVE)*100)/100; 

    }

}

function getPage(value)
{
  	window.location = "index.php?car_uid=" + value;
}

function popitup(url)
{
	newwindow=window.open(url,'name','height=770,width=770,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}
