//this function is used for mouseovers 
function AddStringToFileName(file_object, string_to_add)
{
	last_dot   = file_object.src.lastIndexOf('.');
	file_ext   = file_object.src.slice(last_dot, file_object.src.length); // eg: .gif
	file_path  = file_object.src.slice(0, last_dot); // eg: /shared/custom/images/header
	string_len = string_to_add.length;
	
	//exit if the filename already contains the string to add
	if(file_path.slice(file_path.length - string_len, file_path.length) == string_to_add)
		return;
	
	//add the string to add to the src
	file_object.src = file_path + string_to_add + file_ext;
	
	
}

function RemoveStringFromFileName(file_object, string_to_remove)
{
	last_dot   = file_object.src.lastIndexOf('.');
	file_ext   = file_object.src.slice(last_dot, file_object.src.length); // eg: .gif
	file_path  = file_object.src.slice(0, last_dot); // eg: /shared/custom/images/header
	string_len = string_to_remove.length;
	
	//only remove the string if filename contains the string
	if(file_path.slice(file_path.length - string_len, file_path.length) == string_to_remove)
		file_object.src = file_path.slice(0, file_path.length - string_len) + file_ext;
}

function HideAllEmbedObjects()
{
	//alert('HideAllEmbedObjects()');
	var all_objects  = document.getElementsByTagName('object');
	var all_embedded = document.getElementsByTagName('embed');
	
	for (var i = 0; i < all_objects.length; i++)
		all_objects[i].style.visibility = 'hidden';
	for (var i = 0; i < all_embedded.length; i++)
		all_embedded[i].style.visibility = 'hidden';
	
}
	
function ShowAllEmbedObjects()
{
	//alert('HideAllEmbedObjects()');
	var all_objects  = document.getElementsByTagName('object');
	var all_embedded = document.getElementsByTagName('embed');
	
	for (var i = 0; i < all_objects.length; i++)
		all_objects[i].style.visibility = 'visible';
	for (var i = 0; i < all_embedded.length; i++)
		all_embedded[i].style.visibility = 'visible';	
}


function addMapHandler()
{
	$("#map_nha_poly").click(function(event)
		{
			event.preventDefault();
			$("#map_nha").css("opacity", 0);
			$("#map_nha").css("display", "block");
			$("#map_nha").animate({
					left:0,
					top:0,
					width:212,
					height:404,
					opacity:1
				}, 1000, function() {
					$("#map_hover").attr("usemap", "#imgmapnha");
					$("#map_noordholland").css("background-image", "url(/shared/images/custom/noordhollandnhahovers.png)");
					setTimeout("removeRealImage()", 1000);
				});

		});
}

function removeRealImage()
{
	$("#map_nha").remove();
}

function moveImageTo(iPosition, sTitle)
{
	if(typeof(sTitle) == "undefined") sTitle = "";
	$("#map_noordholland").css("background-position", "-"+iPosition+"px 0px");
	$("#nha_selected_place").html(sTitle);
}
