
function showRollover(title,map_img_id,property_name)
{
//alert('title= '+ title +' | map_img_id=' + map_img_id + '| property_name=' + property_name )
var map_image = getElement(map_img_id);

    var ret = false; // return false by default

    // Check if the map_images array has been defined in the loadRollovers() function in include
    // for the page with a map on it - eg. "nsw_map.js" or "north_coast_zone_map.js"
    if(map_image && typeof map_images == 'object' && typeof map_images[property_name] == 'object')
    {
  
        // Change the map img src to the rollover state
        //alert(typeof map_images[property_name])
        map_image.src = map_images[property_name].src;
       //alert(map_images[property_name].src);
        // Check which map it is and change the title above the list to the title passed to the
        // function - say on the image map
        if(map_img_id == 'area-map-img')
        {
            var title_h5 = getElement('area-title');
            }
        else
        {
            var title_h5 = getElement('zone-title');
         
        }

        if(title_h5)
        {
            // Set the inner HTML of the title <h5> under the map to the rollover
            title_h5.innerHTML = title;
        }

        ret = true;
    }
    
    return ret;
    
}


function hideRollover(map_img_id)
{
    var map_image = getElement(map_img_id);

    var ret = false; // return false by default

    // Check if the map_images array has been defined in the loadRollovers() function in include
    // for the page with a map on it - eg. "nsw_map.js" or "zone_map.js" whis is a placeholder for an actual
	// zone level js file like "north_coast_zone_map.js" for example
    if(map_image && typeof map_images == 'object')
    //if(map_image)
    {
	    // The '0' element is the images/clear_shim.gif which effectively turns off the
		// rollover by revealing the background image of the containing div (set inline in the
		// HTML of the page).
		// NOTE: The reason we're using '0' as the property name is that it was an array at one stage
        map_image.src = map_images['0'].src;
		//alert( map_images['0'].src);
        if(map_img_id == 'area-map-img')
        {
            var title_h5 = getElement('area-title');
            if(title_h5)
            {
			    // Set the inner HTML of the area title <h5> to the default for this page 
                title_h5.innerHTML = area_title_global; // "area_title_global" is defined in *_map.js - eg zone_map.js
            }
        }
        else
        {
            var title_h5 = getElement('zone-title');
            if(title_h5)
            {
                // Set the inner HTML of the zone title <h5> to the default for this page 
                title_h5.innerHTML = zone_title_global; // "zone_title_global" is defined in *_map.js - eg zone_map.js
            }
        }

    }
}

function DisplayTownName (TownName) 
{
getElement('area-title').innerHTML = TownName;
}

function HideTownName () 
{ 
getElement('area-title').innerHTML = area_title_global;
}

var ActvMap_img_id
var ActvHighlight_id
var TimeOutID 

function showHighlight(zone_title,map_img_id,highlight_id, property_name)
{

if (ActvHighlight_id != highlight_id){
	hideHighlightNow(ActvMap_img_id,ActvHighlight_id);
	
}

ActvMap_img_id = map_img_id
ActvHighlight_id = highlight_id
window.clearTimeout(TimeOutID)
    showElement(highlight_id);    
 //Effect.SlideDown(highlight_id); - for iff we want to use the Scriptaculous slide. Was too slow
 //alert('zone_title:'+zone_title +' map_img_id:'+ map_img_id +' property_name:'+property_name)
 //alert('zone_title:'+zone_title);
 //alert('map_img_id:'+ map_img_id);
 //alert('property_name:'+property_name);
showRollover(zone_title,map_img_id,property_name);
}


function hideHighlight(map_img_id,highlight_id)
{
  //Mark: we dont need to turn off highlight, always keep the last one   
  //TimeOutID =( window.setTimeout('hideHighlightNow("'+map_img_id+'","'+highlight_id+'")',5000));
}


function hideHighlightNow(map_img_id,highlight_id)
{
    hideElement(highlight_id);
    hideRollover(map_img_id)
}


var image_counter = 1;
/*
function checkMapLoad(this_map_images)
{

	image_counter = image_counter + 1;

    //var map_image = getElement(map_img_id);
    //var map_image_div = getElement(map_img_div_id);
    var map_image_div = getElement('maps-div');

	ret = false;

	if(image_counter == this_map_images.length)
	{
        //map_image.src = map_images['0'].src;
        //map_image_div.style.display = 'block';
        map_image_div.style.visibility = 'visible';

	    ret = true;
	}

	return ret;

}
*/

//TNSW | Mark : the below 2 functions are used for the sydney zone Maps  
function showSydneyMainMap(){
document.getElementById('zone-map-div').style.display="block"
document.getElementById('sydney-greater-map-div').style.display="none"
document.getElementById('sydney-inner-map-div').style.display="none"
}

function showSydneyInnerMap(){
document.getElementById('zone-map-div').style.display="none"
document.getElementById('sydney-greater-map-div').style.display="none"
document.getElementById('sydney-inner-map-div').style.display="block"
}

function showSydneyGreaterMap(){
document.getElementById('zone-map-div').style.display="none"
document.getElementById('sydney-greater-map-div').style.display="block"
document.getElementById('sydney-inner-map-div').style.display="none"
}



