function TrashBox(id, output) {
	this.id = id;
	this.output = document.getElementById(output);
	this.trashFlag = false;

	this.css = {
		position: "absolute",
		left: "50px",
		top: "365px",
		width: "61px",
		height: "104px",
		background: {
			off: 'url("/memo/img/trashBox.png") no-repeat 0 0',
			on: 'url("/memo/img/trashBox.png") no-repeat 0 -106px'
		},
		border: "0",
		zIndex: "0"
	}
}

// $B%4%_H"$r@8@.$9$k(B
TrashBox.prototype.getTrashBox = function() {
	var trashBox = document.createElement("div");
	trashBox.setAttribute("id", this.id);

	trashBox.style.position = this.css.position;
	trashBox.style.left = this.css.left;
	trashBox.style.top = this.css.top;
	trashBox.style.width = this.css.width;
	trashBox.style.height = this.css.height;
	trashBox.style.background = this.css.background.off;
	trashBox.style.border = this.css.border;
	trashBox.style.zIndex = this.css.zIndex;

	this.output.appendChild(trashBox);
}

// $B%4%_H"$K=E$J$C$F$$$k$+$I$&$+%A%'%C%/$9$k(B
TrashBox.prototype.checkTrash = function(x, y) {
	var trashX = {
		min: parseInt(this.css.left),
		max: parseInt(this.css.left) + parseInt(this.css.width)
	};

	var trashY = {
		min: parseInt(this.css.top),
		max: parseInt(this.css.top) + parseInt(this.css.height)
	};

	if (x > trashX.min && x < trashX.max && y > trashY.min && y < trashY.max) {
		this.trashFlag = true;
		this.changeTrashBox("on");
	}
	else {
		this.trashFlag = false;
		this.changeTrashBox("off");
	}
}

// $B%4%_H"$N%"%$%3%s$rJQ$($k(B
TrashBox.prototype.changeTrashBox = function(arg) {
	var trashBox = document.getElementById(this.id);
	switch(arg) {
		case "on":
			trashBox.style.background = this.css.background.on;
			break;
		case "off":
			trashBox.style.background = this.css.background.off;
			break;
		default:
			break;
	}
}

TrashBox.prototype.removePad = function(target, output) {
	output.removeChild(target);
	this.changeTrashBox("off");
	this.trashFlag = false;
}
