function initofferte(){if(d.getElementById('details').innerHTML==""){d.getElementById('details').innerHTML="<div class=\"empty\">Fill out the number of people <br />and the duration of the roundtrip.</div>";}
var duur=Uri.uitlezen('duur');var personen=Uri.uitlezen('personen');if(!duur){duur=tocht.getduur();}
if(!personen){personen=tocht.getpersonen();}
if(personen){d.getElementById("invoerPersonen").value=personen;}
if(duur){d.getElementById("invoerUren").value=duur;}
if(duur&&personen){loadXML('boten.xml','list');}}
function belasting(){this.boot=1.06;this.drank=1.19;this.vermakelijkheid=0;}
function boot(){this.id="";this.naam="";this.bootHuur=0;this.voorafvaart=0;this.personeel=0;this.capaciteit=0;this.image="";this.url="";this.beschrijving="";}
function offerte(){this.boten="";this.personen="";this.duur="";this.prijs="";this.kalehuur=0;this.taxboothuur=0;this.vermakelijkheidsbelasting=0;}
function verstuurvenster(){document.getElementById('verstuurvenster').style.display='block';}
function sluitverstuurvenster(){document.getElementById('verstuurvenster').style.display='none';}
function checkverzendofferte(){naam=document.verzenden.naam.value
email=document.verzenden.email.value
if(naam==""){alert("The name is not set.");document.verzenden.naam.focus();return false}
if(!echeck(email)){alert("The e-mailaddress is not correct.");document.verzenden.email.focus();return false}
id=document.getElementById("selectedboot").innerHTML;var schip=new boot();var prijsopgaaf=new offerte();var tax=new belasting();data=document.getElementById('gegevens').innerHTML;data=eval('('+data+')');for(i in data.boten){if(data.boten[i].bootid==id){schip.naam=data.boten[i].data[0].naam;schip.capaciteit=parseInt(data.boten[i].data[0].capaciteit);schip.bootHuur=new Number(data.boten[i].data[0].boothuur);schip.voorafvaart=parseFloat(data.boten[i].data[0].voorafvaart);schip.image=data.boten[i].data[0].image;schip.url=data.boten[i].data[0].url;schip.beschrijving=data.boten[i].data[0].beschrijving;schip.personeel=parseInt(data.boten[i].data[0].personeel);tax.vermakelijkheid=new Number(data.boten[i].data[0].vermakelijkheid);prijsopgaaf.personen=d.getElementById("invoerPersonen").value;prijsopgaaf.duur=d.getElementById("invoerUren").value;prijsopgaaf.prijs=new Number(((parseFloat(schip.bootHuur)*parseFloat(prijsopgaaf.duur))*tax.boot)+(parseFloat(tax.vermakelijkheid)*parseFloat(prijsopgaaf.personen)));prijsopgaaf.prijs=prijsopgaaf.prijs.toFixed(2);prijsopgaaf.kalehuur=(parseFloat(schip.bootHuur)*parseFloat(prijsopgaaf.duur));prijsopgaaf.taxboothuur=((parseFloat(schip.bootHuur)*parseFloat(prijsopgaaf.duur))*(tax.boot-1));prijsopgaaf.vermakelijkheidsbelasting=(parseFloat(tax.vermakelijkheid)*parseFloat(prijsopgaaf.personen))
var expireDate=new Date();expireDate.setDate(expireDate.getDate()+14);expireDate=expireDate.getDate()+'-'+(expireDate.getMonth()+1)+'-'+expireDate.getFullYear();document.getElementById('message').value="Dear sir/madame"+naam+" <br /><br />Thank you for requesting an estimate at Classic Canal Charters.<br /><br />\r\nHereby you receive an estimate for a roundtrip on the "+schip.naam+" with "+prijsopgaaf.personen+" people.<br /><br />\r\nIf you want to book this trip, please contact us.<br /><br />Changes in the program or in catering are possible. Discuss your options with one of your colleagues.<br />\r\n<table><tr><td>Boatrental:</td><td>"+prijsopgaaf.kalehuur.toFixed(2)+"</td></tr><tr><td>VAT (6%):</td><td>"+prijsopgaaf.taxboothuur.toFixed(2)+"</td></tr>\r\n<tr><td>Tourist Tax:</td><td>"+prijsopgaaf.vermakelijkheidsbelasting.toFixed(2)+"</td></tr><tr><td>Total:</td><td>"+prijsopgaaf.prijs+"</td></tr></table>\r\n<br />If you have any questions, we kindly advice you. So don't hesitate to contact us.<br /><br />Best regards,<br /><br />\r\nPeter van Velsen<br />Onno Ditewig<br />Yolande Hazebroek<br />Leonie Merino Pico<br /><br />\r\nClassic Canal Charters<br />Czaar Peterstraat 147<br />1018 PH  Amsterdam<br />Telefoon: 0031 (0)20-4210825<br />\r\nFax: 0031 (0)20-4217150<br />www.classiccanalcharters.com<br />ccc@planet.nl";document.verzenden.submit();}}}
function echeck(str){var at="@";var dot=".";var lat=str.indexOf(at);var lstr=str.length;var ldot=str.indexOf(dot);if(str.indexOf(at)==-1){return false}if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){return false}if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){return false}if(str.indexOf(at,(lat+1))!=-1){return false}if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){return false}if(str.indexOf(dot,(lat+2))==-1){return false}if(str.indexOf(" ")!=-1){return false}return true}
function getDetails(){alert('People:'+d.getElementById('pers').value+"\nDuration: "+d.getElementById('tijd').value);}
function getPrijs(id){sluitverstuurvenster();data=document.getElementById('gegevens').innerHTML;data=eval('('+data+')');var currentbootnummer;var schip=new boot();var prijsopgaaf=new offerte();var tax=new belasting();schip.id=id;for(i in data.boten){if(data.boten[i].bootid==schip.id){currentbootnummer=i;schip.naam=data.boten[i].data[0].naam;schip.capaciteit=parseInt(data.boten[i].data[0].capaciteit);schip.bootHuur=new Number(data.boten[i].data[0].boothuur);schip.voorafvaart=parseFloat(data.boten[i].data[0].voorafvaart);schip.image=data.boten[i].data[0].image;schip.url=data.boten[i].data[0].url;schip.beschrijving=data.boten[i].data[0].beschrijving;schip.personeel=parseInt(data.boten[i].data[0].personeel);tax.vermakelijkheid=new Number(data.boten[i].data[0].vermakelijkheid);prijsopgaaf.personen=d.getElementById("invoerPersonen").value;prijsopgaaf.duur=d.getElementById("invoerUren").value;prijsopgaaf.prijs=new Number(((parseFloat(schip.bootHuur)*parseFloat(prijsopgaaf.duur))*tax.boot)+(parseFloat(tax.vermakelijkheid)*parseFloat(prijsopgaaf.personen)));prijsopgaaf.prijs=prijsopgaaf.prijs.toFixed(2);prijsopgaaf.kalehuur=(parseFloat(schip.bootHuur)*parseFloat(prijsopgaaf.duur));prijsopgaaf.taxboothuur=((parseFloat(schip.bootHuur)*parseFloat(prijsopgaaf.duur))*(tax.boot-1));prijsopgaaf.vermakelijkheidsbelasting=(parseFloat(tax.vermakelijkheid)*parseFloat(prijsopgaaf.personen))}}
var bes=data.boten.length;for(t=0;t<=bes;t++){if(document.getElementById(t)){d.getElementById(t).style.backgroundColor="#efefef"}}
d.getElementById(currentbootnummer).style.backgroundColor="#fff";var output="<div style=\"display: none;\" id=\"selectedboot\">"+schip.id+"</div><div class=\"detailscontainer\"><h3>You have chosen the "+schip.naam+".</h3>"
+""
+"<div class=\"beschrijving\"><p>"+schip.beschrijving+"</p></div>"
+"<div class=\"prijsopgaaf\">Your price: <span class=\"prijs\">€ "+prijsopgaaf.prijs+"</span><br /><input type=\"button\" value=\"Send Estimate\" id=\"OfferteAanvraag\" onclick=\"verstuurvenster()\" /><br /><input type=\"button\" value=\"Print Estimate\" id=\"OfferteAfdruk\" onclick=\"PrintPage()\" /></div>"
+"<div class=\"clear\"></div><h3>Pricespecification</h3>"
+"<p style=\"font-size: 0.7em; line-height: 1em; color: #666;\">The price that is displayed is only an indication. The actual price depends on other factors like drinks and culinary options. This indicative price consists of the following options:</p>"
+"<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"
+"<tr><td>- Number of people</td><td align=\"right\">"+prijsopgaaf.personen+" people</td></tr>"
+"<tr><td>- Duration</td><td align=\"right\">"+prijsopgaaf.duur+" hours</td></tr>"
+"<tr><td width=\"80%\">- Boatrental</td><td width=\"20%\" align=\"right\">€ "+prijsopgaaf.kalehuur.toFixed(2)+"</td>"
+"<tr><td>- VAT (6%)</td><td align=\"right\">€ "+prijsopgaaf.taxboothuur.toFixed(2)+"</td></tr>"
+"<tr><td>- Tourist Tax total</td><td align=\"right\">€ "+prijsopgaaf.vermakelijkheidsbelasting.toFixed(2)+"</td></tr>"
+"<tr><td>Total:</td><td align=\"right\">€ "+prijsopgaaf.prijs+"</td></tr>"
+"<tr><th style=\"padding-top: 10px;\">Total per person:</th><th align=\"right\" style=\"padding-top: 10px;\">€ "+(prijsopgaaf.prijs/prijsopgaaf.personen).toFixed(2)+"</th></tr>"
+"</table>"
+"<img src=\""+schip.image+"\" alt=\""+schip.naam+"\" align=\"center\" />"
+"</div>"
d.getElementById('details').innerHTML=output;}
function getOfferte(xmlObj){var prijsopgaaf=new offerte();var tax=new belasting();prijsopgaaf.boten=xmlObj.getElementsByTagName("naam");prijsopgaaf.personen=d.getElementById("invoerPersonen").value;prijsopgaaf.duur=d.getElementById("invoerUren").value;tax.vermakelijkheid=xmlObj.getElementsByTagName("belasting")[0].childNodes[0].nodeValue;var output=new Array(12);var x;var y;var z;x="";y="<div class=\"detailscontainer\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><th width=\"80%\">Boat:</th><th width=\"20%\" align=\"right\">Price:</th>";z="{\"boten\" : [ ";bootnr=-1
for(i=0;i<prijsopgaaf.boten.length;i++){bootnr++;var schip=new boot();schip.id=xmlObj.getElementsByTagName("id")[i].childNodes[0].nodeValue;schip.capaciteit=xmlObj.getElementsByTagName("Capaciteit")[i].childNodes[0].nodeValue;schip.image=xmlObj.getElementsByTagName("image")[i].childNodes[0].nodeValue;schip.url=xmlObj.getElementsByTagName("url")[i].childNodes[0].nodeValue;schip.beschrijving=xmlObj.getElementsByTagName("desc")[i].childNodes[0].nodeValue;if(parseInt(prijsopgaaf.personen)<=parseInt(schip.capaciteit)){schip.naam=xmlObj.getElementsByTagName("naam")[i].childNodes[0].nodeValue;schip.bootHuur=new Number(xmlObj.getElementsByTagName("boothuur")[i].childNodes[0].nodeValue);prijsopgaaf.prijs=new Number(((parseFloat(schip.bootHuur)*parseFloat(prijsopgaaf.duur))*tax.boot)+(parseFloat(tax.vermakelijkheid)*parseFloat(prijsopgaaf.personen)));prijsopgaaf.prijs=prijsopgaaf.prijs.toFixed(2);z=z+"{ \"bootid\":\""+schip.id+"\",\"data\": [ {\"id\":\""+schip.id+"\",\"naam\":\""+schip.naam+"\",\"personeel\":\""+schip.personeel+"\",\"image\":\""+schip.image+"\",\"boothuur\":\""+schip.bootHuur+"\",\"capaciteit\":\""+schip.capaciteit+"\",\"url\":\""+schip.url+"\",\"beschrijving\":\""+schip.beschrijving+"\",\"vermakelijkheid\":\""+tax.vermakelijkheid+"\",\"voorafvaart\":\""+schip.voorafvaart+"\"} ] },";y=y+"<tr onclick=\"getPrijs('"+schip.id+"')\" onmouseover=\"this.style.backgroundColor='#efefef'\" onmouseout=\"this.style.backgroundColor='#fff'\"><td><img src=\"../../fotos/icons/schepen_offerte/"+schip.id+"_small.jpg\" align=\"middle\" />"+schip.naam+"</td><td align=\"right\" style=\"padding: 4px;\">€ "+prijsopgaaf.prijs+"</td></tr>";x=x+"<div id=\""+bootnr+"\" class=\"\" onclick=\"getPrijs('"+schip.id+"')\"><img src=\"../../fotos/icons/schepen_offerte/"+schip.id+"_small.jpg\" align=\"middle\" />"+schip.naam+"</div>";}
else{bootnr--;}}
z=z.substr(0,z.length-1);z+="] }";y+="</table><p>The overview below contain the ships that have sufficient capacity for the number of people you privided. It also displayes a price. To see the details, click on one of the ships.</p><p>You can always contact us by phone or e-mail.</p></div>";d.getElementById('beschikbaar').innerHTML=x;d.getElementById('details').innerHTML=y;d.getElementById('gegevens').innerHTML=z;}
function loadXML(xmlFile,response){var xmlDoc=false
if(window.XMLHttpRequest){xmlDoc=new XMLHttpRequest();}
else if(window.ActiveXObject)
{try
{xmlDoc=new ActiveXObject("Msxml2.XMLHTTP")}
catch(e)
{try
{xmlDoc=new ActiveXObject("Microsoft.XMLHTTP")}
catch(e){}}}
else
return false
xmlDoc.async="false";xmlDoc.onreadystatechange=function()
{if(xmlDoc.readyState!=4){return false;}
else{var xmlObj=this.responseXML;if(response=="list"){getOfferte(xmlObj);}
else{return xmlObj;}}}
xmlDoc.open('GET',xmlFile);xmlDoc.send(null);}
function verify(){if(xmlDoc.readyState!=4)
{return false;}}
