//-----------------------------------------------
// changeimage.js v1.2
// this file is image changing but near javascipt file for Ajax loading.
// include jkl-parsexml.js
// include prototype.js
// include reader.js
//
// copyright kaihara,souichi (JPN)
// copyright kaihara shiatu inc. (JPN)
//-----------------------------------------------

function changeImage(id) {
	element = document.getElementById(id).getElementsByTagName("img");
	var out = new Array(8);
	var over = new Array(8);
	out[0] = function() { this.src = "./img/menu1.png"; }
	over[0] = function() { this.src = "./img/menu1_over.png"; }
	out[1] = function() { this.src = "./img/menu2.png"; }
	over[1] = function() { this.src = "./img/menu2_over.png"; }
	out[2] = function() { this.src = "./img/menu3.png"; }
	over[2] = function() { this.src = "./img/menu3_over.png"; }
	out[3] = function() { this.src = "./img/menu4.png"; }
	over[3] = function() { this.src = "./img/menu4_over.png"; }
	out[4] = function() { this.src = "./img/menu7.png"; }
	over[4] = function() { this.src = "./img/menu7_over.png"; }
	out[5] = function() { this.src = "./img/menu8.png"; }
	over[5] = function() { this.src = "./img/menu8_over.png"; }
	out[6] = function() { this.src = "./img/menu5.png"; }
	over[6] = function() { this.src = "./img/menu5_over.png"; }
	out[7] = function() { this.src = "./img/menu6.png"; }
	over[7] = function() { this.src = "./img/menu6_over.png"; }

	for(var i = 0;i < element.length;i++) {
		element[i].onmouseover = over[i];
		element[i].onmouseout = out[i];
	}
}

function changeImageSecond(id) {
	element = document.getElementById(id).getElementsByTagName("img");
	var out = new Array(8);
	var over = new Array(8);
	out[0] = function() { this.src = "./img/submenu1.png"; }
	over[0] = function() { this.src = "./img/submenu1_over.png"; }
	out[1] = function() { this.src = "./img/submenu2.png"; }
	over[1] = function() { this.src = "./img/submenu2_over.png"; }
	out[2] = function() { this.src = "./img/submenu3.png"; }
	over[2] = function() { this.src = "./img/submenu3_over.png"; }
	out[3] = function() { this.src = "./img/submenu4.png"; }
	over[3] = function() { this.src = "./img/submenu4_over.png"; }
	out[4] = function() { this.src = "./img/submenu7.png"; }
	over[4] = function() { this.src = "./img/submenu7_over.png"; }
	out[5] = function() { this.src = "./img/submenu8.png"; }
	over[5] = function() { this.src = "./img/submenu8_over.png"; }
	out[6] = function() { this.src = "./img/submenu5.png"; }
	over[6] = function() { this.src = "./img/submenu5_over.png"; }
	out[7] = function() { this.src = "./img/submenu6.png"; }
	over[7] = function() { this.src = "./img/submenu6_over.png"; }

	for(var i = 0;i < element.length;i++) {
		element[i].onmouseover = over[i];
		element[i].onmouseout = out[i];
	}
}

// RSSリーダー部分
function readerLoad(id) {
	rr.loadXhtml(id,'./index.xml');
}

window.onload = function(){
	// ブラウザ判別
	var ua = navigator.userAgent;
	if (ua.match(/Opera[\/\s](\d\.\d+)/)) {
		isOpera = true;
	}
	else if (ua.match(/MSIE (\d\.\d+)/)) {
		isIE = true;
	}
	else if (ua.match(/Mozilla\/(4\.[5678]\d?)/)) {
		isNC = true;
	}
	else if (ua.match(/Netscape6?\/([\.\d]+)/)) {
		isNetscape = true;
	}
	else if (ua.match(/Safari\/([\.\d]+)/)) {
		isSafari = true
	}
	else if (ua.match(/Gecko/)) {
		if (ua.match(/(Firebird|Firefox)\/([\.\d]+)/)) {
			isMozilla = true;
		}
		else if (ua.match(/Thunderbird\/([\.\d]+)/)) {
			isTb = true;
		}
		else if (ua.match(/rv:([\.\d]+)/)) {
			isMozilla = true;
		}
		else {
			isMozilla = true;
		}
	}
	else {
		isNA = true;
	}
	// WindowsIE6用スタイルシート読み込み
	if(isIE) {
		document.getElementsByTagName("link")[3].href = "./script/ie6hack.css";
	}
	
	if(document.getElementById("navigation")) {
		changeImage("navigation");
	}
	if(document.getElementById("navigation-second")) {
		changeImageSecond("navigation-second");
	}
	if(document.getElementById("whatsnew")) {
		readerLoad("whatsnew");
	}
}


function checkOrderForm() {

}

