var loaded = 0;
function LoadImages() {
	if (document.images) {
			txtTekakanoHomeOut = new Image();
			txtTekakanoHomeOut.src = "images/common/txt_tekakano_home_out.gif";
			txtTekakanoHomeOver = new Image();
			txtTekakanoHomeOver.src = "images/common/txt_tekakano_home_over.gif";
			
			txtMaoriOut = new Image();
			txtMaoriOut.src = "images/maori/txt_maori_out.gif";
			txtMaoriOver = new Image();
			txtMaoriOver.src = "images/maori/txt_maori_over.gif";
			
			txtPacificOut = new Image();
			txtPacificOut.src = "images/pacific/txt_pacific_out.gif";
			txtPacificOver = new Image();
			txtPacificOver.src = "images/pacific/txt_pacific_over.gif";
			
			txtBackOut = new Image();
			txtBackOut.src = "images/common/txt_back_out.gif";
			txtBackOver = new Image();
			txtBackOver.src = "images/common/txt_back_over.gif";
			
			txtForwardOut = new Image();
			txtForwardOut.src = "images/common/txt_forward_out.gif";
			txtForwardOver = new Image();
			txtForwardOver.src = "images/common/txt_forward_over.gif";
			
			txtResourcesOut = new Image();
			txtResourcesOut.src = "images/common/txt_resources_out.gif";
			txtResourcesOver = new Image();
			txtResourcesOver.src = "images/common/txt_resources_over.gif";
			
			txtMaoriGeographyMapOut = new Image();
			txtMaoriGeographyMapOut.src = "images/maori/txt_geography_map_out.gif";
			txtMaoriGeographyMapOver = new Image();
			txtMaoriGeographyMapOver.src = "images/maori/txt_geography_map_over.gif";
			
			txtPacificGeographyMapOut = new Image();
			txtPacificGeographyMapOut.src = "images/pacific/txt_geography_map_out.gif";
			txtPacificGeographyMapOver = new Image();
			txtPacificGeographyMapOver.src = "images/pacific/txt_geography_map_over.gif";
			
			txtMaoriVirtualGalleryOut = new Image();
			txtMaoriVirtualGalleryOut.src = "images/maori/txt_virtual_gallery_out.gif";
			txtMaoriVirtualGalleryOver = new Image();
			txtMaoriVirtualGalleryOver.src = "images/maori/txt_virtual_gallery_over.gif";
			
			txtPacificVirtualGalleryOut = new Image();
			txtPacificVirtualGalleryOut.src = "images/pacific/txt_virtual_gallery_out.gif";
			txtPacificVirtualGalleryOver = new Image();
			txtPacificVirtualGalleryOver.src = "images/pacific/txt_virtual_gallery_over.gif";
			
			txtMaoriAdvancedSearchOut = new Image();
			txtMaoriAdvancedSearchOut.src = "images/maori/txt_advanced_search_out.gif";
			txtMaoriAdvancedSearchOver = new Image();
			txtMaoriAdvancedSearchOver.src = "images/maori/txt_advanced_search_over.gif";
			
			txtPacificAdvancedSearchOut = new Image();
			txtPacificAdvancedSearchOut.src = "images/pacific/txt_advanced_search_out.gif";
			txtPacificAdvancedSearchOver = new Image();
			txtPacificAdvancedSearchOver.src = "images/pacific/txt_advanced_search_over.gif";
			
			txtHomeMaoriOut = new Image();
			txtHomeMaoriOut.src = "images/maori/txt_maori_largeicon_out.gif";
			txtHomeMaoriOver = new Image();
			txtHomeMaoriOver.src = "images/maori/txt_maori_largeicon_over.gif";
			
			txtHomePacificOut = new Image();
			txtHomePacificOut.src = "images/pacific/txt_pacific_largeicon_out.gif";
			txtHomePacificOver = new Image();
			txtHomePacificOver.src = "images/pacific/txt_pacific_largeicon_over.gif";
			
			txtHomeKotawaOut = new Image();
			txtHomeKotawaOut.src = "images/common/txt_kotawa_largeicon_out.gif";
			txtHomeKotawaOver = new Image();
			txtHomeKotawaOver.src = "images/common/txt_kotawa_largeicon_over.gif";
			
			txtHomeDutyOut = new Image();
			txtHomeDutyOut.src = "images/common/txt_duty_largeicon_out.gif";
			txtHomeDutyOver = new Image();
			txtHomeDutyOver.src = "images/common/txt_duty_largeicon_over.gif";

			txtHomeOut = new Image();
			txtHomeOut.src = "images/common/txt_home_largeicon_out.gif";
			txtHomeOver = new Image();
			txtHomeOver.src = "images/common/txt_home_largeicon_over.gif";
			
			txtMaoriResourcesOut = new Image();
			txtMaoriResourcesOut.src = "images/maori/txt_maori_resources_out.gif";
			txtMaoriResourcesOver = new Image();
			txtMaoriResourcesOver.src = "images/maori/txt_maori_resources_over.gif";
			
			txtPacificResourcesOut = new Image();
			txtPacificResourcesOut.src = "images/pacific/txt_pacific_resources_out.gif";
			txtPacificResourcesOver = new Image();
			txtPacificResourcesOver.src = "images/pacific/txt_pacific_resources_over.gif";
			
			loaded = 1;
	}
}

function checkImageSize(objIn, strImageWidth, strImageHeight){
	var tempWidth, computedHeight, adjustRatio
	if(objIn.width > parseInt(strImageWidth) || objIn.height > parseInt(strImageHeight)){
		tempWidth = parseInt(strImageWidth);
		computedHeight = objIn.height * tempWidth / objIn.width;
		adjustRatio = computedHeight / parseInt(strImageHeight);
		if (adjustRatio > 1) tempWidth = parseInt(tempWidth / adjustRatio);
		objIn.style.width = tempWidth;
	}
}

/*functions needed by NavBar*/
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
