function closeWin() {var closewindow = window.open("","Tethys"); closewindow.close();}


function addZeros(nr){
 var nrstring;
 var addZero = "";
 nr = parseInt(nr);
 if (nr < 10) {addZero = "00"; }
 else {if (nr < 100) {addZero = "0"; }};
 nrstring="" + addZero + nr;
 return nrstring;
}

function textCounter(wf,field, countfield, maxlimit, counter) {
 if (counter =="1"){
  if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit);
  else countfield.value = maxlimit - field.value.length;
 }//if (counter =="1")
 else { switch (parseInt(wf)) {case 1:whitefields1();break; case 2:whitefields2();break; case 3: break;} countfield.value = maxlimit;}
 document.getElementById("tremlen").innerHTML = addZeros(countfield.value);
} // End textCounter


function testmail(emailaddress){
 var notvalid = 0;
 if (emailaddress.indexOf('@',0) == -1) {notvalid = 1;}
 if (emailaddress.indexOf('.',0) == -1) {notvalid = 2;}
 if (notvalid == 0){return true;} else {return false;}
} // testmail


function hidesubject() {
 var hideme = parseInt(document.contactform.onderwerp.value);
 switch (hideme) {
  case 0: document.getElementById("box602").style.visibility = 'collapse'; document.contactform.subject.value = ""; break;
  case 1: document.getElementById("box602").style.visibility = 'collapse'; document.contactform.subject.value = "Aanbeveling of suggestie"; break;
  case 2: document.getElementById("box602").style.visibility = 'collapse'; document.contactform.subject.value = "Informatie over de diensten"; break;
  case 3: document.getElementById("box602").style.visibility = 'collapse'; document.contactform.subject.value = "Informatie over de website"; break;
  case 4: document.getElementById("box602").style.visibility = 'collapse'; document.contactform.subject.value = "Afzeggen van een afspraak"; break;
  case 5: document.getElementById("box602").style.visibility = 'collapse'; document.contactform.subject.value = "Klacht over de diensten"; break;
  case 6: document.getElementById("box602").style.visibility = 'collapse'; document.contactform.subject.value = "Klacht over de website"; break;
  case 7: document.getElementById("box602").style.visibility = 'visible';  document.contactform.subject.value = "";break;
 } //switch
}

function whitefields1(){
 parent.frames[1].document.getElementById("name").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("email").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("phone").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("reference").style.background = "#FFFFFF";
// parent.frames[1].document.getElementById("onderwerp").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("comment").style.background = "#FFFFFF";
} // whitefields1

function formcheck1(){
 var forgotten = "U bent vergeten de volgende velden in te vullen: \n\n";
 var attention = 0;
 whitefields1();
 if (document.contactform.name.value  == "")     {attention = 1; forgotten += " - Uw naam" + "\n";             parent.frames[1].document.getElementById("name").style.background  = "yellow";}
 if (document.contactform.phone.value == "")     {attention = 1; forgotten += " - Telefoonnummer" + "\n";      parent.frames[1].document.getElementById("phone").style.background = "yellow";}
 if (!testmail(document.contactform.email.value)){attention = 1; forgotten += " - E-mailadres" + "\n";         parent.frames[1].document.getElementById("email").style.background = "yellow";}
 if (document.contactform.reference.value == "") {attention = 1; forgotten += " - Waar u mij van kent" + "\n"; parent.frames[1].document.getElementById("reference").style.background = "yellow";}
//if (document.contactform.subject.value == "")   {attention = 1; forgotten += " - Het onderwerp" + "\n";       parent.frames[1].document.getElementById("onderwerp").style.background = "yellow";}
 if (document.contactform.comment.value == "")   {attention = 1; forgotten += " - Uw vraag of opmerking";      parent.frames[1].document.getElementById("comment").style.background = "yellow";}
 if (attention == 0) {return true;} else{alert(forgotten);return false;}
} // formcheck1

