// JavaScript Document for map selection of sites climate-averages
//Version V1.0.0.0
var sizeOfViewWidth=550;
var sizeOfViewHeight=353;
var codeIs=0;
var mapIs="";
var typeIs="";
var viewPortFlag=1;
var navOptionsWidth=184;
var xOffset=0;
var loadToggle=0;
var savePoint;
var savePointCheck;
var repeatCheckFlag=0;
var nSLA_AUS_Size=0;
var nSLA_DWO_AUS_Size=0;
var nSLA_NSW_Size=0;
var nSLA_DWO_NSW_Size=0;
var nSLA_Sydney_Size=0;
var nSLA_DWO_Sydney_Size=0;
var nSLA_VIC_Size=0;
var nSLA_DWO_VIC_Size=0;
var nSLA_Melbourne_Size=0;
var nSLA_DWO_Melbourne_Size=0;
var nSLA_QLD_Size=0;
var nSLA_DWO_QLD_Size=0;
var nSLA_Brisbane_Size=0;
var nSLA_DWO_Brisbane_Size=0;
var nSLA_WA_Size=0;
var nSLA_DWO_WA_Size=0;
var nSLA_Perth_Size=0;
var nSLA_DWO_Perth_Size=0;
var nSLA_SA_Size=0;
var nSLA_DWO_SA_Size=0;
var nSLA_Adelaide_Size=0;
var nSLA_DWO_Adelaide_Size=0;
var nSLA_TAS_Size=0;
var nSLA_DWO_TAS_Size=0;
var nSLA_NT_Size=0;
var nSLA_DWO_NT_Size=0;
var nSLA_ANT_Size=0;
var nSLA_DWO_ANT_Size=0;
var nSLA_ISL_Size=0;
var nSLA_DWO_ISL_Size=0;
var nSLA_Hobart_Size=0;
var nSLA_DWO_Hobart_Size=0;
var nSLA_Darwin_Size=0;
var nSLA_DWO_Darwin_Size=0;
var doneReEntrantCodeOnce=0;
var rememberFlag=0;
var topoGraphy=0;
var urlCodeStr='';
var urlMapTypeStr='';
var savedUrlCodeStr='';
var savedUrlMapTypeStr='';
var rNum;

function getRandomNumber(numMax){
	return Math.random(numMax);
}


function nML(index,
             names_map,names_map_height,names_map_width,
			 normal_map,normal_map_width,normal_map_height,
			 normal_map_small,normal_map_small_width,normal_map_small_height,
			 topo_map,topo_map_width,topo_map_height,
			 topo_map_small,topo_map_small_width,topo_map_small_height,
			 rain_map,rain_map_width,rain_map_height,
			 rain_map_small,rain_map_small_width,rain_map_small_height,			 
			 start_coordx,start_coordy){
	this.index=index;
	this.names_map=names_map;
	this.names_map_width=names_map_width;	
	this.names_map_height=names_map_height;
	this.normal_map=normal_map;
	this.normal_map_width=normal_map_width;
	this.normal_map_height=normal_map_height;	
	this.normal_map_small=normal_map_small;
	this.normal_map_small_width=normal_map_small_width;
	this.normal_map_small_height=normal_map_small_height;	
	this.topo_map=topo_map;
	this.topo_map_width=topo_map_width;	
	this.topo_map_height=topo_map_height;
	this.topo_map_small=topo_map_small;
	this.topo_map_small_width=topo_map_small_width;		
	this.topo_map_small_height=topo_map_small_height;
	this.rain_map=rain_map;	
	this.rain_map_width=rain_map_width;	
	this.rain_map_height=rain_map_height;
	this.rain_map_small=rain_map_small;
	this.rain_map_small_width=rain_map_small_width;		
	this.rain_map_small_height=rain_map_small_height;	
	this.start_coordx=start_coordx;
	this.start_coordy=start_coordy;
}

var nDML_IMGS=new Array(17);
nDML_IMGS[0]=new nML("0","dml0n.png",530,330,"dml0.png",530,330,"dms0.png",161,100,"dml0t.png",530,330,"dms0t.png",161,100,"dml0r.png",530,330,"dms0r.png",161,100,0,0);
nDML_IMGS[1]=new nML("1","dml1n.png",1378,1110,"dml1.png",1378,1110,"dms1.png",124,100,"dml1t.png",1378,1110,"dms1t.png",124,100,"dml1r.png",1378,1110,"dms1r.png",124,100,847,500);
nDML_IMGS[2]=new nML("2","dml2n.png",530,330,"dml2.png",530,330,"dms2.png",161,100,"dml2t.png",530,330,"dms2t.png",161,100,"dml2r.png",530,330,"dms2r.png",161,100,0,0);
nDML_IMGS[3]=new nML("3","dml3n.png",1209,836,"dml3.png",1209,836,"dms3.png",145,100,"dml3t.png",1209,836,"dms3t.png",145,100,"dml3r.png",1209,836,"dms3r.png",145,100,313,460);
nDML_IMGS[4]=new nML("4","dml4n.png",530,330,"dml4.png",530,330,"dms4.png",161,100,"dml4t.png",530,330,"dms4t.png",161,100,"dml4r.png",530,330,"dms4r.png",161,100,0,0);
nDML_IMGS[5]=new nML("5","dml5n.png",1064,1227,"dml5.png",1064,1227,"dms5.png",87,100,"dml5t.png",1064,1227,"dms5t.png",87,100,"dml5r.png",1064,1227,"dms5r.png",87,100,533,892);
nDML_IMGS[6]=new nML("6","dml6n.png",530,330,"dml6.png",530,330,"dms6.png",161,100,"dml6t.png",530,330,"dms6t.png",161,100,"dml6r.png",530,330,"dms6r.png",161,100,0,0);
nDML_IMGS[7]=new nML("7","dml7n.png",857,1110,"dml7.png",857,1110,"dms7.png",77,100,"dml7t.png",857,1110,"dms7t.png",77,100,"dml7r.png",857,1110,"dms7r.png",77,100,0,744);
nDML_IMGS[8]=new nML("8","dml8n.png",530,330,"dml8.png",530,330,"dms8.png",161,100,"dml8t.png",530,330,"dms8t.png",161,100,"dml8r.png",530,330,"dms8r.png",161,100,0,0);
nDML_IMGS[9]=new nML("9","dml9n.png",927,1089,"dml9.png",927,1089,"dms9.png",85,100,"dml9t.png",927,1089,"dms9t.png",85,100,"dml9r.png",927,1089,"dms9r.png",85,100,396,566);
nDML_IMGS[10]=new nML("10","dml10n.png",530,330,"dml10.png",530,330,"dms10.png",161,100,"dml10t.png",530,330,"dms10t.png",161,100,"dml10r.png",530,330,"dms10r.png",161,100,0,0);
nDML_IMGS[11]=new nML("11","dml11n.png",892,879,"dml11.png",892,879,"dms11.png",101,100,"dml11t.png",892,879,"dms11t.png",101,100,"dml11r.png",892,879,"dms11r.png",101,100,361,544);
nDML_IMGS[12]=new nML("12","dml12n.png",776,1064,"dml12.png",776,1064,"dms12.png",73,100,"dml12t.png",776,1064,"dms12t.png",73,100,"dml12r.png",776,1064,"dms12r.png",73,100,0,0);
nDML_IMGS[13]=new nML("13","dml13n.png",530,330,"dml13.png",530,330,"dms13.png",161,100,"dml13t.png",530,330,"dms13t.png",161,100,"dml13r.png",530,330,"dms13r.png",161,100,0,0);
nDML_IMGS[14]=new nML("14","dml14n.png",530,330,"dml14.png",530,330,"dms14.png",161,100,"dml14t.png",530,330,"dms14t.png",161,100,"dml14r.png",530,330,"dms14r.png",161,100,0,0);
nDML_IMGS[15]=new nML("15","dml15n.png",530,330,"dml15.png",530,330,"dms15.png",161,100,"dml15t.png",530,330,"dms15t.png",161,100,"dml15r.png",530,330,"dms15r.png",161,100,0,0);
nDML_IMGS[16]=new nML("16","dml16n.png",530,330,"dml16.png",530,330,"dms16.png",161,100,"dml16t.png",530,330,"dms16t.png",161,100,"dml16r.png",530,330,"dms16r.png",161,100,0,0);

