

	

// do this lot on dom load
$(function()
{
	
	$('#loadPropertyImages').click(function()
	{
		document.getElementById('details_image').style.display = 'block';
		document.getElementById('mainmap').style.display = 'none';
		$('#details_image').load('details_image.php?property_id=' + $(this).attr('title') + '&folder=images');
		return false;
	});
	$('#loadPropertyImages2').click(function()
	{
		document.getElementById('details_image').style.display = 'block';
		document.getElementById('mainmap').style.display = 'none';
		$('#details_image').load('details_image.php?property_id=' + $(this).attr('title') + '&folder=images');
		return false;
	});
	$('#loadFloorplanImages').click(function()
	{
		document.getElementById('details_image').style.display = 'block';
		document.getElementById('mainmap').style.display = 'none';
		$('#details_image').load('details_image.php?property_id=' + $(this).attr('title') + '&folder=floorplans');
		return false;
	});
	
	$('#loadFloorplanImages2').click(function()
	{
		document.getElementById('details_image').style.display = 'block';
		document.getElementById('mainmap').style.display = 'none';
		$('#details_image').load('details_image.php?property_id=' + $(this).attr('title') + '&folder=floorplans');
		return false;
	});
	
	$('#loadGoogleMap').click(function()
	{
		showMap();
		return false;
	});
	
	$('#loadGoogleMap2').click(function()
	{
		showMap();
		return false;
	});
	
	$('#loadCertificate').click(function()
	{
		document.getElementById('details_image').style.display = 'block';
		document.getElementById('mainmap').style.display = 'none';
		var img = document.createElement('IMG');
		img.setAttribute('src','i/properties/' + $(this).attr('title') + '/epc/50.jpg');
		$('#details_image').html(img);
		
		return false;
	});
	$('#loadCertificate2').click(function()
	{
		document.getElementById('details_image').style.display = 'block';
		document.getElementById('mainmap').style.display = 'none';
		var img = document.createElement('IMG');
		img.setAttribute('src','i/properties/' + $(this).attr('title') + '/epc/50.jpg');
		$('#details_image').html(img);
		
		return false;
	});
	
	$('#frmSearch input').click(function()
	{
		
		$('#frmSearch').submit();
		
	});

	
	$('.listing_item:even').addClass('listing_item_left');
	$('.listing_item:odd').addClass('listing_item_right');
	
	if ( $.browser.msie )
	{
		if ( $.browser.version == '6.0' )
		{
			$('#listing').css('padding', '30px 0');
			$('.listing_item_right').css({'display':'inline', 'margin-left':'15px'});
			
			// fix shitty layout bugs in ie6
			$('#details_image').css('display', 'inline');
			
			$('.listing_item:even').addClass('listing_item_left').css('display','inline').css('margin','0 15px 15px 30px');
			$('.listing_item:odd').addClass('listing_item_right').css('display','inline').css('margin','0 30px 15px 15px');
			
			$('#listing').css('display','inline');
			
			var poo = document.createElement('IMG');
			poo.setAttribute('src', 'images/fade_strip.gif');
			poo.style.width = '100%';
			poo.style.height = '30px';
			$('#listing').prepend(poo);
			$('#listing h1').css('margin','0 20px 20px 20px');
			$('#listing p.indented').css('margin','20px');
		}
	}
	
	$('#display_tour').click(function()
	{
		$('#details_image').load('tour.php?id=' + $(this).attr('title'));
		return false;
	});
	
});