function whitefields2(){
 parent.frames[1].document.getElementById("calias").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("cphone").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("ctime").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("cday").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("cmonth").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("cyear").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("cduur").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("clocatie").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("chotelname").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("caddress").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("ccity").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("czipcode").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("ccountry").style.background = "#FFFFFF";
 parent.frames[1].document.getElementById("ccode").style.background = "#FFFFFF";
} // whitefields2


function formcheck2(){
 var forgotten = "U bent vergeten de volgende velden in te vullen: \n\n";
 var attention = 0;
 whitefields2();
 if (document.bookform.calias.value  == "")      {attention = 1; forgotten += " - Uw alias" + "\n";          parent.frames[1].document.getElementById("calias").style.background  = "yellow";}
 if (document.bookform.cphone.value == "")       {attention = 1; forgotten += " - Uw mobielnummer" + "\n\n";   parent.frames[1].document.getElementById("cphone").style.background = "yellow";}
 if (document.bookform.ctime.value  == "")       {attention = 1; forgotten += " - Het tijdstip" + "\n";      parent.frames[1].document.getElementById("ctime").style.background  = "yellow";} 
 if (document.bookform.cday.value  == "")        {attention = 1; forgotten += " - De dag" + "\n";            parent.frames[1].document.getElementById("cday").style.background  = "yellow";} 
 if (document.bookform.cmonth.value  == "")      {attention = 1; forgotten += " - De maand" + "\n";          parent.frames[1].document.getElementById("cmonth").style.background  = "yellow";} 
 if (document.bookform.cyear.value  == "")       {attention = 1; forgotten += " - Het jaar" + "\n";          parent.frames[1].document.getElementById("cyear").style.background  = "yellow";} 
 if (document.bookform.cduur.value  == "")       {attention = 1; forgotten += " - De tijdsduur" + "\n\n";    parent.frames[1].document.getElementById("cduur").style.background  = "yellow";}
 if (document.bookform.clocatie.value == "")     {attention = 1; forgotten += " - De locatie" + "\n";        parent.frames[1].document.getElementById("clocatie").style.background = "yellow";}
 if (document.bookform.chotelname.value  == "")  {attention = 1; forgotten += " - Hotelnaam" + "\n";         parent.frames[1].document.getElementById("chotelname").style.background  = "yellow";}
 if (document.bookform.caddress.value == "")     {attention = 1; forgotten += " - Adres" + "\n";             parent.frames[1].document.getElementById("caddress").style.background = "yellow";}
 if (document.bookform.ccity.value == "")        {attention = 1; forgotten += " - Plaats" + "\n";            parent.frames[1].document.getElementById("ccity").style.background = "yellow";}
 if (document.bookform.czipcode.value == "")     {attention = 1; forgotten += " - Postcode" + "\n";          parent.frames[1].document.getElementById("czipcode").style.background = "yellow";}
 if (document.bookform.ccountry.value == "")     {attention = 1; forgotten += " - Land" + "\n\n";            parent.frames[1].document.getElementById("ccountry").style.background = "yellow";}
 if (document.bookform.ccode.value  == "")       {attention = 1; forgotten += " - De controle code" + "\n";  parent.frames[1].document.getElementById("ccode").style.background  = "yellow";} 
 if (attention == 0) {hotelfieldstatus(2); return true;} else{alert(forgotten);return false;}
} // formcheck1



function refreshcode(renew) {
 document.getElementById('newcode').src = document.getElementById('newcode').src + '?' + (new Date()).getMilliseconds();
 document.bookform.ccode.value= "";
 if (renew == "1") {document.bookform.ccode.focus();}
}