nDML_IMGS_size=17;

var nCML_IMGS=new Array(17);

nCML_IMGS[0]=new nML("0","ml0n.png",530,330,"ml0.png",530,330,"ms0.png",161,100,"ml0t.png",530,330,"ms0t.png",161,100,"ml0r.png",530,330,"ms0r.png",161,100,0,0);
nCML_IMGS[1]=new nML("1","ml1n.png",1516,1221,"ml1.png",1516,1221,"ms1.png",124,100,"ml1t.png",1516,1221,"ms1t.png",124,100,"ml1r.png",1516,1221,"ms1r.png",124,100,985,586);
nCML_IMGS[2]=new nML("2","ml2n.png",530,330,"ml2.png",530,330,"ms2.png",161,100,"ml2t.png",530,330,"ms2t.png",161,100,"ml2r.png",530,330,"ms2r.png",161,100,0,0);
nCML_IMGS[3]=new nML("3","ml3n.png",1463,1012,"ml3.png",1463,1012,"ms3.png",145,100,"ml3t.png",1463,1012,"ms3t.png",145,100,"ml3r.png",1463,1012,"ms3r.png",145,100,439,577);
nCML_IMGS[4]=new nML("4","ml4n.png",530,330,"ml4.png",530,330,"ms4.png",161,100,"ml4t.png",530,330,"ms4t.png",161,100,"ml4r.png",530,330,"ms4r.png",161,100,0,0);
nCML_IMGS[5]=new nML("5","ml5n.png",1817,2079,"ml5.png",1817,2079,"ms5.png",87,100,"ml5t.png",1817,2079,"ms5t.png",87,100,"ml5r.png",1817,2079,"ms5r.png",87,100,1286,1642);
nCML_IMGS[6]=new nML("6","ml6n.png",530,330,"ml6.png",530,330,"ms6.png",161,100,"ml6t.png",530,330,"ms6t.png",161,100,"ml6r.png",530,330,"ms6r.png",161,100,0,0);
nCML_IMGS[7]=new nML("7","ml7n.png",1381,1788,"ml7.png",1381,1788,"ms7.png",77,100,"ml7t.png",1381,1788,"ms7t.png",77,100,"ml7r.png",1381,1788,"ms7r.png",77,100,0,1269);
nCML_IMGS[8]=new nML("8","ml8n.png",530,330,"ml8.png",530,330,"ms8.png",161,100,"ml8t.png",530,330,"ms8t.png",161,100,"ml8r.png",530,330,"ms8r.png",161,100,0,0);
nCML_IMGS[9]=new nML("9","ml9n.png",1122,1318,"ml9.png",1122,1318,"ms9.png",85,100,"ml9t.png",1122,1318,"ms9t.png",85,100,"ml9r.png",1122,1318,"ms9r.png",85,100,561,738);
nCML_IMGS[10]=new nML("10","ml10n.png",530,330,"ml10.png",530,330,"ms10.png",161,100,"ml10t.png",530,330,"ms10t.png",161,100,"ml10r.png",530,330,"ms10r.png",161,100,0,0);
nCML_IMGS[11]=new nML("11","ml11n.png",1306,1287,"ml11.png",1306,1287,"ms11.png",101,100,"ml11t.png",1306,1287,"ms11t.png",101,100,"ml11r.png",1306,1287,"ms11t.png",101,100,640,811);
nCML_IMGS[12]=new nML("12","ml12n.png",530,726,"ml12.png",530,726,"ms12.png",73,100,"ml12t.png",530,726,"ms12t.png",73,100,"ml12r.png",530,726,"ms12r.png",73,100,0,0);
nCML_IMGS[13]=new nML("13","ml13n.png",530,330,"ml13.png",530,330,"ms13.png",161,100,"ml13t.png",530,330,"ms13t.png",161,100,"ml13r.png",530,330,"ms13r.png",161,100,0,0);
nCML_IMGS[14]=new nML("14","ml14n.png",530,330,"ml14.png",530,330,"ms14.png",161,100,"ml14t.png",530,330,"ms14t.png",161,100,"ml14r.png",530,330,"ms14r.png",161,100,0,0);
nCML_IMGS[15]=new nML("15","ml15n.png",530,330,"ml15.png",530,330,"ms15.png",161,100,"ml15t.png",530,330,"ms15t.png",161,100,"ml15r.png",530,330,"ms15r.png",161,100,0,0);
nCML_IMGS[16]=new nML("16","ml16n.png",530,330,"ml16.png",530,330,"ms16.png",161,100,"ml16t.png",530,330,"ms16t.png",161,100,"ml16r.png",530,330,"ms16r.png",161,100,0,0);

nCML_IMGS_size=17;

function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if (aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return strReturn;
}

function returnMapFromType(mapTypeForDisplay,codeHere2,typeIsHere2){
	if(typeIsHere2=='cdio'){
		if(mapTypeForDisplay=='rain_map'){
			return nCML_IMGS[codeHere2].rain_map;
		}	
		if(mapTypeForDisplay=='rain_map_small'){
			return nCML_IMGS[codeHere2].rain_map_small;
		}	
		if(mapTypeForDisplay=='topo_map'){
			return nCML_IMGS[codeHere2].topo_map;
		}	
		if(mapTypeForDisplay=='topo_map_small'){
			return nCML_IMGS[codeHere2].topo_map_small;
		}
		if(mapTypeForDisplay=='names_map'){
			return nCML_IMGS[codeHere2].names_map;
		}
		if(mapTypeForDisplay=='normal_map'){
			return nCML_IMGS[codeHere2].normal_map;
		}	
		if(mapTypeForDisplay=='normal_map_small'){
			return nCML_IMGS[codeHere2].normal_map_small;
		}
	}
	if(typeIsHere2=='dwo'){
		if(mapTypeForDisplay=='rain_map'){
			return nDML_IMGS[codeHere2].rain_map;
		}	
		if(mapTypeForDisplay=='rain_map_small'){
			return nDML_IMGS[codeHere2].rain_map_small;
		}	
		if(mapTypeForDisplay=='topo_map'){
			return nDML_IMGS[codeHere2].topo_map;
		}	
		if(mapTypeForDisplay=='topo_map_small'){
			return nDML_IMGS[codeHere2].topo_map_small;
		}
		if(mapTypeForDisplay=='names_map'){
			return nDML_IMGS[codeHere2].names_map;
		}
		if(mapTypeForDisplay=='normal_map'){
			return nDML_IMGS[codeHere2].normal_map;
		}	
		if(mapTypeForDisplay=='normal_map_small'){
			return nDML_IMGS[codeHere2].normal_map_small;
		}
	}
}

