	function getPageSize() {
		var xScroll, yScroll;

		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}

		var windowWidth, windowHeight;
		if (self.innerHeight) {	// all except Explorer
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	

		pageHeight = (yScroll < windowHeight) ? windowHeight : yScroll;
		pageWidth = (xScroll < windowWidth) ? windowWidth : xScroll;

		arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
		return arrayPageSize;
	}
	
	function showStoreFinder()	{
		var arrayPageSize = getPageSize();
		var intDivisor;
		
		if($.browser.msie)	{
			intDivisor = 1002;
		} else	{
			intDivisor = 1016;
		}
	
		$('#overlay').css('height', arrayPageSize[1] + 'px');
		$('#overlay').css('display', 'block');
		
		$('#storefinder-window').css('top', '195px');
		$('#storefinder-window').css('left', Math.round(((arrayPageSize[0] - intDivisor) / 2)) + 'px');
		$('#storefinder-window').css('display', 'block');
		
		$('#storefinder-compact .list').css('visibility', 'hidden');
	}
	
	function hideStoreFinder()	{
		$('#overlay').css('display', 'none');
		$('#storefinder-window').css('display', 'none');

		$('#storefinder-compact .list').css('visibility', 'visible');
	}

$(document).ready(function()	{
	$('#storefinderlink').click(function()	{
		showStoreFinder();
		return false;
	});
	
	$('#overlay').click(function()	{
		hideStoreFinder();
	});
	
	$('#storefinder-window .close img').click(function()	{
		hideStoreFinder();
	});
});
