﻿function initializeMap() {
	var latlng = new google.maps.LatLng(51.12215,4.69750);
	var myOptions = {
		zoom: 16,
		center: latlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
		};
	//var image = 'images/gmapsLogo.png';
	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	var contentString = '<div>'+
						'<div style="color:black;font-size: 1.2em;font-weight: bold;">Hullebrug Bed & Breakfast</div>'+
						'<p style="color:black;">Bevelsesteenweg 101<br>2222 Itegem (Heist-op-den-Berg)<br>Belgi&euml;</p>'+ 
						'</div>';

	var infowindow = new google.maps.InfoWindow({content: contentString});

	var marker = new google.maps.Marker({
					position: latlng,
					map: map,
					title:"Hullebrug"//,
					//icon: image
				});

	google.maps.event.addListener(marker, 'click', function() {
		infowindow.open(map,marker);
	});
}

function showReadMoreText()
{
	document.getElementById('readMoreButton').style.display="none";
	document.getElementById('readMoreText').style.display="block";
}

function showRoomInfo(buttonID, roomID)
{
	//hide all
	document.getElementById('aboutPirroen').style.display="none";
	document.getElementById('roomButtonPirroen').style.backgroundColor="#e64500";
	document.getElementById('aboutMarieke').style.display="none";
	document.getElementById('roomButtonMarieke').style.backgroundColor="#e64500";
	document.getElementById('aboutSymforosa').style.display="none";
	document.getElementById('roomButtonSymforosa').style.backgroundColor="#e64500";
	document.getElementById('aboutFrisine').style.display="none";
	document.getElementById('roomButtonFrisine').style.backgroundColor="#e64500";
	//show one
	document.getElementById(roomID).style.display="block";
	document.getElementById(buttonID).style.backgroundColor="#8b1600";
}

//Fix PNG in IE6
 var blank = new Image();
 blank.src = '../images/pixel.gif';
 function fixPng(png) {
   // get src
   var src = png.src;
   // set width and height
   if (!png.style.width) { png.style.width = $(png).width(); }
   if (!png.style.height) { png.style.height = $(png).height(); }
   // replace by blank image
   png.onload = function() { };
   png.src = blank.src;
   // set filter (display original image)
   png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
    }
 $(document).ready(function() {
   var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
   if (badBrowser) {
     // get all pngs on page
     $('img[src$=.png]').each(function() {
       if (!this.complete) {
         this.onload = function() { fixPng(this) };
       } else {
         fixPng(this);
       }
     });
   }
 });