function returnMapSizeFromType(mapTypeForDisplay,codeHere2,typeIsHere2,whichMeasurement){
	if(typeIsHere2=='cdio'){
		if(mapTypeForDisplay=='rain_map'){
			if(whichMeasurement=='width'){
				return nCML_IMGS[codeHere2].rain_map_width;
			}
			if(whichMeasurement=='height'){
				return nCML_IMGS[codeHere2].rain_map_height;
			}
		}	
		if(mapTypeForDisplay=='rain_map_small'){
			if(whichMeasurement=='width'){
				return nCML_IMGS[codeHere2].rain_map_small_width;
			}
			if(whichMeasurement=='height'){
				return nCML_IMGS[codeHere2].rain_map_small_height;
			}
		}	
		if(mapTypeForDisplay=='topo_map'){
			if(whichMeasurement=='width'){
				return nCML_IMGS[codeHere2].topo_map_width;
			}
			if(whichMeasurement=='height'){
				return nCML_IMGS[codeHere2].topo_map_height;
			}
		}	
		if(mapTypeForDisplay=='topo_map_small'){
			if(whichMeasurement=='width'){
				return nCML_IMGS[codeHere2].topo_map_small_width;
			}
			if(whichMeasurement=='height'){
				return nCML_IMGS[codeHere2].topo_map_small_height;
			}
		}
		if(mapTypeForDisplay=='names_map'){
			if(whichMeasurement=='width'){
				return nCML_IMGS[codeHere2].names_map_width;
			}
			if(whichMeasurement=='height'){
				return nCML_IMGS[codeHere2].names_map_height;
			}
		}
		if(mapTypeForDisplay=='normal_map'){
			if(whichMeasurement=='width'){
				return nCML_IMGS[codeHere2].normal_map_width;
			}
			if(whichMeasurement=='height'){
				return nCML_IMGS[codeHere2].normal_map_height;
			}
		}	
		if(mapTypeForDisplay=='normal_map_small'){
			if(whichMeasurement=='width'){
				return nCML_IMGS[codeHere2].normal_map_small_width;
			}
			if(whichMeasurement=='height'){
				return nCML_IMGS[codeHere2].normal_map_small_height;
			}		
		}
	}
	if(typeIsHere2=='dwo'){
		if(mapTypeForDisplay=='rain_map'){
			if(whichMeasurement=='width'){
				return nDML_IMGS[codeHere2].rain_map_width;
			}
			if(whichMeasurement=='height'){
				return nDML_IMGS[codeHere2].rain_map_height;
			}
		}	
		if(mapTypeForDisplay=='rain_map_small'){
			if(whichMeasurement=='width'){
				return nDML_IMGS[codeHere2].rain_map_small_width;
			}
			if(whichMeasurement=='height'){
				return nDML_IMGS[codeHere2].rain_map_small_height;
			}
		}	
		if(mapTypeForDisplay=='topo_map'){
			if(whichMeasurement=='width'){
				return nDML_IMGS[codeHere2].topo_map_width;
			}
			if(whichMeasurement=='height'){
				return nDML_IMGS[codeHere2].topo_map_height;
			}
		}	
		if(mapTypeForDisplay=='topo_map_small'){
			if(whichMeasurement=='width'){
				return nDML_IMGS[codeHere2].topo_map_small_width;
			}
			if(whichMeasurement=='height'){
				return nDML_IMGS[codeHere2].topo_map_small_height;
			}
		}
		if(mapTypeForDisplay=='names_map'){
			if(whichMeasurement=='width'){
				return nDML_IMGS[codeHere2].names_map_width;
			}
			if(whichMeasurement=='height'){
				return nDML_IMGS[codeHere2].names_map_height;
			}
		}
		if(mapTypeForDisplay=='normal_map'){
			if(whichMeasurement=='width'){
				//alert("codeHere2="+codeHere2);
				return nDML_IMGS[codeHere2].normal_map_width;
			}
			if(whichMeasurement=='height'){
				return nDML_IMGS[codeHere2].normal_map_height;
			}
		}	
		if(mapTypeForDisplay=='normal_map_small'){
			if(whichMeasurement=='width'){
				return nDML_IMGS[codeHere2].normal_map_small_width;
			}
			if(whichMeasurement=='height'){
				return nDML_IMGS[codeHere2].normal_map_small_height;
			}
		}
	}
}

function getMap(codeHere,typeMapHere,typeSize,typeIsHere){
	if(typeMapHere=='R' && typeSize=='small'){
		return returnMapFromType('rain_map_small',codeHere,typeIsHere)
	}
	if(typeMapHere=='T' && typeSize=='small'){
		return returnMapFromType('topo_map_small',codeHere,typeIsHere)
	}
	if(typeMapHere=='P' && typeSize=='small'){
		return returnMapFromType('normal_map_small',codeHere,typeIsHere)
	}
	if(typeMapHere=='R' && typeSize=='normal'){
		return returnMapFromType('rain_map',codeHere,typeIsHere)
	}	
	if(typeMapHere=='T' && typeSize=='normal'){
		return returnMapFromType('topo_map',codeHere,typeIsHere)
	}
	if(typeMapHere=='P' && typeSize=='normal'){
		return returnMapFromType('normal_map',codeHere,typeIsHere)
	}	
	if(typeMapHere=='N' && typeSize=='normal'){
		return returnMapFromType('names_map',codeHere,typeIsHere)
	}	
}

function getOffsetOfMap(code,typeIs,whichCoord){
	if(typeIs=='dwo'){
		if(whichCoord=='x'){
			return nDML_IMGS[code].start_coordx;
		}
		if(whichCoord=='y'){
			return nDML_IMGS[code].start_coordy;
		}
	}
	if(typeIs=='cdio'){
		if(whichCoord=='x'){
			return nCML_IMGS[code].start_coordx;
		}
		if(whichCoord=='y'){
			return nCML_IMGS[code].start_coordy;
		}
	}

}
	
function getSizeOfMap(codeHere,typeMapHere,typeSize,typeIsHere,whichMeasurement){
	if(typeMapHere=='T' && typeSize=='small'){
		return returnMapSizeFromType('topo_map_small',codeHere,typeIsHere,whichMeasurement)
	}
	if(typeMapHere=='R' && typeSize=='small'){
		return returnMapSizeFromType('rain_map_small',codeHere,typeIsHere,whichMeasurement)
	}	
	if(typeMapHere=='P' && typeSize=='small'){
		return returnMapSizeFromType('normal_map_small',codeHere,typeIsHere,whichMeasurement)
	}
	if(typeMapHere=='T' && typeSize=='normal'){
		return returnMapSizeFromType('topo_map',codeHere,typeIsHere,whichMeasurement)
	}
	if(typeMapHere=='R' && typeSize=='normal'){
		return returnMapSizeFromType('rain_map',codeHere,typeIsHere,whichMeasurement)
	}	
	if(typeMapHere=='P' && typeSize=='normal'){
		return returnMapSizeFromType('normal_map',codeHere,typeIsHere,whichMeasurement)
	}	
	if(typeMapHere=='N' && typeSize=='normal'){
		return returnMapSizeFromType('names_map',codeHere,typeIsHere,whichMeasurement)
	}	
}
	
// Determine browser and version.
function Browser() {

  var ua, s, i;

  this.isIE    = false;
  this.isNS    = false;
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();	
	
// Global object to hold drag information.

var dragObj = new Object();
dragObj.zIndex = 0;	
	
function dragStart(event, id) {

  var el;
  var x, y;
  xOffset=((navOptionsWidth/2)-(getSizeOfMap(codeIs,mapIs,'small',typeIs,'width')/2));
	
  // If an element id was given, find it. Otherwise use the element being
  // clicked on.
  if (id)
    dragObj.elNode = document.getElementById(id);
  else {
    if (browser.isIE)
      dragObj.elNode = window.event.srcElement;
    if (browser.isNS)
      dragObj.elNode = event.target;

    // If this is a text node, use its parent element.

    if (dragObj.elNode.nodeType == 3)
      dragObj.elNode = dragObj.elNode.parentNode;
  }	
  
  // Get cursor position with respect to the page.

  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }  

  // Save starting positions of cursor and element.

  dragObj.cursorStartX = x;
  dragObj.cursorStartY = y;
  dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left , 10);
  dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);

  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;
  
  // Update element's z-index.

  dragObj.elNode.style.zIndex = ++dragObj.zIndex; 

  // Capture mousemove and mouseup events on the page.

  if (browser.isIE) {
    document.attachEvent("onmousemove", dragGo);
    document.attachEvent("onmouseup",   dragStop);
    window.event.cancelBubble = true;
    window.event.returnValue = false; 
  }
  if (browser.isNS) {
    document.addEventListener("mousemove", dragGo,   true);
    document.addEventListener("mouseup",   dragStop, true);
    event.preventDefault();
  }
	
}

