var siteFunctions = {
	textResize : function() {
		// Show text resizing links
		$('#textResize').show();
		
		var debug = false;
		var cookieName = 'Goolden-FontSize';
		//var cookieOptions = { expires: 1 }; // Expires in 1 day
		var $baseElement = $('body');
		var originalFontSize = '1em';
		
		// If exists load saved value, otherwise store it
		if ($.cookie(cookieName)) {
			var $getSize = $.cookie(cookieName);
			if (debug) alert($getSize);
			
			$baseElement.css('font-size', $getSize + ($getSize.indexOf('px') != -1 ? '' : 'px')); // IE fix for double 'pxpx' error
		}
		
		// Reset link
		$('.fontSizeReset').bind('click', function() {
			$baseElement.css('font-size', originalFontSize);
			
			$.cookie(cookieName, null); // Delete cookie
		});
		
		// Increase link
		$('.fontSizeIncrease').bind('click', function() {
			var currentFontSize = $baseElement.css('font-size');
			if (debug) alert('currentFontSize = ' + currentFontSize);
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum * 1.1;
			
			if (newFontSize, 11) {
				$baseElement.css('font-size', newFontSize);
				$.cookie(cookieName, newFontSize);
			}
			
			return false;
		});
		
		// Decrease link
		$('.fontSizeDecrease').bind('click', function() {
			var currentFontSize = $baseElement.css('font-size');
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum * 0.9;
			
			if (newFontSize, 11) {
				$baseElement.css('font-size', newFontSize);
				$.cookie(cookieName, newFontSize);
			}
			
			return false;
		});
	}
}
 
$(document).ready(function() {
	siteFunctions.textResize();
	
	// Setup Google Map
	var mapEl = document.getElementById('map');
	
	if (mapEl == null)
		mapEl = document.getElementById('miniMap');
	
	if (mapEl != null)
	{
		var map = new GMap2(mapEl);
		
		var location = new GLatLng(53.56488, -0.08445);
		map.setCenter(location, 15);
		
		var marker = new GMarker(location);
	    map.addOverlay(marker);
	}
});
