var speed = 10;
var icon = '';
function show_map( filter_icon )
{
	if( typeof filter_icon != "undefined" )
	{
		icon = filter_icon;
	}
	
	var overlay = document.createElement('DIV');
	overlay.id = 'overlay';
	
	var div = document.createElement('DIV');
	div.id = 'map_container';
	div.style.height = '50px';
	div.style.width = '0px';
	
	var map_location = document.createElement('DIV');
	map_location.id = 'map_location';
	
	div.appendChild(map_location);

	document.body.appendChild(overlay);
	document.body.appendChild(div);
	
	setTimeout(update_width, speed);
}
function update_width()
{
	var div = document.getElementById('map_container');
	var width = parseInt(div.style.width.substring(0,div.style.width.indexOf('px')));
	
	div.style.width = ( width + 20 ) + 'px';
	div.style.marginLeft = '-' + ( ( width + 10 ) / 2 ) + 'px';
	speed += 0.05;
	
	if( width <= 915 )
	{
		setTimeout(update_width, speed);
	} else {
		div.style.width = '930px';
		div.style.marginLeft = '-465px';
		speed = 10;
		setTimeout(update_height, 250);
	}
}
function update_height()
{
	var div = document.getElementById('map_container');
	var height = parseInt(div.style.height.substring(0,div.style.height.indexOf('px')));
	
	div.style.height = ( height + 20 ) + 'px';
	speed += 0.05;
	
	if( height <= 630 )
	{
		setTimeout(update_height, speed);
	} else {
		div.style.height = '660px';
		
		if( icon != '' )
			var so = new SWFObject('/images/upload/map.swf?icon=' + icon, 'uploader', '900', '600', '9');
		else
			var so = new SWFObject('/images/upload/map.swf', 'uploader', '900', '600', '9');
		so.setAttribute("id","map");
		so.write('map_location');
		
		document.getElementById('map_location').innerHTML += '<div align="right" style="padding-top: 10px;"><a href="javascript: hide_map()" style="color: #666666">x sluiten</a></div>';
	}
}
function hide_map()
{
	var overlay = document.getElementById('overlay');
	var map_container = document.getElementById('map_container');
	
	document.body.removeChild(overlay);
	document.body.removeChild(map_container);
}