function dragGo(event) {

  var x, y;
  var xSM,ySM;
  var divwidth,divheight;
  var code=codeIs;
  xOffset=((navOptionsWidth/2)-(getSizeOfMap(code,mapIs,'small',typeIs,'width')/2));
  
  // Get cursor position with respect to the page.
  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }
	
  // Move drag element by the same amount the cursor has moved.
  //Added xOffset due to image being centered in location box
  xtemp = (dragObj.elStartLeft + x - dragObj.cursorStartX); divwidth=parseInt(dragObj.elNode.style.width, 10)+2; 
  ytemp = (dragObj.elStartTop  + y - dragObj.cursorStartY); divheight=parseInt(dragObj.elNode.style.height, 10)+2;
  if (xtemp+divwidth>=getSizeOfMap(code,mapIs,'small',typeIs,'width')+xOffset) {xtemp=getSizeOfMap(code,mapIs,'small',typeIs,'width')-divwidth+xOffset};
  if (xtemp<xOffset) xtemp=xOffset; 
  dragObj.elNode.style.left = xtemp + "px";
  if (ytemp+divheight>=getSizeOfMap(code,mapIs,'small',typeIs,'height')) {ytemp=getSizeOfMap(code,mapIs,'small',typeIs,'height')-divheight}
  if (ytemp<0) ytemp=0;
  dragObj.elNode.style.top  = ytemp + "px";

  viewPortFlag=0;
  xSM=(dragObj.elStartLeft + x - dragObj.cursorStartX-xOffset); 
  ySM=(dragObj.elStartTop  + y - dragObj.cursorStartY);
  if(isNaN(xSM))xSM=0;
  if(isNaN(ySM))ySM=0;
  document.getElementById("maplayerl").scrollTop=(Math.round((ySM*getSizeOfMap(code,mapIs,'normal',typeIs,'height'))/getSizeOfMap(code,mapIs,'small',typeIs,'height'))); 
  document.getElementById("maplayerl").scrollLeft=Math.round((xSM*getSizeOfMap(code,mapIs,'normal',typeIs,'width'))/getSizeOfMap(code,mapIs,'small',typeIs,'width'));
  viewPortFlag=1;

 
  if (browser.isIE) {
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS)
    event.preventDefault();
	
}

function dragStop(event) {

  // Stop capturing mousemove and mouseup events.

  if (browser.isIE) {
    document.detachEvent("onmousemove", dragGo);
    document.detachEvent("onmouseup",   dragStop);
  }
  if (browser.isNS) {
    document.removeEventListener("mousemove", dragGo,   true);
    document.removeEventListener("mouseup",   dragStop, true);
  }
}

function updateTopoOption(){
	var code=codeIs;
	for(var a=0;a<17;a++){
		if(document.get_navmap.mapextent[a].checked==true){
			code=document.get_navmap.mapextent[a].value;
		}
	}
	topoGraphy=0;
	startup(code,0);
}	
	
