
//------------------------------------------------
// addEvent
//------------------------------------------------

function addEvent(elm,listener,fn){
	try{
		elm.addEventListener(listener,fn,false);
	}catch(e){
		elm.attachEvent("on"+listener,fn);
	}
}


//------------------------------------------------
// OS判定
//------------------------------------------------

var os, ua = navigator.userAgent;

if (ua.match(/Win(dows )?NT 6\.1/)) {
	os = "Windows 7"; // Windows 7 の処理
}
else if (ua.match(/Win(dows )?NT 6\.0/)) {
	os = "Windows Vista"; // Windows Vista の処理
}
else if (ua.match(/Win(dows )?NT 5\.2/)) {
	os = "Windows Server 2003"; // Windows Server 2003 の処理
}
else if (ua.match(/Win(dows )?(NT 5\.1|XP)/)) {
	os = "Windows XP"; // Windows XP の処理
	document.write('<link rel="stylesheet" href="/css/winxp.css" type="text/css" />');
}
else if (ua.match(/Win(dows)? (9x 4\.90|ME)/)) {
	os = "Windows ME"; // Windows ME の処理
}
else if (ua.match(/Win(dows )?(NT 5\.0|2000)/)) {
	os = "Windows 2000"; // Windows 2000 の処理
}
else if (ua.match(/Win(dows )?98/)) {
	os = "Windows 98"; // Windows 98 の処理
}
else if (ua.match(/Win(dows )?NT( 4\.0)?/)) {
	os = "Windows NT"; // Windows NT の処理
}
else if (ua.match(/Win(dows )?95/)) {
	os = "Windows 95"; // Windows 95 の処理
}
else if (ua.match(/Mac|PPC/)) {
	os = "Mac OS"; // Macintosh の処理
}
else if (ua.match(/Linux/)) {
	os = "Linux"; // Linux の処理
}
else if (ua.match(/(Free|Net|Open)BSD/)) {
	os = RegExp.$1 + "BSD"; // BSD 系の処理
}
else if (ua.match(/SunOS/)) {
	os = "Solaris"; // Solaris の処理
}
else {
	os = "N/A"; // 上記以外 OS の処理
}

//document.write(os);



//------------------------------------------------

