

function setUpRegion(region, w, h){
	speed = 300;

	$("#map_" + region).bind('mouseover', function () {

			$("#hover_" + region).animate({
				width: w,
				height: h
			},{
				queue: false,
				duration: 1
			}).animate({
				opacity: 1
			},{
				queue: false,
				duration: speed
			});

	});

	$("#map_" + region).bind('mouseout', function () {

			$("#hover_" + region).animate({
				opacity: 0
			},{
				queue: false,
				duration: speed
			});
			$("#hover_" + region).animate({
				width: 0,
				height: 0
			},{
				queue: false,
				duration: 1
			});

	});

	$("#hover_" + region).bind('mouseover', function () {

			$("#hover_" + region).animate({
				width: w,
				height: h
			},{
				queue: false,
				duration: 1
			}).animate({
				opacity: 1
			},{
				queue: false,
				duration: speed
			});

	});

	$("#hover_" + region).bind('mouseout', function () {

			$("#hover_" + region).animate({
				opacity: 0
			},{
				queue: false,
				duration: speed
			});
			$("#hover_" + region).animate({
				width: 0,
				height: 0
			},{
				queue: false,
				duration: 1
			});

	});
	
	$("#hover_" + region).bind("click", function(e) {
		$(".location_selector_box").hide();
		$("#location_selector_box_for_" + region).fadeIn(1000);
		
		return false;
	});
}

$(function() {
	setUpRegion("africa", '169px', '178px');
	setUpRegion("asia", '333px', '318px');
	setUpRegion("australia", '145px', '148px');
	setUpRegion("europe", '179px', '180px');
	setUpRegion("north_america", '335px', '282px');
	setUpRegion("south_america", '135px', '185px');
	
	$("#select_location_submit").remove();
});
