/*================================== on_load_function =================================*/

g_on_load_functions=new Array();

function add_on_load_function(func)
{
	g_on_load_functions.push(func);
}

function on_load_function_execute()
{
	var length=g_on_load_functions.length;
	for (var i=0;i<length;i++) {
		g_on_load_functions[i]();
	}
}

if(window.addEventListener) {
	window.addEventListener("load", on_load_function_execute, false);
}else if(window.attachEvent) {
	window.attachEvent("onload", on_load_function_execute);
}



/*================================== smartRollover =================================*/

function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

add_on_load_function(smartRollover);



/*================================= wordBreak ==================================*/

new function(){
	if(window.opera || navigator.userAgent.indexOf("Firefox") != -1){
		var wordBreak = function() {
			var wordBreakClass = "wordBreak";
			var table = document.getElementsByTagName("table");
			for(var i=0,len=table.length ; i<len ; i++){
				var tbClass = table[i].className.split(/\s+/);
				for (var j = 0; j < tbClass.length; j++) {
					if (tbClass[j] == wordBreakClass) {
						recursiveParse(table[i])
					}
				}
			}
		}
		var recursiveParse = function(pNode) {
			var childs = pNode.childNodes;
			for (var i = 0; i < childs.length; i++) {
				var cNode = childs[i];
				if (childs[i].nodeType == 1) {
					recursiveParse(childs[i]);
				}else if(cNode.nodeType == 3) {
					if(cNode.nodeValue.match("[^\n ]")){
						var spTxt = cNode.nodeValue.split("");
						spTxt = spTxt.join(String.fromCharCode(8203));
						var chNode = document.createTextNode(spTxt);
						cNode.parentNode.replaceChild(chNode,cNode)
					}
				}
			}
		}
		
		var addEvent = function(elm,listener,fn){
			try{
				elm.addEventListener(listener,fn,false);
			}catch(e){
				elm.attachEvent("on"+listener,fn);
			}
		}
		addEvent(window,"load",wordBreak);
	}
}



/*=================================== changeImage ================================*/

function change_image(item_id,index)
{
	document.getElementById("item_image_"+item_id).src="item_image.php?item_id="+item_id+"&index="+index+"&width=600&height=600&resize_type=2";
}


/*================================== flash =================================*/

<!--
//フラッシュ　include
function includeFlash( url, width, height, title )
{
	document.write( '<OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+ width +'" height="'+ height +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">' );
	document.write( '<param name="movie" value="' + url + '" />' );
	document.write( '<param name="quality" value="high" />' );
	document.write( '<embed src="' + url + '" quality="high" pluginspage="https://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>' );
	document.write( '</object>' );
}


if(document.images) {
var imgs = new Array();
imgs[0] = new Image();
imgs[1] = new Image();
}
function chgimg(id, imgname) {
if(document.images) {
if(imgs[imgname]) {
document.images[id].src = imgs[imgname].src;
}
else {
document.images[id].src = imgname;
}
}
}

-->
