browsed = false;

if (self.innerWidth)
{
	frameWidth = self.innerWidth;
	frameHeight = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientWidth)
{
	frameWidth = document.documentElement.clientWidth;
	frameHeight = document.documentElement.clientHeight;
}
else if (document.body)
{
	frameWidth = document.body.clientWidth;
	frameHeight = document.body.clientHeight;
}


if (frameHeight > 1000) {
	scroller = false;
} else {
	scroller = true;
}

function getLocation(id) {
	
	if (!browsed) {
		Effect.BlindDown('browselocation', {duration: 0.3 });
		setTimeout("fillLocation('"+id+"')", 300);
		
		browsed = true;
	} else if (browsed) {
		Effect.Fade('browselocation', {duration: 0.3, to: 0.01});
		setTimeout("fillLocation('"+id+"')", 200);
	}
	if (scroller) {
		if (navigator.appName == "Microsoft Internet Explorer") {
			setTimeout("new Effect.ScrollTo('browselocation');", 150);
		} else {
			new Effect.ScrollTo('browselocation');
		}
	}
	
}


function fillLocation(id) {
	
	data = "id="+id;
	
	remote_function('locations.browse', data, 
		function(req, json) {
			
			
			$('browselocation').innerHTML = req.responseText;
			

			Effect.Appear('browselocation', { duration: 0.3 });
			
			
		}, 

		function(req, json) {
			alert("Error: " + req.responseText);
		}
	);
}