function loadUseMap(sizeOfList){	
	var code=codeIs;
	for(var a=0;a<17;a++){
		if(document.get_navmap.mapextent[a].checked==true){
			code=document.get_navmap.mapextent[a].value;
		}
	}
    var sL;
	sL="<map name=\"m_map_"+rNum+"\">";
	for(a=0;a<sizeOfList;a++){
		if(code==0){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_AUS[a].top_left_x+","+nSLA_AUS[a].top_left_y+","+nSLA_AUS[a].bottom_right_x+","+nSLA_AUS[a].bottom_right_y+"\" href=\""+nSLA_AUS[a].URI+"\" alt=\""+nSLA_AUS[a].name+"\" title=\""+nSLA_AUS[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_AUS[a].top_left_x+","+nSLA_DWO_AUS[a].top_left_y+","+nSLA_DWO_AUS[a].bottom_right_x+","+nSLA_DWO_AUS[a].bottom_right_y+"\" href=\""+nSLA_DWO_AUS[a].URI+"\" alt=\""+nSLA_DWO_AUS[a].name+"\" title=\""+nSLA_DWO_AUS[a].name+"\" >";				
			}
		}
		if(code==1){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_NSW[a].top_left_x+","+nSLA_NSW[a].top_left_y+","+nSLA_NSW[a].bottom_right_x+","+nSLA_NSW[a].bottom_right_y+"\" href=\""+nSLA_NSW[a].URI+"\" alt=\""+nSLA_NSW[a].name+"\" title=\""+nSLA_NSW[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_NSW[a].top_left_x+","+nSLA_DWO_NSW[a].top_left_y+","+nSLA_DWO_NSW[a].bottom_right_x+","+nSLA_DWO_NSW[a].bottom_right_y+"\" href=\""+nSLA_DWO_NSW[a].URI+"\" alt=\""+nSLA_DWO_NSW[a].name+"\" title=\""+nSLA_DWO_NSW[a].name+"\" >";				
			}			
		}
		if(code==2){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_Sydney[a].top_left_x+","+nSLA_Sydney[a].top_left_y+","+nSLA_Sydney[a].bottom_right_x+","+nSLA_Sydney[a].bottom_right_y+"\" href=\""+nSLA_Sydney[a].URI+"\" alt=\""+nSLA_Sydney[a].name+"\" title=\""+nSLA_Sydney[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_Sydney[a].top_left_x+","+nSLA_DWO_Sydney[a].top_left_y+","+nSLA_DWO_Sydney[a].bottom_right_x+","+nSLA_DWO_Sydney[a].bottom_right_y+"\" href=\""+nSLA_DWO_Sydney[a].URI+"\" alt=\""+nSLA_DWO_Sydney[a].name+"\" title=\""+nSLA_DWO_Sydney[a].name+"\" >";				
			}			
		}
		if(code==3){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_VIC[a].top_left_x+","+nSLA_VIC[a].top_left_y+","+nSLA_VIC[a].bottom_right_x+","+nSLA_VIC[a].bottom_right_y+"\" href=\""+nSLA_VIC[a].URI+"\" alt=\""+nSLA_VIC[a].name+"\" title=\""+nSLA_VIC[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_VIC[a].top_left_x+","+nSLA_DWO_VIC[a].top_left_y+","+nSLA_DWO_VIC[a].bottom_right_x+","+nSLA_DWO_VIC[a].bottom_right_y+"\" href=\""+nSLA_DWO_VIC[a].URI+"\" alt=\""+nSLA_DWO_VIC[a].name+"\" title=\""+nSLA_DWO_VIC[a].name+"\" >";				
			}			
		}
		if(code==4){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_Melbourne[a].top_left_x+","+nSLA_Melbourne[a].top_left_y+","+nSLA_Melbourne[a].bottom_right_x+","+nSLA_Melbourne[a].bottom_right_y+"\" href=\""+nSLA_Melbourne[a].URI+"\" alt=\""+nSLA_Melbourne[a].name+"\" title=\""+nSLA_Melbourne[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_Melbourne[a].top_left_x+","+nSLA_DWO_Melbourne[a].top_left_y+","+nSLA_DWO_Melbourne[a].bottom_right_x+","+nSLA_DWO_Melbourne[a].bottom_right_y+"\" href=\""+nSLA_DWO_Melbourne[a].URI+"\" alt=\""+nSLA_DWO_Melbourne[a].name+"\" title=\""+nSLA_DWO_Melbourne[a].name+"\" >";				
			}			
		}	
		if(code==5){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_QLD[a].top_left_x+","+nSLA_QLD[a].top_left_y+","+nSLA_QLD[a].bottom_right_x+","+nSLA_QLD[a].bottom_right_y+"\" href=\""+nSLA_QLD[a].URI+"\" alt=\""+nSLA_QLD[a].name+"\" title=\""+nSLA_QLD[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_QLD[a].top_left_x+","+nSLA_DWO_QLD[a].top_left_y+","+nSLA_DWO_QLD[a].bottom_right_x+","+nSLA_DWO_QLD[a].bottom_right_y+"\" href=\""+nSLA_DWO_QLD[a].URI+"\" alt=\""+nSLA_DWO_QLD[a].name+"\" title=\""+nSLA_DWO_QLD[a].name+"\" >";				
			}		
		}
		if(code==6){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_Brisbane[a].top_left_x+","+nSLA_Brisbane[a].top_left_y+","+nSLA_Brisbane[a].bottom_right_x+","+nSLA_Brisbane[a].bottom_right_y+"\" href=\""+nSLA_Brisbane[a].URI+"\" alt=\""+nSLA_Brisbane[a].name+"\" title=\""+nSLA_Brisbane[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_Brisbane[a].top_left_x+","+nSLA_DWO_Brisbane[a].top_left_y+","+nSLA_DWO_Brisbane[a].bottom_right_x+","+nSLA_DWO_Brisbane[a].bottom_right_y+"\" href=\""+nSLA_DWO_Brisbane[a].URI+"\" alt=\""+nSLA_DWO_Brisbane[a].name+"\" title=\""+nSLA_DWO_Brisbane[a].name+"\" >";				
			}			
		}	
		if(code==7){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_WA[a].top_left_x+","+nSLA_WA[a].top_left_y+","+nSLA_WA[a].bottom_right_x+","+nSLA_WA[a].bottom_right_y+"\" href=\""+nSLA_WA[a].URI+"\" alt=\""+nSLA_WA[a].name+"\" title=\""+nSLA_WA[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_WA[a].top_left_x+","+nSLA_DWO_WA[a].top_left_y+","+nSLA_DWO_WA[a].bottom_right_x+","+nSLA_DWO_WA[a].bottom_right_y+"\" href=\""+nSLA_DWO_WA[a].URI+"\" alt=\""+nSLA_DWO_WA[a].name+"\" title=\""+nSLA_DWO_WA[a].name+"\" >";				
			}			
		}
		if(code==8){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_Perth[a].top_left_x+","+nSLA_Perth[a].top_left_y+","+nSLA_Perth[a].bottom_right_x+","+nSLA_Perth[a].bottom_right_y+"\" href=\""+nSLA_Perth[a].URI+"\" alt=\""+nSLA_Perth[a].name+"\" title=\""+nSLA_Perth[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_Perth[a].top_left_x+","+nSLA_DWO_Perth[a].top_left_y+","+nSLA_DWO_Perth[a].bottom_right_x+","+nSLA_DWO_Perth[a].bottom_right_y+"\" href=\""+nSLA_DWO_Perth[a].URI+"\" alt=\""+nSLA_DWO_Perth[a].name+"\" title=\""+nSLA_DWO_Perth[a].name+"\" >";				
			}			
		}
	    if(code==9){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_SA[a].top_left_x+","+nSLA_SA[a].top_left_y+","+nSLA_SA[a].bottom_right_x+","+nSLA_SA[a].bottom_right_y+"\" href=\""+nSLA_SA[a].URI+"\" alt=\""+nSLA_SA[a].name+"\" title=\""+nSLA_SA[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_SA[a].top_left_x+","+nSLA_DWO_SA[a].top_left_y+","+nSLA_DWO_SA[a].bottom_right_x+","+nSLA_DWO_SA[a].bottom_right_y+"\" href=\""+nSLA_DWO_SA[a].URI+"\" alt=\""+nSLA_DWO_SA[a].name+"\" title=\""+nSLA_DWO_SA[a].name+"\" >";				
			}			
		}
		if(code==10){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_Adelaide[a].top_left_x+","+nSLA_Adelaide[a].top_left_y+","+nSLA_Adelaide[a].bottom_right_x+","+nSLA_Adelaide[a].bottom_right_y+"\" href=\""+nSLA_Adelaide[a].URI+"\" alt=\""+nSLA_Adelaide[a].name+"\" title=\""+nSLA_Adelaide[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_Adelaide[a].top_left_x+","+nSLA_DWO_Adelaide[a].top_left_y+","+nSLA_DWO_Adelaide[a].bottom_right_x+","+nSLA_DWO_Adelaide[a].bottom_right_y+"\" href=\""+nSLA_DWO_Adelaide[a].URI+"\" alt=\""+nSLA_DWO_Adelaide[a].name+"\" title=\""+nSLA_DWO_Adelaide[a].name+"\" >";				
			}			
		}
	    if(code==11){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_TAS[a].top_left_x+","+nSLA_TAS[a].top_left_y+","+nSLA_TAS[a].bottom_right_x+","+nSLA_TAS[a].bottom_right_y+"\" href=\""+nSLA_TAS[a].URI+"\" alt=\""+nSLA_TAS[a].name+"\" title=\""+nSLA_TAS[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_TAS[a].top_left_x+","+nSLA_DWO_TAS[a].top_left_y+","+nSLA_DWO_TAS[a].bottom_right_x+","+nSLA_DWO_TAS[a].bottom_right_y+"\" href=\""+nSLA_DWO_TAS[a].URI+"\" alt=\""+nSLA_DWO_TAS[a].name+"\" title=\""+nSLA_DWO_TAS[a].name+"\" >";				
			}			
		}
		if(code==12){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_NT[a].top_left_x+","+nSLA_NT[a].top_left_y+","+nSLA_NT[a].bottom_right_x+","+nSLA_NT[a].bottom_right_y+"\" href=\""+nSLA_NT[a].URI+"\" alt=\""+nSLA_NT[a].name+"\" title=\""+nSLA_NT[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_NT[a].top_left_x+","+nSLA_DWO_NT[a].top_left_y+","+nSLA_DWO_NT[a].bottom_right_x+","+nSLA_DWO_NT[a].bottom_right_y+"\" href=\""+nSLA_DWO_NT[a].URI+"\" alt=\""+nSLA_DWO_NT[a].name+"\" title=\""+nSLA_DWO_NT[a].name+"\" >";				
			}			
		}
		if(code==13){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_ANT[a].top_left_x+","+nSLA_ANT[a].top_left_y+","+nSLA_ANT[a].bottom_right_x+","+nSLA_ANT[a].bottom_right_y+"\" href=\""+nSLA_ANT[a].URI+"\" alt=\""+nSLA_ANT[a].name+"\" title=\""+nSLA_ANT[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_ANT[a].top_left_x+","+nSLA_DWO_ANT[a].top_left_y+","+nSLA_DWO_ANT[a].bottom_right_x+","+nSLA_DWO_ANT[a].bottom_right_y+"\" href=\""+nSLA_DWO_ANT[a].URI+"\" alt=\""+nSLA_DWO_ANT[a].name+"\" title=\""+nSLA_DWO_ANT[a].name+"\" >";				
			}			
		}
		if(code==14){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_ISL[a].top_left_x+","+nSLA_ISL[a].top_left_y+","+nSLA_ISL[a].bottom_right_x+","+nSLA_ISL[a].bottom_right_y+"\" href=\""+nSLA_ISL[a].URI+"\" alt=\""+nSLA_ISL[a].name+"\" title=\""+nSLA_ISL[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_ISL[a].top_left_x+","+nSLA_DWO_ISL[a].top_left_y+","+nSLA_DWO_ISL[a].bottom_right_x+","+nSLA_DWO_ISL[a].bottom_right_y+"\" href=\""+nSLA_DWO_ISL[a].URI+"\" alt=\""+nSLA_DWO_ISL[a].name+"\" title=\""+nSLA_DWO_ISL[a].name+"\" >";				
			}			
		}
		if(code==15){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_Hobart[a].top_left_x+","+nSLA_Hobart[a].top_left_y+","+nSLA_Hobart[a].bottom_right_x+","+nSLA_Hobart[a].bottom_right_y+"\" href=\""+nSLA_Hobart[a].URI+"\" alt=\""+nSLA_Hobart[a].name+"\" title=\""+nSLA_Hobart[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_Hobart[a].top_left_x+","+nSLA_DWO_Hobart[a].top_left_y+","+nSLA_DWO_Hobart[a].bottom_right_x+","+nSLA_DWO_Hobart[a].bottom_right_y+"\" href=\""+nSLA_DWO_Hobart[a].URI+"\" alt=\""+nSLA_DWO_Hobart[a].name+"\" title=\""+nSLA_DWO_Hobart[a].name+"\" >";				
			}			
		}
	    if(code==16){
		    if(typeIs=="cdio"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_Darwin[a].top_left_x+","+nSLA_Darwin[a].top_left_y+","+nSLA_Darwin[a].bottom_right_x+","+nSLA_Darwin[a].bottom_right_y+"\" href=\""+nSLA_Darwin[a].URI+"\" alt=\""+nSLA_Darwin[a].name+"\" title=\""+nSLA_Darwin[a].name+"\" >";
			}
			if(typeIs=="dwo"){
				sL=sL+"<area shape=\"rect\" coords=\""+nSLA_DWO_Darwin[a].top_left_x+","+nSLA_DWO_Darwin[a].top_left_y+","+nSLA_DWO_Darwin[a].bottom_right_x+","+nSLA_DWO_Darwin[a].bottom_right_y+"\" href=\""+nSLA_DWO_Darwin[a].URI+"\" alt=\""+nSLA_DWO_Darwin[a].name+"\" title=\""+nSLA_DWO_Darwin[a].name+"\" >";				
			}				
		}
	}
	sL=sL+"</map>";
	if(document.getElementById){   //gecko(NN6) + IE 5+
		if(document.getElementById("use_map")!=null){
			//alert ("sL="+sL);		
			document.getElementById("use_map").innerHTML=sL;
			document.getElementById("use_map").display="block";
			document.getElementById("use_map").visibility="visible";
		}
	}
}

