$(document).ready(function(){
	// SET IMAGE CYCLER
	$('.cycle').cycle({fx:'fade', speed:2500});
	// SET IMAGEMAP STUFF
	$('map#imagemap area').mouseover(function(e){
		$("div#utility").css('display', 'block').css('opacity', '.85').html($(this).attr('alt').replace(/ \/ /g, '<br />') + '<br /><small>Click for more info &rarr;<\/small>');
		if ($(this).attr('class') == "lotissold") {
			$("div#utility").css('background', '#990000');
		}
	}).mouseout(function(){
		$("div#utility").css('display', 'none').empty();
	});
	$('map#imagemap').mouseout(function(){
		$("div#utility").css('display', 'none');
	});
	
	$('.sf-menu').superfish({
        animation: {height:'show', opacity:'show'},
        speed: 250,
        autoArrows: false,
        dropShadows: false
    });
	
	// LISTEN TO MOUSE MOVEMENT
	if ($('map').length) {
		$(document).mousemove(function(e){
			$("div#utility").css({top: e.pageY + "px", left: e.pageX+5 + "px"});
		});
	}

	
	$("body.newsawards #content h2").each(function() {
		text = $(this).text();
		
		var da = new Date();
		
		if (/\d{4}/.test(text) && text != da.getFullYear()) {
			$(this).addClass("expand");
			$(this).nextAll("div").eq(0).hide();
		}
	});
	
	$(".expand").live('click', function() {
		$(this).toggleClass("open");
		next = $(this).nextAll("div").eq(0);
		
		if ($(this).hasClass("open")) {
			next.show();
		} else {
			next.hide();
		}
	});
	
	
	
});
