// JavaScript Document

function email_verzenden()
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
      }
    catch (e)
      {
      alert('Your browser does not support AJAX!');
      return false;
      }
    }
  }

  
//database verzoek controleren
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
  {
  document.getElementById('mailformulier').innerHTML=xmlHttp.responseText;
  }
}  
  
  
  
xmlHttp.open('GET','sendemail_en.php?emailadres='+document.contact.emailadres.value+'&onderwerp='+document.contact.onderwerp.value+'&naam='+document.contact.naam.value+'&bericht='+document.contact.bericht.value,true);
xmlHttp.send(null);

}


function velden_ophalen(formulier)
{

regel ="";

for (i=0;i<document.forms[formulier].elements.length;i++)
{
regel += document.forms[formulier].elements[i].name+"="+document.forms[formulier].elements[i].value
if (i+1<document.forms[formulier].elements.length)
{
regel +="&";
}
}

}


function boeking_verzenden()
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
      }
    catch (e)
      {
      alert('Your browser does not support AJAX!');
      return false;
      }
    }
  }

  
//database verzoek controleren
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
  {
  document.getElementById('personalia').innerHTML=xmlHttp.responseText;
  document.getElementById('kamerinformatie').innerHTML="";
  }
}  
  
velden_ophalen('personalia');
query = regel;
velden_ophalen('kamerinfo');
query += "&" + regel;
 
xmlHttp.open('GET','sendboeking_en.php?'+query,true);
xmlHttp.send(null);

}




function url_check(name)
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  
  if( results == null )
    return "";
  else
    return results[1];

}

function initbenb() {

	document.getElementById('1').innerHTML = "Bed & Bike";
	document.getElementById('2').innerHTML = "Rooms";
	document.getElementById('3').innerHTML = "Welcome";
	document.getElementById('4').innerHTML = "Area";
	document.getElementById('5').innerHTML = "Directions";
	document.getElementById('6').innerHTML = "Bookings";
	document.getElementById('7').innerHTML = "Contact";

	initHIS3("algemeen");
	setText(1);
}

