if (document.getElementById){
	com = new commonClass();
	commonClass.prototype.dirPath = com.getDirPath();
	commonClass.prototype.UA = com.getUA();
	com.setJS('image.js');
	com.setJS('sidenavi.js');
	com.setJS('jquery.js');
	com.setJS('init.js');
}
function commonClass(){
	//
	this.setJS = function (file){
		var commonDir = 'shared/js/';
		var code = '<script type="text/javascript"';
		code += ' src="' + this.dirPath + commonDir + file + '">';
		code += '</script>';
		document.write(code);
	}
	//
	//
	this.setCSS = function(file){
		var commonDir = 'shared/css/';
		var code='<link rel="stylesheet"';
		code += ' href=' + this.dirPath + commonDir + file ;
		code += ' type="text/css" />';
	//	document.write(code);
	}
	//
	//
	this.getDirPath = function(){
		var scriptSrc = document.getElementsByTagName('script')[0].getAttribute('src');
		var commonJS = 'shared/js/common.js';
		var path = scriptSrc.replace(commonJS, '');
		return path;
	}
	//
	//
  this.addEvent = function (obj,eventType,funcName){
		obj['on'+eventType] = funcName;
  }
	//
	//
	/*this.addOnload = function (funcName){
		//com.setsidenavi();
		alert(funcName)
		this.addEvent(window,'load',funcName);
	}*/
	this.addOnload = function (funcName){
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = funcName;
		}
		else {
			window.onload = function() {
				oldonload();
				funcName();
			}
		}
	}
	//
	//
	this.getUA = function(){
		var uAgent  = navigator.userAgent.toUpperCase();
		var aName  = navigator.appName.toUpperCase();
		var appVer  = navigator.appVersion.toUpperCase();
		var UA = new Object();
		//
		if (uAgent .indexOf("MAC") >= 0){
			UA.OS = 'MAC';
		} else	if (uAgent.indexOf("WIN") >= 0){
			UA.OS = 'WIN';
		} else	if (uAgent.indexOf("X11") >= 0){
			UA.OS = 'UNX';
		}
		//
		if (aName.indexOf("NETSCAPE") >= 0) {
			UA.Browser = 'NN';
		} else if (aName.indexOf('MICROSOFT') >= 0) {
			UA.Browser = 'IE';
		} else if (aName.indexOf('SAFARI') >= 0) {
			UA.Browser = 'SF';
		} else if (aName.indexOf('OPERA') >= 0) {
			UA.Browser = 'OP';
		} else if (aName.indexOf('FIREFOX') >= 0) {
			UA.Browser = 'FF';
		} else if (aName.indexOf('GECKO') >= 0) {
			UA.Browser = 'GC';
		}
		//
		var version = 0;
		var s = 0;
		var e = 0;
		if (UA.Browser == "NN"){
			s = appVer.indexOf(" ",0);
			UA.Version = eval(appVer.substring(0,s));
		}
		if (version >= 5){
			UA.Version++;
		}
		if (UA.Browser == "IE"){
			appVer = uAgent;
			s = appVer.indexOf("MSIE ",0) + 5;
			e = appVer.indexOf(";",s);
			UA.Version = eval(appVer.substring(s,e));
		}
		return UA;
	}
}



//プルダウン変更
function changeURL(url){
if(url!=""){
window.location.href=url;
}
}
