	



	function initiateMap(dotlist, macroFilters){
		/* Set an empty jquery object to add filters too */
		activeFilters = $([]);
		
		//Sets Default active state on the filters
	    $('#checkbox-filters input').attr('checked', true);
		$('#checkbox-filters label').addClass('active');

		
		i=0;
		$(dotlist).each(function(){
								
				/* Map of data to be associated with each dot */
				facilitydata = new Object();
				
				facilitydata.city = $(this).find('city').text();
				facilitydata.text = $(this).find('text').text();
				facilitydata.region = $(this).find('region').text();
				facilitydata.vertical = parseInt($(this).find('vCord').text());
				facilitydata.horizontal = parseInt($(this).find('hCord').text());
				facilitydata.visible = true;
				
				/* Make sure the dot doesnt exceed the size of the image */
				if(facilitydata.horizontal > 507){
					facilitydata.horizontal = 507;
				}
				if(facilitydata.vertical > 213){
					facilitydata.vertical = 213;
				}
				
				/* Make a seperate map for the position data */
				position  = new Object();
				
				position.left = facilitydata.horizontal;
				position.top = facilitydata.vertical;
				
				

				/* Create The dot */
				$('#dots-layer').append('<li class="dot" id="dot'+i+'"><a href="" ></a></li>');
				thisdot = $('#dot'+i);
				$(thisdot).css(position).data(facilitydata);
			
		
		i++;
		});
		
		/* A global version of all dots generated initally */
		alldots = $('#dots-layer li');
		
		
		
		
		$(alldots).click(function(){
			return false;
		});
		
		
		/* Code for the Label fade in and out */
		$(alldots).hover(function(){
		
			$(this).addClass('active').prepend('<div class="label"><div class="arrow"></div><p><strong>'+$(this).data('city')+'</strong><br />'+$(this).data('text')+'</p></div>');
			var horizontalPosition = ((($(this).find('.label').width()/2)-5)*-1);
			
						/* Add the width to the arrow box IE 7 fix */
			$(this).find('.label .arrow').width($(this).find('.label').width());
			
			$(this).find('.label').css('left', horizontalPosition);
			$(this).find('.label').fadeIn();
		}, function(){
		$(alldots).removeClass('active');					
			$(this).find('.label').fadeOut(100, function(){
				$(this).remove();
			});									
		});	
	};	



function highlight(filterType, value){
	allDots = $('#dots-layer li');
	allDots.each(function(){
		if($(this).data(filterType) == value){
			$(this).addClass('active');
		}
	});
}
function unHighlight(){
	allDots.removeClass('active')
	
}




	
		
	

 