function setText(mnu) {
	foto = document.getElementById("pic_0").src;
	foto = foto.substr(29,3);
	
	if(foto =="bbk" && mnu!= 2){
	initHIS3("algemeen")
	}
	var span = document.getElementById(mnu);
	var div = document.getElementById('pagina');
	var div_links = document.getElementById('frame_links');
	var div_rechts = document.getElementById('frame_rechts');
	
	var spanArray = document.getElementsByTagName('span');
	for (var i=0; i<spanArray.length; i++) {
		spanArray[i].style.color = 'white';
	}
	
	span.style.color = 'red';
	switch(mnu) {
		case 1:
			div.innerHTML = "A Beautiful room<br>A private Bathroom<br>And a Bike!<br><br>"
			div.innerHTML += "<p>Welcome at Alberti-BB, the only Bed and Bike in Rotterdam. We have two beautiful rooms, each with a private en suite bathroom. Our house, which was built in 1921, is situated in a quiet and green neighbourhood, only a 15 minutes walk from the Central Station in the heart of bustling Rotterdam.</p><br>"
			div.innerHTML += "<p>We do not serve breakfast, but both rooms are provided with a Nespresso machine for coffee and tea, and plates and cutlery are available. There is a microwave oven and refrigerator in the pantry on your floor. Shops are just around the corner. They are open on Sunday, the bakery as well.</p><br>"
			div.innerHTML += "<span id='23' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setextraText(11)';>More >></span>";
		break;
		case 2:
			div.innerHTML = "<div id='frame_links'><p>Room 1</p><ul><li>A double room, with private en suite bathroom (walk-in shower and toilet)</li><li>Rates per night for one person € 70</li><li>Rates per night for two persons € 75</li><li>Surcharge single night stay €5,-</li><li>Taxes and the use of two bicycles included</li><li>We do not serve breakfast</li><li>Weekend: minimum stay of two nights</li></ul><span id='21' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setRoom(21)';>More information / pictures room 1 >></span><br><span id='23' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setText(6)';>Bookings >></span></div>";
			div.innerHTML += "<div id='frame_rechts'><p>Room 2</p><ul><li>2-4 Persons double room (32 m<sup>2</sup> ): Bedroom and living room</li><li>Private en suite bathroom with bathtub and toilet</li><li>Price per night (1 and 2 persons) € 90</li><li>Two extra guests possible at a surcharge of €25,- per person per night.</li><li>Surcharge single night stay €5,-</li><li>Taxes and use of two bicycles included</li><li>We do not serve breakfast</li><li>Weekend: minimum stay of two nights</li></ul><span id='22' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setRoom(22)';>More information / pictures room 2 >></span><br><span id='23' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setText(6)';>Bookings >></span><div>";
		break;
		case 3:
			div.innerHTML = "<table class='centreren'><tr><td>Open</td><td>:</td><td>All year</td></tr><tr><td>Check in</td><td>:</td><td>By arrangement</td></tr><tr><td>Check–out</td><td>:</td><td>Around 11.30</td></tr><tr><td>Payment</td><td>:</td><td>In cash upon arrival</td></tr><tr><td>Languages</td><td>:</td><td>Dutch, English, German and French</td></tr><tr><td>Smoking</td><td>:</td><td>Not allowed</td></tr><tr><td>Children</td><td>:</td><td>Our B&B is not suitable for babies and young children</td></tr><tr><td>Pets</td><td>:</td><td>Now allowed</td></tr><tr><td>Meals</td><td>:</td><td>Shop and restaurants nearby</td></tr></table>";
		break;
		case 4:
			div.innerHTML = "<p>Rotterdam is a bustling cultural city with always something exciting to do, see and discover. Rotterdam is also a big city and the interesting areas are scattered all over. The bike is the ideal way to explore everything you want to see. All nice and thrilling sights are within a 10-minute bike ride from our house: The musea, the small harbours (the big harbour is a day trip by itself and better visited by tourist boat), the Euromast and several shopping areas. Rotterdam has many bars and clubs and numerous fantastic restaurants.</p><br>";
			div.innerHTML += "<p>In Chinatown you can eat authentic Chinese food. There are also many toko’s (exotic food shops) and eateries where you can taste Surinam, Indian, Thai, Moroccan, Turkish, Japanese and Indonesian dishes, and we are probably forgetting a few culinary cultures....</p><br>"
			div.innerHTML += "<p>Rotterdam is not just a big city with a big harbour. Apart from the cultural delights, the shopping areas, bars and restaurants there are also many beautiful parks and green areas. Or you can go and visit the monkeys and many other animals in Blijdorp Zoo. It is only a stone’s throw away from our doorstep.</p>";
		break;
		case 5:
			div.innerHTML = "<div id='frame_links'><iframe width='300' height='300' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='http://maps.google.nl/maps?f=q&amp;hl=nl&amp;geocode=&amp;q=Hugo+Molenaarstraat+49A+rotterdam&amp;sll=52.469397,5.509644&amp;sspn=2.831,7.075195&amp;ie=UTF8&amp;ll=51.926325,4.455729&amp;spn=0.011196,0.027637&amp;z=14&amp;iwloc=addr&amp;output=embed&amp;s=AARTsJqEWnpMk-ifhKJQSdfSwnJJzzu87w'></iframe></div>"	
			div.innerHTML += "<div id='frame_rechts'><span id='51' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setMap(51)';>Directions and public transport</span><br><span id='52' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setMap(52)';>Directions by car</span></div>";
		break;
		case 6:
			div.innerHTML = "<div id='frame_links'><div id='personalia'><form method='POST' ACTION='sendemail_en.php' name='personalia'><table><tr><td>Name</td><td><input type='text' name='naam' class='textInput'></td></tr><tr><td>Street address</td><td><input type='text' name='straat' class='textInput'></td></tr><tr><td>Home number</td><td><input type='text' name='huisnummer' class='textInput'></td></tr><tr><td>Zipp code</td><td><input type='text' name='postcode' class='textInput'></td></tr><tr><td>City Town</td><td><input type='text' name='woonplaats' class='textInput'></td></tr><tr><td>Country</td><td><input type='text' name='land' class='textInput'></td></tr><tr><td>Phone number</td><td><input type='text' name='telefoonnummer' class='textInput'></td></tr><tr><td>Mobile Phone</td><td><input type='text' name='telefoonnummer_mobiel' class='textInput'></td></tr><tr><td>Email</td><td><input type='text' name='emailadres' class='textInput'></td></tr><tr><td></td><td></form></td></tr></table></div></div>";
			div.innerHTML += "<div id='frame_rechts'><div id='kamerinformatie'><form method='POST' ACTION='sendemail_en.php' name='kamerinfo'><table><tr><td>Arrival date</td><td><select size='1' name='aankomstdag' class='textInput_zw'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option><option>16</option><option>17</option><option>18</option><option>19</option><option>20</option><option>21</option><option>22</option><option>23</option><option>24</option><option>25</option><option>26</option><option>27</option><option>28</option><option>29</option><option>30</option><option>31</option></select><select size='1' name='aankomstmaand' class='textInput_zw'><option>january</option><option>february</option><option>march</option><option>april</option><option>may</option><option>june</option><option>july</option><option>august</option><option>september</option><option>october</option><option>november</option><option>december</option></select></td></tr><tr><td>Departure date</td><td><select size='1' name='vertrekdag' class='textInput_zw'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option><option>16</option><option>17</option><option>18</option><option>19</option><option>20</option><option>21</option><option>22</option><option>23</option><option>24</option><option>25</option><option>26</option><option>27</option><option>28</option><option>29</option><option>30</option><option>31</option></select><select size='1' name='vertrekmaand' width='40px' class='textInput_zw'><option>january</option><option>february</option><option>march</option><option>april</option><option>may</option><option>june</option><option>july</option><option>august</option><option>september</option><option>october</option><option>november</option><option>december</option></select></td></tr><tr><td>Est. time of arrival</td><td><select name='aankomsttijd' ><option>-- --</option><option>< 08:00</option><option>08:00</option><option>08:30</option><option>09:00</option><option>09:30</option><option>10:00</option><option>10:30</option><option>11:00</option><option>11:30</option><option>12:00</option><option>12:30</option><option>13:00</option><option>13:30</option><option>14:00</option><option>14:30</option><option>15:00</option><option>15:30</option><option>16:00</option><option>16:30</option><option>17:00</option><option>17:00 ></option></select></td></tr><tr><td>Number of guests</td><td><select name='aantal_personen'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option></select></td><tr><tr><td>Preferred room</td><td><SELECT NAME='kamer' class='textInput'><OPTION VALUE='1'>room 1 (1-2 persons)<OPTION VALUE='2'>room 2 (1-4 persons)<OPTION VALUE='1&2'>room 1 en 2</SELECT></td></tr><tr><td>Remarks</td><td><textarea rows=5 cols=15 name='bericht' size=31 class='textInput'></textarea></form></td></tr></table><table><td><input type='button' value='Send' onclick=\"boeking_verzenden();\"></td><td>(<a href='cancellationconditions.pdf'>cancellation conditions</a>)</td></tr></table></div></div>";
		break;
		case 7:
			div.innerHTML = "Alberti-BB<br>Dorona Alberti & Diederik Schneemann<br>Hugo Molenaarstraat 49A<br>3022 NP Rotterdam<br>The Netherlands<br>Phone +31(0)10 4775550<br>Mob. +31(0)6 17906585<br><br><br>Do you have a remark/ observation or question? Click<span id='7' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setForm();'>> here <</span>"
			div.innerHTML += "<br><br><a href=\"http://www.weekendhotel.nl\" target='_blank'> <img src=\"http://www.weekendhotel.nl/images/banner_favoriet_nl.gif\" alt='hotel en bed and breakfast gids' width=127 height=46 border=0>";
		break;
	}
}

