
if (typeof jQuery != 'undefined') {

    jQuery(document).ready(function () {
        /*Preload region rollovers*/
        preloadImages('/media/map/small/' + 'co' + '.gif', '/media/map/small/' + 'de' + '.gif', '/media/map/small/' + 'so' + '.gif', '/media/map/small/' + 'do' + '.gif', '/media/map/small/' + 'none' + '.gif', '/media/map/small/' + 'west' + '.gif');

        /*Add rollover effects for regions*/
        jQuery(".regionText, .highlightRegion").mouseover(function () {
            var regionCode = jQuery(this).attr('id').replace('regionText_', '').replace('mapRegion_', '');
            jQuery("#wcmap").attr('src', '/media/map/small/' + regionCode + '.gif');
        }).mouseout(function () {
            var regionCode = jQuery(this).attr('id').replace('regionText_', '').replace('mapRegion_', '');
            jQuery("#wcmap").attr('src', '/media/map/small/none.gif');
        });

        /*Add rollover effects for towns*/
        jQuery("ul#homeTowns > li > a").mouseover(function () {
            var mapPointLT = jQuery(this).attr('data-mapPoint').split(',');
            var left = mapPointLT[0];
            var top = mapPointLT[1];
            var townPoint = document.getElementById('townPoint');
            if (left == 0 && top == 0) {
                townPoint.style.display = 'none';
            } else {
                townPoint.style.left = left + 'px'; ;
                townPoint.style.top = top + 'px';
                townPoint.style.display = 'block';
            }
        });
       
    });
}

