
// 
// Image map rollover goodness
// 


//var WA="wa";

//var NT="nt";

var SA="sa";

//var QLD="qld";

var NSW="nsw";

var VIC="vic";

//var TAS="tas";

var mapImage;
var loaded = new Array();
var timerID;
var loadCount = 0;
var imgObject = new Array();
var states =4;   
function init(states) {
  
  
  mapImage = document.getElementById("mapImage");
  for(i=1;i<states;i++) {
    imgObject[i] = new Image();
    imgObject[i].src="../img/map/" + i + ".gif";
    loaded[i] = false;
  }
  
  checkLoaded();
  
}

function checkLoaded() {
    if (loadCount == states) { 
    //alert("all loaded guv!");
        clearTimeout(timerID);
        new Effect.Fade('map-preload');
        new Effect.Appear('contact-map');
        return
    }
    
    for (i=1;i<16;i++) {
        if (loaded[i] == false && imgObject[i].complete) {
            loaded[i] = true;
            loadCount++;
        }
    }
    timerID = setTimeout("checkLoaded()",10) 
}

window.onload=init;

function imageOver(x) {
  mapImage.src="../img/map/" + x + ".gif";
}

function imageOut() {
  mapImage.src="../img/map/map.gif";
}




