var dom = {
	walk_the_DOM : function walk(node, func) {
		func(node);
		node = node.firstChild;
		while (node) {
			walk(node, func);
			node = node.nextSibling;
		}
	},
	getElementsByAttribute : function (attribute, value, tagname) {
		var all = document.getElementsByTagName(tagname);
		var elements = [];
		for (i = 0; i < all.length; i += 1) {
			if (attribute === 'class') {
				var element = all[i].getAttribute("class") || all[i].getAttribute("className");
				if ( element === value) {
					elements.push(all[i]);
				}
			} else if (all[i].getAttribute(attribute) === value) {
				elements.push(all[i]);
			}(i);
		};
		return elements;
	},
	setStyleOpacity : function (elem, palam) {
		elem.style.filter = 'alpha(opacity=' + (palam * 10) + ')';
		elem.style.MozOpacity = palam / 10;
		elem.style.opacity = palam / 10;
	},
	addListener : function (elem, eventType, func, cap) {
		if (elem.addEventListener) {
			elem.addEventListener(eventType, func, cap);
		} else if (elem.attachEvent) {
			elem.attachEvent('on' + eventType, func);
		} else {
			alert('より新しいブラウザでご覧下さい。ご利用のブラウザでは、当サイトの一部の機能を利用することが出来ません。');
			return false;
		};
		return elem;
	},
	removeListener : function (elem, eventType, func, cap) {
		if (elem.removeEventListener) {
			elem.removeEventListener(eventType, func, cap);
		} else if (elem.detachEvent) {
			elem.detachEvent('on' + eventType, func);
		} else {
			return false;
		};
		return elem;
	},
	logging : function (obj) {
		var str;
		var that = this;
		
		if (!(that.flag)) {
			that.p = document.createElement('P');
			that.p.style.fontSize = '80%';
			that.p.style.color = '#0033ff';
			that.node = document.getElementsByTagName('body')[0].appendChild(that.p);
			that.flag = true;
		}
		
		str = document.createTextNode(obj.toString() + ', ');
		that.br = document.createElement('BR');
		
		if (!that.last_str) {
			that.last_str = that.node.appendChild(str);
			that.node.appendChild(that.br);
		} else {
			that.last_br = that.node.insertBefore(that.br, that.last_str);
			that.last_str = that.node.insertBefore(str, that.last_br);
		}
		
	}
};