function loadSmallMap(code){
    var sL;
	document.getElementById("navoptions").style.backgroundImage=("url(../cdo/images/"+getMap(code,mapIs,'small',typeIs)+")");
}

function loadKeyImage(){
	var sL;
	if(mapIs=='T'){
		sL="<img src=\"../cdo/images/topography.gif\" alt=\"Key for navigation map.\" id=\"topokey\">";
	}
	if(mapIs=='P'){
		sL="<img src=\"../cdo/images/plain.gif\" alt=\"Key for navigation map.\" id=\"topokey\">";
	}
	if(mapIs=='R'){
		sL="<img src=\"../cdo/images/rain.gif\" alt=\"Key for navigation map.\" id=\"topokey\">";
	}	
	if(document.getElementById){   //gecko(NN6) + IE 5+
		if(document.getElementById("map_key")!=null){
			//alert ("sL="+sL);		
			document.getElementById("map_key").innerHTML=sL;
			document.getElementById("map_key").display="block";
			document.getElementById("map_key").visibility="visible";
		}
	}	
}

function loadLargeMap(code){
	var sL,sL1;
	//sL="<img src=\"../cdo/images/working_large.gif\" alt=\"navigation map\" name=\"navmap\" id=\"navmap\" usemap=\"#m_map\" /> ";
	//sL1="<img src=\"../cdo/images/working_large.gif\" alt=\"navigation map\" name=\"navmap\"  id=\"navmapbg\" /> ";
	sL="<img src=\"../cdo/images/"+getMap(code,'N','normal',typeIs)+"\" alt=\"navigation map\" name=\"navmap\" id=\"navmap\" usemap=\"#m_map_"+rNum+"\" /> ";
	sL1="<img src=\"../cdo/images/"+getMap(code,mapIs,'normal',typeIs)+"\" alt=\"\" name=\"navmap\"  id=\"navmapbg\" /> ";
	if(document.getElementById){   //gecko(NN6) + IE 5+
		if(document.getElementById("largemapload")!=null){
			//alert ("sL="+sL);	
			document.getElementById("largemapload").innerHTML=sL+sL1;
			document.getElementById("largemapload").display="block";
			document.getElementById("largemapload").visibility="visible";
		}
	}

	//document.images['navmap'].src='../cdo/images/working_large.gif';
	//document.images['navmapbg'].src='../cdo/images/working_large.gif';	
	
    if(document.getElementById){   //gecko(NN6) + IE 5+
		if(document.getElementById("navmap")!=null){
			//alert ("sL="+sL);		
			document.getElementById("navmap").style.width=getSizeOfMap(code,mapIs,'normal',typeIs,'width')+"px";
			document.getElementById("navmap").style.height=getSizeOfMap(code,mapIs,'normal',typeIs,'height')+"px";
			document.getElementById("navmapbg").style.width=getSizeOfMap(code,mapIs,'normal',typeIs,'width')+"px";
			document.getElementById("navmapbg").style.height=getSizeOfMap(code,mapIs,'normal',typeIs,'height')+"px";			
		}
	}
	
	//var imageNavMap = new Image(getSizeOfMap(code,mapIs,'normal',typeIs,'width'),getSizeOfMap(code,mapIs,'normal',typeIs,'height'));
	//var imageNavMapBG = new Image(getSizeOfMap(code,mapIs,'normal',typeIs,'width'),getSizeOfMap(code,mapIs,'normal',typeIs,'height'));
	//imageNavMap.src='../cdo/images/'+getMap(code,'N','normal',typeIs);
	//imageNavMapBG.src='../cdo/images/'+getMap(code,mapIs,'normal',typeIs);
	
	//document.getElementById("navmap").src='../cdo/images/'+getMap(code,'N','normal',typeIs);
	//document.getElementById("navmapbg").src='../cdo/images/'+getMap(code,mapIs,'normal',typeIs);
}

function SetDivPosition(){
	var code=codeIs;
	var widthOfViewPortWidth=0;
	var widthOfViewPortHeight=0;
	var intY = 0;
	var intX = 0;
	intY = document.getElementById("maplayerl").scrollTop;
	intX = document.getElementById("maplayerl").scrollLeft;	
	xOffset=((navOptionsWidth/2)-(getSizeOfMap(code,mapIs,'small',typeIs,'width')/2));
	for(var a=0;a<17;a++){
		if(document.get_navmap.mapextent[a].checked==true){
			code=document.get_navmap.mapextent[a].value;
			codeIs=document.get_navmap.mapextent[a].value;
		}
	}
	if(sizeOfViewWidth<=getSizeOfMap(code,mapIs,'normal',typeIs,'width')){
		widthOfViewPortWidth=(sizeOfViewWidth*getSizeOfMap(code,mapIs,'small',typeIs,'width'))/getSizeOfMap(code,mapIs,'normal',typeIs,'width');
	}else{
		widthOfViewPortWidth=getSizeOfMap(code,mapIs,'small',typeIs,'width');
	}
	if(sizeOfViewHeight<=getSizeOfMap(code,mapIs,'normal',typeIs,'height')){
		widthOfViewPortHeight=(sizeOfViewHeight*getSizeOfMap(code,mapIs,'small',typeIs,'height'))/getSizeOfMap(code,mapIs,'normal',typeIs,'height');
	}else{
		widthOfViewPortHeight=getSizeOfMap(code,mapIs,'small',typeIs,'height');
	}
    if(viewPortFlag==1){	
		document.getElementById("locationbox").style.width=widthOfViewPortWidth+"px";
		document.getElementById("locationbox").style.height=widthOfViewPortHeight+"px";
		document.getElementById("locationbox").style.left=((getSizeOfMap(code,mapIs,'small',typeIs,'width')*intX)/getSizeOfMap(code,mapIs,'normal',typeIs,'width'))+xOffset+"px";
		document.getElementById("locationbox").style.top=(getSizeOfMap(code,mapIs,'small',typeIs,'height')*intY)/getSizeOfMap(code,mapIs,'normal',typeIs,'height')+"px";
		//Fixing red box semantics
		document.getElementById("blankgif").style.width=widthOfViewPortWidth+"px";
		document.getElementById("blankgif").style.height=widthOfViewPortHeight+"px";
	}
	//alert (document.getElementById("locationbox").color);
}

function doSpecial(code){
	if(doneReEntrantCodeOnce==0){
		doneReEntrantCodeOnce=1;
		savePointCheck=setInterval('checkForLoad('+code+')',90);
	}
	return;
}

