function open_in_popup_window(url, name, width, height) {
	window.open(url.href, name, 'width=' + width + ', height=' + height + ', toolbar=no, location=no,directories=no ,status=no, menubar=no, scrollbars=yes, resizable=yes');
	return false;
}

function open_in_new_window(url) {
	window.open(url.href, 'external_link', 'toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes');
	return false;
}

function load() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById('map'));
		var point=new GLatLng(52.794458,-1.122322);
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(point,13);
		map.addOverlay(new GMarker(point));
	}
}

$(function() {
	$('.lightbox').lightbox();
	$('img.main').wrap('<div class="cornerswrap"></div>');
	$('.cornerswrap').append('<div class="corners_btm">');
	$('.cornerswrap').prepend('<div class="corners_top">');
});

$(function() {
	if ($('.home').length) {
		//slides the element with class 'slide_panel' when mouse is over the h3
		$('#panels h3').click(function() {
			var self = $(this);

			self.css({
				backgroundImage: 'url(css/images/panels-h3-current.png)'
			}).next('div.panel_content').slideDown(500).siblings('div.panel_content').slideUp(500);

			self.siblings('h3').css({
				backgroundImage: 'url(css/images/panels-h3.png)'
			});
		});

		var lastBlock = $('#slide1'),
	    maxWidth = 687,
	    minWidth = 48;
   		lastBlock.width(687);

	    $('div#branding div').click(function(){
			$(lastBlock).animate({
				width: minWidth + 'px'
			}, {
				queue: false,
				duration: 600
			});
			$(this).animate({
				width: maxWidth + 'px'
			}, {
				queue:false,
				duration:600
			});
			lastBlock = this;
		});

		var so = new SWFObject('/flash/home.swf', 'home_flash', '884', '300', '6', '#FFFFFF');
		so.addParam('wmode', 'transparent');
		so.write('branding');
	}
});