function showflash(){
 var swf = "../fondation/flash-01.swf";
 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="300" height="450" id="ladies" align="middle">');
 document.write('<param name="allowScriptAccess" value="sameDomain">');
 document.write('<param name="movie" value="' + swf + '">');
 document.write('<param name="quality" value="high">');
 document.write('<param name="menu" value="false">');
 document.write('<param name="wmode" value="transparant">');
 document.write('<param name="bgcolor" value="#000000">');
 document.write('<embed src="' + swf + '" wmode="transparent" quality="high" bgcolor="#000000" width="300" height="450" name="ladies" align="middle" menu="false" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
 document.write('</object>');
}  // showflash

function hotelfieldstatus(keus) {
 keus = parseInt(keus);
 switch (keus) {
  case 1:
  document.bookform.chotelname.disabled=true;
  document.bookform.caddress.disabled=true;
  document.bookform.ccity.disabled=true;
  document.bookform.czipcode.disabled=true;
  document.bookform.ccountry.disabled=true;
  break;
  case 2:
  document.bookform.chotelname.disabled=false;
  document.bookform.caddress.disabled=false;
  document.bookform.ccity.disabled=false;
  document.bookform.czipcode.disabled=false;
  document.bookform.ccountry.disabled=false;
  break;
  case 3:
  document.bookform.chotelname.value="Niet van toepassing";
  document.bookform.chotelname.disabled=true;
  document.bookform.caddress.disabled=false;
  document.bookform.ccity.disabled=false;
  document.bookform.czipcode.disabled=false;
  document.bookform.ccountry.disabled=false;
  break;
 }//switch
} //hotelfieldstatus

function hotelfielderase(locatie) {
 document.bookform.chotelname.value='';
 document.bookform.caddress.value='';
 document.bookform.ccity.value='';
 document.bookform.czipcode.value='';
 document.bookform.ccountry.value='';
 hotelfieldstatus(locatie);
}//hotelfielderase

function selectlocation() {
 var locatie = parseInt(document.bookform.clocatie.value);
 hotelfielderase(locatie);
 switch (locatie) {
  case 1: newWindow = window.open('../pages/08-hotels.html', 'Tethys', 'width=430,height=270,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0,,top=300,left=300'); break;
  case 2: break;
  case 3: break;
 } //switch
}//selectlocation

function hotelpicker() {
 var hotel = parseInt(document.hotelform.hotelnr.value);
 switch (hotel) {
  case 320201:
   document.hotelform.stars.value = "3";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Arcadia";
   document.hotelform.address.value = "Watermolenstraat 25";
   document.hotelform.city.value = "Bonheiden";
   document.hotelform.zipcode.value = "2820";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32(0)15 511200";
  break;
  case 320202:
   document.hotelform.stars.value = "3";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Canterbury";
   document.hotelform.address.value = "Van Maerlantstraat 46";
   document.hotelform.city.value = "Antwerpen";
   document.hotelform.zipcode.value = "2060";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32(0)32321515";
  break;
  case 320203:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Carotel";
   document.hotelform.address.value = "Antwerpsesteenweg 137";
   document.hotelform.city.value = "Rumst";
   document.hotelform.zipcode.value = "2840";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32(0)15320929";
  break;
  case 320204:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Claridge";
   document.hotelform.address.value = "Antwerpseweg 101";
   document.hotelform.city.value = "Geel";
   document.hotelform.zipcode.value = "2440";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32(0)14582111";
  break;
  case 320205:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Cleo";
   document.hotelform.address.value = "Turnhoutsebaan 163";
   document.hotelform.city.value = "Kasterlee";
   document.hotelform.zipcode.value = "2460";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32(0)14307654";
  break;
  case 320206:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Condessa";
   document.hotelform.address.value = "Lange Herentalsestraat 16a";
   document.hotelform.city.value = "Antwerpen";
   document.hotelform.zipcode.value = "2018";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32(0)32317364";
  break;
  case 320207:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Contessa";
   document.hotelform.address.value = "Adegemstraat 63";
   document.hotelform.city.value = "Mechelen";
   document.hotelform.zipcode.value = "2800";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32(0)15261696";
  break;
  case 320208:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "De Alkoof";
   document.hotelform.address.value = "Gentseweg 364";
   document.hotelform.city.value = "Beveren";
   document.hotelform.zipcode.value = "9120";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32(0)37759180";
  break;
  case 320209:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "De Inslag";
   document.hotelform.address.value = "Bredabaan 865";
   document.hotelform.city.value = "Brasschaat";
   document.hotelform.zipcode.value = "2930";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32(0)36632329";
  break;
  case 320210:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "De Inslag";
   document.hotelform.address.value = "Botermelkbaan 4";
   document.hotelform.city.value = "Schoten";
   document.hotelform.zipcode.value = "2900";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32(0)36583613";
  break;
  case 320211:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Dreamhouse";
   document.hotelform.address.value = "Van Stralenstraat 14";
   document.hotelform.city.value = "Antwerpen";
   document.hotelform.zipcode.value = "2060";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32(0)32340238";
  break;
  case 320212:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Ideal";
   document.hotelform.address.value = "De Waghemakerstraat 17";
   document.hotelform.city.value = "Antwerpen";
   document.hotelform.zipcode.value = "2060";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32 32340070";
  break;
  case 320213:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Love Nest";
   document.hotelform.address.value = "Turnhoutsebaan 46";
   document.hotelform.city.value = "Mol";
   document.hotelform.zipcode.value = "2400";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32 14313764";
  break;
  case 320214:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Maroly";
   document.hotelform.address.value = "Liersesteenweg 87";
   document.hotelform.city.value = "Grobbendonk";
   document.hotelform.zipcode.value = "2280";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32 14517505";
  break;
  case 320215:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "New Cave";
   document.hotelform.address.value = "Liersesteenweg 323";
   document.hotelform.city.value = "Herentals";
   document.hotelform.zipcode.value = "2200";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32 14230478";
  break;
  case 320216:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Nord";
   document.hotelform.address.value = "Marnixstraat 27";
   document.hotelform.city.value = "Antwerpen";
   document.hotelform.zipcode.value = "2060";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32 32318156";
  break;
  case 320217:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Motel Cleo";
   document.hotelform.address.value = "Turnhoutsebaan 163";
   document.hotelform.city.value = "Kasterlee";
   document.hotelform.zipcode.value = "2460";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32 14307654";
  break;
  case 320218:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Return Lange";
   document.hotelform.address.value = "Winkelhaakstraat 20";
   document.hotelform.city.value = "Antwerpen";
   document.hotelform.zipcode.value = "2060";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32 32328866";
  break;
  case 320219:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Sud";
   document.hotelform.address.value = "Plaatsnijdersstraat 3";
   document.hotelform.city.value = "Antwerpen";
   document.hotelform.zipcode.value = "2000";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32 382418";
  break;
  case 320220:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Trianon";
   document.hotelform.address.value = "Stationsstraat 9";
   document.hotelform.city.value = "Boortmeerbeek (Hever)";
   document.hotelform.zipcode.value = "3191";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32 15520633";
  break;
  case 320221:
   document.hotelform.stars.value = "2";
   document.hotelform.price.value = "";
   document.hotelform.housename.value = "Willendries";
   document.hotelform.address.value = "Leuvensesteenweg 697";
   document.hotelform.city.value = "Muizen (Mechelen)";
   document.hotelform.zipcode.value = "2812";
   document.hotelform.country.value = "België";
   document.hotelform.phone.value = "+32 15512163";
  break;
 } //switch
 opener.document.bookform.chotelname.value  = document.hotelform.housename.value;
 opener.document.bookform.caddress.value    = document.hotelform.address.value;
 opener.document.bookform.ccity.value       = document.hotelform.city.value;
 opener.document.bookform.czipcode.value    = document.hotelform.zipcode.value;
 opener.document.bookform.ccountry.value    = document.hotelform.country.value;
 opener.document.bookform.chotelphone.value = document.hotelform.phone.value;
} // hotelpicker
