
	function switchContactDetails(loc)
	{
		if (locationData[loc]!=undefined)
		{

			var locationDetailsEl = $('#locationDetails');
			var telephoneEl = locationDetailsEl.children('.telephone:first b');
			var emailEl = locationDetailsEl.children('.email:first a');

			telephoneEl.text(locationData[loc]['telephone']);
			emailEl.text(locationData[loc]['email']);
			emailEl.attr('href','mailto:'+locationData[loc]['email']);
			
		}
	}

	$(document).ready(function(){

		// prepare callback slider
		var callback = $('#callback');
		callback.children('form').hide();

		// shrink the box and show the contact info
		$('#quickContact').css('height','140px');
		$('#contactInfo').show();
		
		// clear contents of text boxes on first click
		$('#callback .field input').focus(function(){
			$(this).val('');
			$(this).unbind('focus');
		});

		callback.children('.toggle').toggle(function(){
			// open
			$('#quickContact').stop().animate({height:'180px'});
			$('#contactInfo').slideUp();
			$('#callback form').slideDown();

			// flip the arrow direction if it has one
			if ($(this).hasClass('whiteUpArrow')) $(this).removeClass('whiteUpArrow').addClass('whiteUpArrowFlip');
			if ($(this).hasClass('whiteDownArrow')) $(this).removeClass('whiteDownArrow').addClass('whiteDownArrowFlip');

		},function()
		{
			// close
			$('#quickContact').stop().animate({height:'140px'});
			$('#contactInfo').slideDown();
			$('#callback form').slideUp();
			if ($(this).hasClass('whiteUpArrowFlip')) $(this).removeClass('whiteUpArrowFlip').addClass('whiteUpArrow');
			if ($(this).hasClass('whiteDownArrowFlip')) $(this).removeClass('whiteDownArrowFlip').addClass('whiteDownArrow');
		});

		$('#sliderContent').hide();
		$('#sliderToggle').click(function()
		{
			$('#sliderContent').slideToggle();
		});

		var contentPages = $('#content .contentPage');
		if (contentPages.length > 0)
		{
			$('#content .contentPage').addClass('tabs-container');
			try
			{
				$('#page').tabs();
			} catch (e) {}
		}

		// menu expandables
		$('#mainMenu .expandable').each(function(){
			var target = $(this).attr('title');
			$(this).attr('href','javascript:void(\''+target+'\')');
			$(this).click(function(){
				$('#subMenu ul').hide();
				$('#subMenu ul.'+target).fadeIn("normal");
			});
		});

		$('#leftColumn').supersleight();
		$('#content').supersleight();
	});