function setextraText(mnu) {

		div = document.getElementById('pagina');
		
		switch(mnu) {
		
		case 11:
			div.innerHTML = "<p>Actually we are a B&B&B: BED, private BATHROOM and BIKE! What makes our B&B special, is that there are bikes for our guests to explore all the nice and exciting things to see in Rotterdam. All the major sights are within a 10-minute bike ride from our house: the museums, the harbours, Chinatown, the main shopping areas, exotic little shops, bars and wonderful restaurants.</p><br>"
			div.innerHTML += "<p>Rotterdam is a sparkling, bustling, cultural city where there is always something to explore, to see and to do: It is a real metropolis.</p><br>"
			div.innerHTML += "<p>Bed & Bike, if you like the concept and always wanted to visit Maastricht as well... <a href=http://www.bb-alberti.nl>www.bb-alberti.nl</a> It runs in the family...</p><br>"
			div.innerHTML += "<br><span id='23' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setText(1)';><< Back</span>";
			document.getElementById(1).span.style.color = 'red';
		break;
		}
}



function setRoom(rm) {
  var div = document.getElementById('pagina');
	var div_links = document.getElementById('frame_links');
	var div_rechts = document.getElementById('frame_rechts');
	switch (rm) {
		case 21:
			initHIS3("kamer1");
			div.innerHTML = "<p>Room 1 (total 21 m<sup>2</sup>) is a beautiful and quiet double room with original features. The room has two comfortable beds (box springs). There is a private en suite bathroom with a walk-in shower, a wash basin and toilet. There’s a LCD-television and wireless internet in your room. So if you bring your laptop you can surf the web and check your e-mail.</p><br>"
			div.innerHTML += "<p>We don’t serve breakfast but you can make a nice (Nespresso) coffee or tea and there are also plates and cutlery provided for in your room. In the pantry there is a microwave oven and a refrigerator for you to use. So, if you wish, you can make your own breakfast, lunch or even a simple dinner. But it is also possible to go to a nice breakfast café in the neighbourhood.</p><br>";
			div.innerHTML += "<p>There are two comfortable city bikes at your disposal (free of charge)</p>"
			div.innerHTML += "<br><span id='23' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setText(2)';><< Back</span><span id='23' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setText(6)';>Bookings >></span>";
		break;
		case 22:
			initHIS3("kamer2");
			div.innerHTML = "<p>Room 2 (in total 32 m<sup>2</sup>) is a very spacious, beautiful and quiet room with original features. It has two comfortable beds (box springs) in the bedroom area, and a comfortable double sleeper sofa bed, seats and a LCD television in the living area. There is a private en suite bathroom with bath and shower-in-bath, washbasin and toilet.</p><br>"
			div.innerHTML += "<p>There is wireless Internet in your room, so if you bring your laptop, you can surf the web</p><br>"
			div.innerHTML += "<p>We don’t serve breakfast but you can make a nice (Nespresso) coffee or tea, and there are plates and cutlery provided for in your room. In the pantry there is a microwave oven and a refrigerator for you to use. So, if you wish, you can make breakfast, lunch and even a simple dinner. But it is also possible to go to a nice breakfast café in the neighbourhood.</p><br>";
			div.innerHTML += "<p>There are two comfortable city bicycles at your disposal (free of charge)</p><br>"
			div.innerHTML += "<span id='23' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setText(2)';><< Back</span><span id='23' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setText(6)';>Bookings >></span>";
		break;
	}
}

