/*	
 	Functions specifically for Ulendo Collection's homepage
 	-------------------------------------------------------
*/

		// this is called by the featured image's onload action
		function fade_in_featured_image() {
			window.setTimeout('fade("featured_image", "in", 500)', 101);
		}
		
		// let's swap the featured image.  First check that the image has indeed been changed
		var current_fn = '';
		function swap_featured_image(fn) {
			if (current_fn !== fn) {
				current_fn = fn;
				fade("featured_image", "out", 100);
				window.setTimeout("document.getElementById('featured_image').src = '" + fn + "'", 100);
			}
		}

		function map_select(el) {
			// restore previous highlighted element to normal state
			document.getElementById("dot_"+dot_selected).className = 'dot';
			document.getElementById("prop_"+dot_selected).className = 'prop';
			dot_selected = el;
			
			// highlight new element
			document.getElementById("dot_"+el).className = 'dotgrn';
			document.getElementById("prop_"+el).className = 'propgrn'
			
			// preview window
			swap_featured_image("photos/cms/property/" + map_ids[el] + "/map_thumb.jpg");
			document.getElementById("featured_title").innerHTML = map_titles[el];
			document.getElementById("featured_location").innerHTML = map_locations[el];
			
			current_map_select = el;
		}
		var current_map_select = 0;
		
		function featured_image_clicker() {
			window.location.href = map_urls[current_map_select];
		}
		
		function window_loaded() {
			map_select(0);
		}
		window.onload = function() { window_loaded(); }
