/*
	Author: NetConstruct, Alastair Hodgson
*/

$('html').removeClass('no-js');

$('#slideBanner').cycle({
	timeout:	7000	
});

$('#homeSlider .slideWrap').after('<ul class="noBullet clearfix"></ul>').cycle({
	timeout: 	0,
	fx: 		'fade',
	pager: 		'#homeSlider ul',
	pagerAnchorBuilder: function(idx, slide) {
		return '<li class="' + jQuery(slide).attr("class").split(' ')[1] + '"><a href="#">.' + (jQuery(slide).index() + 1) + '</a></li>';
	}
});


// Interactive Map hotspots reveal info blocks
$('#mapTop .block').hide();
$("#mapTop .imgWrap .region").mouseenter(function () {
    clearTimeout($(this).data('timeoutId'));
    $('#mapTop .block').fadeOut('fast');
    $(this).find(".block").fadeIn("Fast");
}).mouseleave(function () {
    var someElement = this;
    var timeoutId = setTimeout(function () { $(someElement).find(".block").fadeOut("fast"); }, 300);
    $(someElement).data('timeoutId', timeoutId); //set the timeoutId, allowing us to clear this trigger if the mouse comes back over
});
