//	MemoryModel.js は すでに読み込まれているものとする
//var memo = new MemoryModel();

function ZoomDocument()
{
	this.zoomIn = function()
	{
		if (document.body.style.zoom == null)
		{
			return false;
		}

		var dZoom = this._getZoom() + 10;
//		memo.addLearn('zoom-size', dZoom);
		document.body.style.zoom = '' + dZoom + '%';

		return true;
	};

	this.zoomOut = function()
	{
		if (document.body.style.zoom == null)
		{
			return false;
		}

		var dZoom = this._getZoom() - 10;
//		memo.addLearn('zoom-size', dZoom);
		document.body.style.zoom = '' + dZoom + '%';

		return true;
	};

	this.small = function()
	{
		if (document.body.style.zoom == null)
		{
			return false;
		}

//		memo.addLearn('zoom-size', 100);
		document.body.style.zoom = '100%';

		return true;
	};

	this.medium = function()
	{
		if (document.body.style.zoom == null)
		{
			return false;
		}

//		memo.addLearn('zoom-size', 120);
		document.body.style.zoom = '120%';

		return true;
	};

	this.large = function()
	{
		if (document.body.style.zoom == null)
		{
			return false;
		}

//		memo.addLearn('zoom-size', 140);
		document.body.style.zoom = '140%';

		return true;
	};

	this.adjust = function()
	{
		if (document.body.style.zoom == null)
		{
			return false;
		}

//		memo.getLearn('zoom-size');

		return true;
	};

	this._getZoom = function()
	{
		var tmp = document.body.style.zoom;
		if (tmp.substr(tmp.length -1, 1) == '%')
		{
			return parseInt(tmp.substr(0, tmp.length -1));
		}
		else
		{
			return 100;
		}
	};
};

var zoom = new ZoomDocument();