function checkForLoad(code){
	var codeHere=code;
	if(codeHere==0){
	    if(typeIs=="cdio"){
			if(nSLA_AUS_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_AUS_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_AUS_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_AUS_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
	if(codeHere==1){
	    if(typeIs=="cdio"){
			if(nSLA_NSW_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_NSW_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_NSW_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_NSW_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
	if(codeHere==2){
	    if(typeIs=="cdio"){
			if(nSLA_Sydney_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_Sydney_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_Sydney_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_Sydney_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}			
		}
	}
	if(codeHere==3){
	    if(typeIs=="cdio"){
			if(nSLA_VIC_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_VIC_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_VIC_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_VIC_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
	if(codeHere==4){
	    if(typeIs=="cdio"){
			if(nSLA_Melbourne_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_Melbourne_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_Melbourne_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_Melbourne_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}			
		}
	}	
	if(codeHere==5){
	    if(typeIs=="cdio"){
			if(nSLA_QLD_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_QLD_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_QLD_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_QLD_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
	if(codeHere==6){
	    if(typeIs=="cdio"){
			if(nSLA_Brisbane_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_Brisbane_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_Brisbane_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_Brisbane_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}	
	if(codeHere==7){
	    if(typeIs=="cdio"){
			if(nSLA_WA_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_WA_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_WA_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_WA_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
	if(codeHere==8){
	    if(typeIs=="cdio"){
			if(nSLA_Perth_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_Perth_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_Perth_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_Perth_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
    if(codeHere==9){
	    if(typeIs=="cdio"){
			if(nSLA_SA_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_SA_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_SA_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_SA_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
	if(codeHere==10){
	    if(typeIs=="cdio"){
			if(nSLA_Adelaide_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_Adelaide_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_Adelaide_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_Adelaide_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
    if(codeHere==11){
	    if(typeIs=="cdio"){
			if(nSLA_TAS_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_TAS_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_TAS_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_TAS_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
	if(codeHere==12){
	    if(typeIs=="cdio"){
			if(nSLA_NT_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_NT_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_NT_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_NT_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}			
		}
	}
	if(codeHere==13){
	    if(typeIs=="cdio"){
			if(nSLA_ANT_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_ANT_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_ANT_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_ANT_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
	if(codeHere==14){
	    if(typeIs=="cdio"){
			if(nSLA_ISL_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_ISL_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_ISL_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_ISL_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
	if(codeHere==15){
	    if(typeIs=="cdio"){
			if(nSLA_Hobart_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_Hobart_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_Hobart_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_Hobart_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
    if(codeHere==16){
	    if(typeIs=="cdio"){
			if(nSLA_Darwin_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_Darwin_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
		if(typeIs=="dwo"){
			if(nSLA_DWO_Darwin_Size==0 && repeatCheckFlag==0 && doneReEntrantCodeOnce==0 ){
				doSpecial(codeHere);
				return true;
			}else if(nSLA_DWO_Darwin_Size>0 && repeatCheckFlag==0){
				repeatCheckFlag=1;			
			}
		}
	}
	if(repeatCheckFlag==1){
		repeatCheckFlag=0;
		if(doneReEntrantCodeOnce==1){
			clearInterval(savePointCheck);
		}
		savePoint=setInterval('startup('+codeHere+')',90);
	}
}

function msAddScript( url )
{
    eltScript = document.createElement("script");
    eltScript.setAttribute("type", "text/javascript");
    eltScript.setAttribute("src", url);
	eltScript.setAttribute("language","JavaScript1.1");
    document.getElementsByTagName('head')[0].appendChild(eltScript);
}

function loadJavaScript(code){
	var url;
	if(code==0){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_AUS.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_AUS.js";
		}
	}
	if(code==1){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_NSW.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_NSW.js";
		}
	}
	if(code==2){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_Sydney.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_Sydney.js";
		}
	}
	if(code==3){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_VIC.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_VIC.js";
		}
	}
	if(code==4){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_Melbourne.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_Melbourne.js";
		}
	}	
	if(code==5){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_QLD.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_QLD.js";
		}
	}
	if(code==6){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_Brisbane.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_Brisbane.js";
		}
	}	
	if(code==7){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_WA.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_WA.js";
		}
	}
	if(code==8){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_Perth.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_Perth.js";
		}
	}
    if(code==9){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_SA.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_SA.js";
		}
	}
	if(code==10){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_Adelaide.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_Adelaide.js";
		}
	}
    if(code==11){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_TAS.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_TAS.js";
		}
	}
	if(code==12){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_NT.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_NT.js";
		}
	}
	if(code==13){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_ANT.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_ANT.js";
		}
	}
	if(code==14){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_ISL.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_ISL.js";
		}
	}
	if(code==15){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_Hobart.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_Hobart.js";
		}
	}
    if(code==16){
	    if(typeIs=="cdio"){
			url="../cdo/scripts/ClimRefMapCDIO_Darwin.js";
		}
		if(typeIs=="dwo"){
			url="../cdo/scripts/ClimNavMapDWO_Darwin.js";
		}
	}
	msAddScript(url);
}

function startup(code1,flag){
	var sizeOfList=0;
	var listDetails;
	var code;
	var autoNavX;
	var autoNavY;
	doneReEntrantCodeOnce=0;
	for(var a=0;a<17;a++){
		if(document.get_navmap.mapextent[a].checked==true){
			codeIs=document.get_navmap.mapextent[a].value;
		}
	}
	if(code1==0 && codeIs!=code1){
		code=codeIs;
	}else{
		code=code1;
	}
	codeIs=code;
    mapIs=document.get_navmap.selectbg[document.get_navmap.selectbg.selectedIndex].value;
	if(document.get_navmap.typeOfMap[0].checked==true){
		typeIs="cdio";
	}
	if(document.get_navmap.typeOfMap[1].checked==true){
		typeIs="dwo";
	}
	urlCodeStr=getURLParam('code');				//One of 0-16
	urlMapTypeStr=getURLParam('map_type');		//one of 'cdio' or 'dwo' currently
	if(urlMapTypeStr=='' || urlMapTypeStr==savedUrlMapTypeStr){
		//do nothing here
	}else{
		if(urlMapTypeStr=='cdio' || urlMapTypeStr=='dwo'){
			typeIs=urlMapTypeStr;
			if(typeIs=='cdio'){
				document.get_navmap.typeOfMap[0].checked=true;
			}
			if(typeIs=='dwo'){
				document.get_navmap.typeOfMap[1].checked=true;
			}
			savedUrlMapTypeStr=urlMapTypeStr;
		}
	}
	if(urlCodeStr=='' || urlCodeStr==savedUrlCodeStr){
		//Do nothing here
	}else{
		if(parseInt(urlCodeStr)>=0 && parseInt(urlCodeStr)<=16){
			codeIs=parseInt(urlCodeStr);
			code=codeIs;
			for(var a=0;a<17;a++){
				if(document.get_navmap.mapextent[a].value==urlCodeStr){
					document.get_navmap.mapextent[a].checked=true;
				}
			}
		}
		savedUrlCodeStr=urlCodeStr;
	}
	if(loadToggle==1){
		loadToggle=0;
		clearInterval(savePoint);	
	}else{
		loadToggle=1;
		rememberFlag=flag;
		loadJavaScript(code);
		checkForLoad(code);
		return true;
	}	
	autoNavX=getOffsetOfMap(code,typeIs,'x');
	autoNavY=getOffsetOfMap(code,typeIs,'y');	
	if(code==0){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_AUS_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_AUS_Size;
		}
	}
	if(code==1){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_NSW_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_NSW_Size;
		}
	}
	if(code==2){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_Sydney_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_Sydney_Size;
		}
	}
	if(code==3){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_VIC_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_VIC_Size;
		}
	}
	if(code==4){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_Melbourne_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_Melbourne_Size;
		}
	}	
	if(code==5){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_QLD_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_QLD_Size;
		}
	}
	if(code==6){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_Brisbane_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_Brisbane_Size;
		}
	}	
	if(code==7){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_WA_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_WA_Size;
		}
	}
	if(code==8){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_Perth_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_Perth_Size;
		}
	}
    if(code==9){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_SA_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_SA_Size;
		}
	}
	if(code==10){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_Adelaide_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_Adelaide_Size;
		}
	}
    if(code==11){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_TAS_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_TAS_Size;
		}
	}
	if(code==12){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_NT_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_NT_Size;
		}
	}
	if(code==13){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_ANT_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_ANT_Size;
		}
	}
	if(code==14){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_ISL_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_ISL_Size;
		}
	}
	if(code==15){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_Hobart_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_Hobart_Size;
		}
	}
    if(code==16){
	    if(typeIs=="cdio"){
			sizeOfList=nSLA_Darwin_Size;
		}
		if(typeIs=="dwo"){
			sizeOfList=nSLA_DWO_Darwin_Size;
		}
	}
	rNum=getRandomNumber(10000);
	loadSmallMap(code);
	loadLargeMap(code);
	loadKeyImage();
	loadUseMap(sizeOfList);	
	if(topoGraphy==1){
		alert("autoNavX=["+document.getElementById("maplayerl").scrollLeft+"],  autoNavY=["+document.getElementById("maplayerl").scrollTop);
		topoGraphy=0;
	}	
	if(rememberFlag==1){
		document.getElementById("maplayerl").scrollTop=autoNavY;
		document.getElementById("maplayerl").scrollLeft=autoNavX;
		//document.getElementById("maplayerl").scrollTop=0;
		//document.getElementById("maplayerl").scrollLeft=0;	
	}
	SetDivPosition();	
	if(sizeOfList>0){
		document.get_navmap.statesitelist.length=sizeOfList;	
	}
	if(document.images){
		document.images['mapmini'].src='../cdo/images/map_mini_'+code+'.gif';
	}
	for(var a=0;a<sizeOfList;a++){
		if(code==0){
		    if(typeIs=="cdio"){
				listDetails=nSLA_AUS[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_AUS[a];
			}
		}
		if(code==1){
		    if(typeIs=="cdio"){
				listDetails=nSLA_NSW[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_NSW[a];
			}
		}
		if(code==2){
		    if(typeIs=="cdio"){
				listDetails=nSLA_Sydney[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_Sydney[a];
			}
		}
		if(code==3){
		    if(typeIs=="cdio"){
				listDetails=nSLA_VIC[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_VIC[a];
			}
		}
		if(code==4){
		    if(typeIs=="cdio"){
				listDetails=nSLA_Melbourne[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_Melbourne[a];
			}
		}	
		if(code==5){
		    if(typeIs=="cdio"){
				listDetails=nSLA_QLD[a];			
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_QLD[a];
			}
		}
		if(code==6){
		    if(typeIs=="cdio"){
				listDetails=nSLA_Brisbane[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_Brisbane[a];
			}
		}	
		if(code==7){
		    if(typeIs=="cdio"){
				listDetails=nSLA_WA[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_WA[a];
			}
		}
		if(code==8){
		    if(typeIs=="cdio"){
				listDetails=nSLA_Perth[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_Perth[a];
			}
		}
	    if(code==9){
		    if(typeIs=="cdio"){
				listDetails=nSLA_SA[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_SA[a];
			}
		}
		if(code==10){
		    if(typeIs=="cdio"){
				listDetails=nSLA_Adelaide[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_Adelaide[a];
			}
		}
	    if(code==11){
		    if(typeIs=="cdio"){
				listDetails=nSLA_TAS[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_TAS[a];
			}
		}
		if(code==12){
		    if(typeIs=="cdio"){
				listDetails=nSLA_NT[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_NT[a];
			}
		}
		if(code==13){
		    if(typeIs=="cdio"){
				listDetails=nSLA_ANT[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_ANT[a];
			}
		}
		if(code==14){
		    if(typeIs=="cdio"){
				listDetails=nSLA_ISL[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_ISL[a];
			}
		}
		if(code==15){
		    if(typeIs=="cdio"){
				listDetails=nSLA_Hobart[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_Hobart[a];
			}
		}
	    if(code==16){
		    if(typeIs=="cdio"){
				listDetails=nSLA_Darwin[a];
			}
			if(typeIs=="dwo"){
				listDetails=nSLA_DWO_Darwin[a];
			}
		}	
		document.get_navmap.statesitelist[a].value=listDetails.URI;
		document.get_navmap.statesitelist[a].text=listDetails.name;
	}
}

function startup_secondary(){
	var code=codeIs;
	for(var a=0;a<17;a++){
		if(document.get_navmap.mapextent[a].checked==true){
			code=document.get_navmap.mapextent[a].value;
		}
	}
	startup(code,1);
}

function gotoPage(){
	var indexOfList=document.get_navmap.statesitelist.selectedIndex;
	var code=codeIs;
	var haveDone=0;
	for(var a=0;a<17;a++){
		if(document.get_navmap.mapextent[a].checked==true){
			code=document.get_navmap.mapextent[a].value;
		}
	}
	if(code==0){
		if(typeIs=="cdio"){
			listDetails=nSLA_AUS[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_AUS[indexOfList];
			haveDone=1;
		}
	}
	if(code==1){
		if(typeIs=="cdio"){
			listDetails=nSLA_NSW[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_NSW[indexOfList];
			haveDone=1;
		}
	}
	if(code==2){
		if(typeIs=="cdio"){
			listDetails=nSLA_Sydney[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_Sydney[indexOfList];
			haveDone=1;
		}
	}
	if(code==3){
		if(typeIs=="cdio"){
			listDetails=nSLA_VIC[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_VIC[indexOfList];
			haveDone=1;
		}
	}
	if(code==4){
		if(typeIs=="cdio"){
			listDetails=nSLA_Melbourne[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_Melbourne[indexOfList];
			haveDone=1;
		}
	}	
	if(code==5){
		if(typeIs=="cdio"){
			listDetails=nSLA_QLD[indexOfList];			
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_QLD[indexOfList];
			haveDone=1;
		}
	}
	if(code==6){
		if(typeIs=="cdio"){
			listDetails=nSLA_Brisbane[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_Brisbane[indexOfList];
			haveDone=1;
		}
	}	
	if(code==7){
		if(typeIs=="cdio"){
			listDetails=nSLA_WA[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_WA[indexOfList];
			haveDone=1;
		}
	}
	if(code==8){
		if(typeIs=="cdio"){
			listDetails=nSLA_Perth[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_Perth[indexOfList];
			haveDone=1;
		}
	}
	if(code==9){
		if(typeIs=="cdio"){
			listDetails=nSLA_SA[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_SA[indexOfList];
			haveDone=1;
		}
	}
	if(code==10){
		if(typeIs=="cdio"){
			listDetails=nSLA_Adelaide[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_Adelaide[indexOfList];
			haveDone=1;
		}
	}
	if(code==11){
		if(typeIs=="cdio"){
			listDetails=nSLA_TAS[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_TAS[indexOfList];
			haveDone=1;
		}
	}
	if(code==12){
		if(typeIs=="cdio"){
			listDetails=nSLA_NT[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_NT[indexOfList];
			haveDone=1;
		}
	}
	if(code==13){
		if(typeIs=="cdio"){
			listDetails=nSLA_ANT[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_ANT[indexOfList];
			haveDone=1;
		}
	}
	if(code==14){
		if(typeIs=="cdio"){
			listDetails=nSLA_ISL[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_ISL[indexOfList];
			haveDone=1;
		}
	}
	if(code==15){
		if(typeIs=="cdio"){
			listDetails=nSLA_Hobart[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_Hobart[indexOfList];
			haveDone=1;
		}
	}
	if(code==16){
		if(typeIs=="cdio"){
			listDetails=nSLA_Darwin[indexOfList];
			haveDone=1;
		}
		if(typeIs=="dwo"){
			listDetails=nSLA_DWO_Darwin[indexOfList];
			haveDone=1;
		}
	}		
	if(haveDone==1){
		location.href=listDetails.URI;	
	}

}
