// JavaScript Document
$(document).ready(function() {
	$("a.request_call_back").fancybox({
		'autoScale' : false,
		'width'     : 766,
		'height'    : 430,
		'type'      : 'iframe'
	});
	
	$("a.freevaluation").fancybox({
		'autoScale' : false,
		'width'     : 766,
		'height'    : 560,
		'type'      : 'iframe'
	});
	
	$("a.loginaccount").fancybox({
		'autoScale' : false,
		'width'     : 426,
		'height'    : 341,
		'type'      : 'iframe'
	});
	
	$("a.feedback").fancybox({
		'autoScale' : false,
		'width'     : 500,
		'height'    : 460,
		'type'      : 'iframe'
	});
	
	$("a.showvideobox").attr('rel','videbox').fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'showNavArrows' : false,
			'width'		: 680,
			'height'		: 495,
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
		
	$('.ppy1').popeye();
	
});

function openloginbox()
{
	$.fancybox({
		'autoScale' : false,
		'width'     : 426,
		'height'    : 341,
		'type'      : 'iframe',
		'href'      : 'sign-in.php'
	});
}

function showNexPrevPage(page)
{
	$('#page').val(page);
	document.ukbuysearch.submit();
}

function submitsearchforms()
{
	$('#page').val(1);
	return true;
}

function openfloorplan(href)
{
	$.fancybox({
		'autoScale' : false,
		'width'     : 900,
		'height'    : 600,
		'type'      : 'iframe',
		'href'      : href
	});
}

function openGoogleMapSearch(query,postcode)
{
	$.fancybox({
		'autoScale' : false,
		'width'     : 1000,
		'height'    : 700,
		'type'      : 'iframe',
		'href'      : 'http://local.google.co.uk/local?f=l&hl=en&q='+query+'&om=1&near='+postcode
	});
}
