﻿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>GPS-adres: Gestelsesteenweg 1 Itegem (N51°07.332’; E04°41.869’)<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";
}

function calculateArrengementPrice(val)
{
	switch (val)
	{
		case "Waarde die u zelf wenst te schenken":
			document.getElementById('arrangementSelectPrice').innerHTML = "het bedrag dat u wenst te schenken (de waarde wordt dan wel op de KadoBon vermeld)";
			break;
		case "1 overnachting":
			document.getElementById('arrangementSelectPrice').innerHTML = "120 euro";
			break;
		case "2 overnachtingen":
			document.getElementById('arrangementSelectPrice').innerHTML = "200 euro";
			break;
		case "3 overnachtingen":
			document.getElementById('arrangementSelectPrice').innerHTML = "240 euro";
			break;
		case "Familie-Arrangement In het Land van Goesting":
			document.getElementById('arrangementSelectPrice').innerHTML = "240 euro";
			break;
		default:
			document.getElementById('arrangementSelectPrice').innerHTML = "0 euro";
	}
}

//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);
       }
     });
   }
 });
 
 //fancybox init
$(function() {
	$("a.zoomImage").fancybox({
		'titleShow'		: false,
		'hideOnContentClick': true,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'cyclic': true
	});
});

//right extras menu animation
$(function() {
	$("#rightMenuExtras li span").css("opacity","0");
	$("#rightMenuExtras li span").hover(function () {
			$(this).stop().animate({opacity: 1}, 400);
		},
		// on mouse out
		function () {
			$(this).stop().animate({opacity: 0}, 400);
	});
});

//gift coupon example animation
$(function() {
	$("#giftCouponSample span.couponActive").css("opacity","0");
	$("#giftCouponSample span.couponActive").hover(function () {
			$(this).stop().animate({opacity: 1}, 400);
		},
		// on mouse out
		function () {
			$(this).stop().animate({opacity: 0}, 400);
	});
});
