window.onload=initLoadImg;



function initLoadingMsgOff(){
	if(document.getElementById("loading")){
		loadingMsgOff();
	}
}

function loadingMsgOff(){
	document.getElementById("loading").style.visibility="hidden";
}

	var counterMax=0;
function initLoadImg(){
	for(i=0;i<document.images.length;i++){
		var thisImg=document.images[i];
		if(thisImg.className=="mini"){
			counterMax++;
		}
	}
	
	setLoadImg();
}

function setLoadImg(){
	var counter=0;
	for(i=0;i<document.images.length;i++){
		var thisImg=document.images[i];
		if(thisImg.className=="mini"){
			loadImages(thisImg,counter);
			counter++;
		}
	}

}

	var allImages = new Array();
	var allImageSrcs = new Array();
function loadImages(thisImage,thisNum){
	allImages[thisNum] = new Image();
	allImages[thisNum].src = thisImage.src.split("_s")[0]+".jpg";
	allImageSrcs[thisNum]=allImages[thisNum].src;
	allImages[thisNum].onload=checkImg;
	
}
	var counterLoaded=0;
	var loadedW=0;
function checkImg(){
	counterLoaded++;
	var meterW=document.getElementById("meter_loading").width;
	loadedW = counterLoaded / counterMax * meterW;
	document.getElementById("meter_loaded").width=loadedW;	
	//alert(counterLoaded+"=="+meterW);
	if(counterLoaded == counterMax){
		loadingMsgOff();
	}
}

function loadingMsgOff(){
	document.getElementById("loading").style.visibility="hidden";
}


