// JavaScript Document

function change_img(f){
	document.big.src = img_loading.src
	document.big.style.left = '115px'
	document.big.style.top = '115px'
	var new_img = new Image()
	new_img.src = f
	if (!new_img.complete){
		new_img.onload = function(){
			if (new_img.width > 243){
				document.big.style.left = '-' + Math.floor((new_img.width - 243) / 2) + 'px'
			}else{
				document.big.style.left = '1px'
			}

			if (new_img.height > 243){
				document.big.style.top = '-' + Math.floor((new_img.height - 243) / 2) + 'px'
			}else{
				document.big.style.top = '1px'
			}
			
			document.big.src = this.src
		}
	}else{
			if (new_img.width > 243){
				document.big.style.left = '-' + Math.floor((new_img.width - 243) / 2) + 'px'
			}else{
				document.big.style.left = '1px'
			}

			if (new_img.height > 243){
				document.big.style.top = '-' + Math.floor((new_img.height - 243) / 2) + 'px'
			}else{
				document.big.style.top = '1px'
			}
			
		document.big.src = new_img.src
	}
}

function change_img2(f){
	document.big.src = img_loading.src
	var new_img = new Image()
	new_img.src = f
	if (!new_img.complete){
		new_img.onload = function(){
			document.big.src = this.src
		}
	}else{
		document.big.src = new_img.src
	}
}