// JavaScript Document
function showhidObject(sid,hid){
	var object = document.getElementById(sid);
	object.style.display = '';
	if(hid){
		object = document.getElementById(hid);
		object.style.display='none';
	}
}
function turnDisplay(objId){
	var Obj = document.getElementById(objId);
	if(Obj)
		Obj.style.display = Obj.style.display == 'none' ? '' : 'none';
}
var imgWidth = 0,imgHeight = 0,imgObj = new Image();
function ResetImg(imgFile,maxWidth,maxHeight){
	imgObj.src = imgFile.src;
	imgWidth = imgObj.width;
	imgHeight = imgObj.height;
	if(maxWidth != 0 && imgWidth > maxWidth){
		imgHeight = parseInt(imgHeight * maxWidth / imgWidth);
		imgWidth = maxWidth;
	}
	if(maxHeight != 0 && imgHeight > maxHeight){
		imgWidth = parseInt(imgWidth * maxHeight / imgHeight);
		imgHeight = maxHeight;
	}else{
		imgFile.style.marginTop = (maxHeight - imgHeight) / 2;
	}
	imgFile.height = imgHeight;
	imgFile.width = imgWidth;
}

