
/*  jQuery functions  */
$(document).ready(function(){
	
// VARIOUS bits of pop-up MAP page
	$('#extra').click(function(evt){
		 // event delegation bit - #extra exists whereas its children don't yet
		var target = $(evt.target); // the target of the click event 
		if (target.is('#close')) {	// click the close button
			$('#greyCover').hide();
			$('#extra').hide();
			$('#flashBox').show();
		}
		if (target.is('#goo')) {	// click the google link
			$('#MapContainer').html('<iframe width="580" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.uk/?q=Henry+Sotheran+Ltd+W1S+3DP&amp;output=embed"></iframe><br /><small><a href="http://maps.google.co.uk/maps?q=Henry+Sotheran+London+W1S3DP&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>');
			return false;
		}
		
	});

	$('#greyCover').click(function(){	// click the shady area
		$('#greyCover').hide();
		$('#extra').hide();
		$('#flashBox').show();
	});
	
	$('#map_link').click(function(){ // SHOW the Map
		$('#flashBox').hide();
		$('#greyCover').show();
		// load map page into div without header & footer etc.
		$('#extra').show().load("StreetMap.php?async=1");
		return false;
	});
});