function setMap(mp) {
	var div_links = document.getElementById('frame_links');
	var div_rechts = document.getElementById('frame_rechts');
	switch (mp) {
	case 51:
      div_links.innerHTML = "<img src='img/route_ov.jpg' height=300 width=300></img>";
      div_rechts.innerHTML = "<span id='51' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setMap(51)';>Directions and public transport</span><br><span id='52' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setMap(52)';>Directions by car</span><br><br>"
	  div_rechts.innerHTML += "<p>Our B&B is a 15 - 20 minutes walk from Rotterdam Central Station. A taxi will charge around 8 Euros, but there is also public transport.</p><br>"
	  div_rechts.innerHTML += "<p>You can take tram 21 or 23 to the stop Vierambachtsstraat. From there it is a 3-minute walk. Walk back along the tracks and turn left onto the Burgemeester Meinezslaan, first right, first left, at the end of the street to the right and when you go straight on you bump into our house: Hugo Molenaarstraat 49A.</p><br>"
	  div_rechts.innerHTML += "<span id='23' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setMap(511)';>More >></span>";
	break;
	case 511:
	  div_links.innerHTML = "<img src='img/route_ov.jpg' height=300 width=300></img>";	
	  div_rechts.innerHTML = "<p>Or take BUS number 38; stop Heemraadsingel/ Beukelsdijk. Our street runs parallel to the Beukelsdijk. Cross this street, enter the street left or right, first corner, Hugo Molenaarstraat 49A. The night bus also stops here.</p>"; 
	  div_rechts.innerHTML += "<br><span id='23' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setMap(51)';> << Back</span>";
    break;
    case 52:
      div_links.innerHTML = "<img src='img/route_auto.jpg' height=300 width=300></img>";
      div_rechts.innerHTML = "<span id='51' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setMap(51)';>Directions and public transport</span><br><span id='52' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setMap(52)';>Directions by car</span><br><br>"
	  div_rechts.innerHTML += "Our house can be reached by highway A13, exit 13 Blijdorp. Take the roundabout ¾, at the traffic lights straight on (direction ”Centrum”). Next lights turn right (Van Aerssenlaan), pass the entrance to Zoo Blijdorp, then the first to the right (Beukelsdijk), first turn left, drive around the small square (Virulyplein) and there we are. Unfortunately Rotterdam only has paid parking and paying is only possible by chip which may be a problem for foreign visitors. You can buy a day pass at our B&B for 12,50 Euros if you want to park in our street. (for free parking you have to park your car outside the city ring, a bit of a walk away)";
    break;  
	}	
}

function setForm() {
	var div = document.getElementById('pagina');	
	div.innerHTML = "<div id='mailformulier'><form method='POST' ACTION='sendemail_en.php' name='contact'><table><tr><td>Name</td><td><input  type='text' name='naam' size=25 class='textInput'></td></tr><tr><td>Email</td><td><input  type='text' name='emailadres' size=25 class='textInput'></td></tr><tr><td>Subject</td><td><SELECT NAME='onderwerp' width=35 class='textInput'><OPTION VALUE='remark'>remark</OPTION><OPTION VALUE='observation'>observation</OPTION><OPTION VALUE='question'>question</OPTION></SELECT></td></tr><tr><td>Message</td><td><textarea rows=5 cols=19 name='bericht' class='textInput'></textarea></td></tr><tr><td></td><td><input type='button' value='Send' onclick=\"email_verzenden();\"><br></form></td></tr></table></div><br>"
	div.innerHTML += "<span id='23' onmouseover=\"this.style.color='red';\" onmouseout=\"this.style.color='white';\" onclick='setText(7)';><< Back</span>";
}

