var del_cost = 0,count,season;
var discount = 30;
var pricesbygroup = new Array();
//PRICELIST | CAR [0] LOW [1] [2] MIDDLE [3] [4] HIGH [5] [6] [7] PEAK[8] [9]
pricesbygroup[0]= new Array('A','75','0', '90' , '0', '105','0',parseInt(0),'195','0');
pricesbygroup[1]= new Array('B','90','0', '120' , '0', '150','0',parseInt(0),'220','0');
pricesbygroup[2]= new Array('C','100','0', '130' , '0', '160','0',parseInt(0),'240','0');
pricesbygroup[3]= new Array('D1','100','0', '130' , '0', '160','0',parseInt(0),'240','0');
pricesbygroup[4] =new Array('E','120','0', '150' , '0', '190','0',parseInt(0),'260','0');
pricesbygroup[5]= new Array('G1','150','0', '200' , '0', '240','0',parseInt(0),'290','0');
pricesbygroup[6]= new Array('H','300','0', '400' , '0', '500','0',parseInt(0),'700','0');
pricesbygroup[7]= new Array('H2','260','0', '340' , '0', '440','0',parseInt(0),'560','0');
function show_listings()
{ for (var k=0; k<8; k++)
{document.getElementById('group'+k).style.display = "block";}
}
function hide_listings(){
for (var l=0; l<8; l++)
document.getElementById('group'+l).style.display = "none";
}
function mygroup(sel_group){
switch (sel_group)
{
case 0: group = "Group A";tmp_price = document.getElementById('tprice0').innerHTML;break;
case 1: group = "Group B";tmp_price = document.getElementById('tprice1').innerHTML;break;
case 2: group = "Group C";tmp_price = document.getElementById('tprice2').innerHTML;break;
case 3: group = "Group D1";tmp_price = document.getElementById('tprice3').innerHTML;break;
case 4: group = "Group E";tmp_price = document.getElementById('tprice4').innerHTML;break;
case 5: group = "Group G1";tmp_price = document.getElementById('tprice5').innerHTML;break;
case 6: group = "Group H";tmp_price = document.getElementById('tprice6').innerHTML;break;
case 7: group = "Group H2";tmp_price = document.getElementById('tprice7').innerHTML;break;
//default: group = "-";break;
}
document.onlinequote.fullpay.value = "PAY BY BANK";
document.onlinequote.price.value = ((tmp_price.substr(2) * 1)).toFixed(0);
document.onlinequote.discountedprice.value = ( (tmp_price.substr(2) * 1) - discount).toFixed(0);
document.onlinequote.group.value = group;
document.onlinequote.days.value = count;
document.onlinequote.fullbos.value = 'No';
document.onlinequote.fullbas.value = 'No';
//document.onlinequote.fullper_ins.value = 'No';
if (document.onlinequote.childseat.checked) document.onlinequote.fullbos.value = 'Yes';
if (document.onlinequote.babyseat.checked) document.onlinequote.fullbas.value = 'Yes';
//if (document.onlinequote.per_ins.checked) document.onlinequote.fullper_ins.value = 'Yes';
document.onlinequote.submit();
}
function mygroup1(sel_group){
switch (sel_group)
{
case 0: group = "Group A";tmp_price = document.getElementById('tprice0').innerHTML;break;
case 1: group = "Group B";tmp_price = document.getElementById('tprice1').innerHTML;break;
case 2: group = "Group C";tmp_price = document.getElementById('tprice2').innerHTML;break;
case 3: group = "Group D1";tmp_price = document.getElementById('tprice3').innerHTML;break;
case 4: group = "Group E";tmp_price = document.getElementById('tprice4').innerHTML;break;
case 5: group = "Group G1";tmp_price = document.getElementById('tprice5').innerHTML;break;
case 6: group = "Group H";tmp_price = document.getElementById('tprice6').innerHTML;break;
case 7: group = "Group H2";tmp_price = document.getElementById('tprice7').innerHTML;break;
//default: group = "-";break;
}
document.onlinequote.fullpay.value = "PAY BY BANK";
document.onlinequote.price.value = ((tmp_price.substr(2) * 1)).toFixed(0);
document.onlinequote.discountedprice.value = ( (tmp_price.substr(2) * 1) - discount).toFixed(0);
document.onlinequote.group.value = group;
document.onlinequote.days.value = count;
document.onlinequote.fullbos.value = 'No';
document.onlinequote.fullbas.value = 'No';
//document.onlinequote.fullper_ins.value = 'No';
if (document.onlinequote.childseat.checked) document.onlinequote.fullbos.value = 'Yes';
if (document.onlinequote.babyseat.checked) document.onlinequote.fullbas.value = 'Yes';
//if (document.onlinequote.per_ins.checked) document.onlinequote.fullper_ins.value = 'Yes';
document.getElementById('onlinequote').action="confirm1.php";
document.onlinequote.submit();
}
function restart_quote(){ hide_listings();
document.getElementById('fill-box').style.display = 'block';
document.getElementById('conf-box').style.display = 'none';
document.getElementById('banners').style.display = 'block';
document.getElementById('conf4').innerHTML = "";
}
function check_del(){
del_cost = extrah() + extra() ;
}
function extrah(){
var extrah = 0;
var extraPh = 0;
var extraRh = 0;
if(document.onlinequote.Phour.value == "23") {extraPh = 15;}
if(document.onlinequote.Phour.value == "00") {extraPh = 15;}
if(document.onlinequote.Phour.value == "01") {extraPh = 15;}
if(document.onlinequote.Phour.value == "02") {extraPh = 15;}
if(document.onlinequote.Phour.value == "03") {extraPh = 15;}
if(document.onlinequote.Phour.value == "04") {extraPh = 15;}
if(document.onlinequote.Phour.value == "05") {extraPh = 15;}
if(document.onlinequote.Phour.value == "06") {extraPh = 15;}
if(document.onlinequote.Rhour.value == "23") {extraRh = 15;}
if(document.onlinequote.Rhour.value == "00") {extraRh = 15;}
if(document.onlinequote.Rhour.value == "01") {extraRh = 15;}
if(document.onlinequote.Rhour.value == "02") {extraRh = 15;}
if(document.onlinequote.Rhour.value == "03") {extraRh = 15;}
if(document.onlinequote.Rhour.value == "04") {extraRh = 15;}
if(document.onlinequote.Rhour.value == "05") {extraRh = 15;}
if(document.onlinequote.Rhour.value == "06") {extraRh = 15;}
return extrah = extraPh + extraRh;
}
function extra(){ var extra = 0;
var extra1 = 0;
var extra2 = 0;
var extra3 = 0;
if (document.onlinequote.childseat.checked) {extra1 = 6*count;}
if (document.onlinequote.babyseat.checked) {extra2 = 6*count;}
//if (document.onlinequote.per_ins.checked) {extra3 = 7*count;}
return extra = extra1 + extra2 ;
}
function addZero(num)
{ (String(num).length < 2) ? num = String("0" + num) : num = String(num);
return num;
}
function getcarprice(duration)
{
check_del();
var ss=0;
if (season=='low')
{ss = 1;}
if (season=='mid')
{ss = 3;}
if (season=='high')
{ss = 5;}
if (season=='pick')
{ss = 8;}
if (ss!=0)
{
if(count < 6)
{
for (var i=0; i<8; i++)
{
pricesbygroup[i][7] = parseInt((pricesbygroup[i][ss] / 6) * duration) + del_cost;
document.getElementById('price'+i).innerHTML = " € " + (pricesbygroup[i][7]/count).toFixed(2);
document.getElementById('tprice'+i).innerHTML = " € " + (pricesbygroup[i][7]).toFixed(0);
};
}
else if(count == 6)
{
for (var i=0; i<8; i++)
{
pricesbygroup[i][7] = parseInt((pricesbygroup[i][ss] / 6.5) * duration) + del_cost;
document.getElementById('price'+i).innerHTML = " € " + (pricesbygroup[i][7]/count).toFixed(2);
document.getElementById('tprice'+i).innerHTML = " € " + (pricesbygroup[i][7]).toFixed(0);
};
}
else{
for (var i=0; i<8; i++)
{
pricesbygroup[i][7] = parseInt((pricesbygroup[i][ss] / 7) * duration) + del_cost;
document.getElementById('price'+i).innerHTML = " € " + (pricesbygroup[i][7]/count).toFixed(2);
document.getElementById('tprice'+i).innerHTML = " € " + (pricesbygroup[i][7]).toFixed(0);
};
}
return true;
}
}
function getSeason()
{
season = 0;
cur_y = dateP.getFullYear();
if ( dateP >= new Date ( cur_y, 4, 1 ) && dateP <= new Date ( cur_y, 8, 30 ))
{
if ( dateP >= new Date ( cur_y, 6, 1 ) && dateP <= new Date ( cur_y, 7, 31 ))
{ season = 'pick'; }
else{season = 'high';}
}
else if ( dateP >= new Date ( cur_y, 3, 1 ) && dateP <= new Date ( cur_y, 3, 30 ))
{season = 'mid';}
else if ( dateP >= new Date ( cur_y, 9, 1 ) && dateP <= new Date ( cur_y, 9, 31 ))
{season = 'mid';}
else {season = 'low';}
// alert (season);
}