function show_window(htmlFilename, windowName, windowWidth, windowHeight) {
	pu_window = window.open(htmlFilename, windowName, 'width='+windowWidth+', height='+windowHeight+', top='+((screen.availHeight/2)-(windowHeight/2))+', left='+((screen.availWidth/2)-(windowWidth/2)));	
	pu_window.focus();
	return false;
}

$(document).ready(function() {
	
	$('a.pu_window').click(function() {
		
		// Defaults
		width = 600;
		height = 600;
		windowName = 'default_window';
		
		// Property Window
		if ($(this).hasClass('property')) {
			width = 680;
			height = 533;
			windowName = 'property_indow';
		}
		
		if ($(this).hasClass('epc')) {
			width = 700;
			height = 490;
			windowName = 'property_epc';
		}
				
		// Open the window
		show_window($(this).attr('href'), windowName, width, height);
		
		// Prevent the anchor from moving to target page
		return false;
		
	});
	
	
	
	
});


$(document).ready(function() {
		
	$('#opening_house_link').hide();
	$('#opening_house_link').after('<embed id="flash_opening" width="190" height="320" allowscriptaccess="sameDomain" wmode="transparent" quality="high" bgcolor="#FFFFFF" name="flash_opening" src="/flash/opening.swf" type="application/x-shockwave-flash"/>');
	
	$('#opening_12_reasons_link').hide();
	$('#opening_12_reasons_link').after('<embed id="flash_12_reasons" width="190" height="320" allowscriptaccess="sameDomain" wmode="transparent" quality="high" bgcolor="#FFFFFF" name="flash_opening" src="/flash/12reasons.swf" type="application/x-shockwave-flash"/>');
	
	$('#opening_building_plots').hide();
	$('#opening_building_plots').after('<embed id="flash_building_plots" width="190" height="320" allowscriptaccess="sameDomain" wmode="transparent" quality="high" bgcolor="#FFFFFF" name="flash_opening" src="/flash/building.swf" type="application/x-shockwave-flash"/>');
	
	$('#promo.home img').hide();
	$('#promo.home').html('<embed id="flash_promo" width="780" height="581" allowscriptaccess="sameDomain" quality="high" bgcolor="#FFFFFF" name="flash_promo" src="/flash/about_us.swf" type="application/x-shockwave-flash"/>');
	
	$('#promo.other img').hide();
	$('#promo.other').html('<embed id="flash_promo" width="780" height="285" allowscriptaccess="sameDomain" quality="high" bgcolor="#FFFFFF" name="flash_promo" src="/flash/area_shots.swf" type="application/x-shockwave-flash"/>');
	
	$('#promo.other_2 img').hide();
	$('#promo.other_2').html('<embed id="flash_promo" width="780" height="285" allowscriptaccess="sameDomain" quality="high" bgcolor="#FFFFFF" name="flash_promo" src="/flash/area_shots_2.swf" type="application/x-shockwave-flash"/>');
	
	$('#wanted_properties_footer a').hide();
	$('#wanted_properties_footer a').after('<embed id="flash_wanted_properties" width="738" height="225" wmode="transparent" allowscriptaccess="sameDomain" quality="high" bgcolor="#FFFFFF" name="flash_promo" src="/flash/wanted.swf" type="application/x-shockwave-flash"/>');

});

function opening_times() {
	$('#opening_house_link').click();
}

function open_12_reasons() {
	$('#opening_12_reasons_link').click();
}

function open_building_plots() {
	$('#opening_building_plots').click();
}

function wanted() {
	$('#open_wanted_properties_link').click();
}
