$(document).ready(function(){
	/* Gallery Lightbox */
	$('#image-gallery a').kwokbox({
		caption: false,
		xlGallery: true
	});
	$('a.gallery-thumb').kwokbox({
		caption: false,
		xlGallery: true
	});

	/* Homepage Background Stop Scaling */
	if ($("#flash-background").length != 0) {
		var left = (($(window).width() - 1920) / 2);
		$("#flash-background").css("left", left + 'px');
	}
});

/* Homepage Background Animation */
if ($("#flash-background").length != 0) {
	swfobject.registerObject("flash-bg", "9.0.0");
}

/* Homepage cu3er Flash */
if ($("#cu3er-container").length != 0) {
	swfobject.registerObject("cu3er", "9.0.0");
}

/* Contact Google Map */
function loadGMap() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("google-map"));
		var centre = new GLatLng(51.770303, -0.444244);				// Make sure you change the coordinates!
		var map2 = new GMap2(document.getElementById("google-map-2"));
		var centre2 = new GLatLng(52.29787,-2.07619);				// Make sure you change the coordinates!
		map.setCenter(centre, 14);
		map.addControl(new GSmallMapControl());
		map.addOverlay(new GMarker(centre));
		map2.setCenter(centre2, 14);
		map2.addControl(new GSmallMapControl());
		map2.addOverlay(new GMarker(centre2));

		var cIcon = new GIcon();
		cIcon.image = "/images/map-icon.png";
		cIcon.iconSize = new GSize(87, 66);
		cIcon.iconAnchor = new GPoint(43, 65);

		var cIcon2 = new GIcon();
		cIcon2.image = "/images/map-icon2.png";
		cIcon2.iconSize = new GSize(87, 66);
		cIcon2.iconAnchor = new GPoint(43, 65);

		map.addControl(new GSmallMapControl());
		map.addOverlay(new GMarker(centre, {icon:cIcon}));
		map2.addControl(new GSmallMapControl());
		map2.addOverlay(new GMarker(centre2, {icon:cIcon2}));
	}
}
