//　ブラウザ名取得
function getBrowserName_scl()
{
    var aName  = navigator.appName.toUpperCase();
    var uName  = navigator.userAgent.toUpperCase();
    if (aName.indexOf("NETSCAPE") >= 0)       return "Netscape";
    if (aName.indexOf("MICROSOFT") >= 0)      return "Explorer";
    return "";
}
//　ブラウザバージョン取得
function getBrowserVersion_scl()
{
	var browser = getBrowserName_scl();
	var version = 0;
	var s = 0;
	var e = 0;
	var appVer  = navigator.appVersion;
	if (browser == "Netscape")
	{
		s = appVer.indexOf(" ",0);
		version = eval(appVer.substring(0,s));
		if (version >= 5) version++;
	}
	if (browser == "Explorer")
	{
		appVer  = navigator.userAgent;
		s = appVer.indexOf("MSIE ",0) + 5;
		e = appVer.indexOf(";",s);
		version = eval(appVer.substring(s,e));
	}
	return version;
}
//　Macintosh           　->  MacOS
//　Windows95/98/NT/2000  ->　Windows
//　UNIX                  ->　UNIX
function getOSType()
{
    var RetCode = "";
    var uAgent  = navigator.userAgent.toUpperCase();
    if (uAgent.indexOf("MAC") >= 0)           RetCode = "MacOS";
    if (uAgent.indexOf("WIN") >= 0)           RetCode = "Windows";
    if (uAgent.indexOf("X11") >= 0)           RetCode = "UNIX";
    return RetCode;
}

function pageScroll(hash) {
    if (getBrowserName_scl()=="Explorer" && getBrowserVersion_scl() == 1) {

    } else {
       pageScroll_run(hash);
	}
}

//Page Scroll st

function pageScroll_run(hash) {

    var cpos = new CurPoint(); location = hash;
    var dpos = new CurPoint(); window.scrollTo(cpos.x, cpos.y);
    var scr = new Scrolling(cpos, dpos);
    scr.iid = setInterval(function() { if (scr.run()) clearInterval(scr.iid); }, 10);

}

function Scrolling(pFrom, pTo) {
	this.pFrom = pFrom;
	this.pTo   = pTo;
	this.step  = 0;
}

Scrolling.prototype.MAXSTEPS = 90;
Scrolling.prototype.CURVE = 0.9;
Scrolling.prototype.run = function() {
	++this.step;
	var x = this.pTo.x - Math.pow(this.CURVE, this.step) * (this.pTo.x - this.pFrom.x);
	var y = this.pTo.y - Math.pow(this.CURVE, this.step) * (this.pTo.y - this.pFrom.y);
	window.scrollTo(x, y);
	return this.step >= this.MAXSTEPS;
}


if (document.all) {
	if (document.compatMode == "CSS1Compat") {
		CurPoint = function () {
			this.x = document.documentElement.scrollLeft;
			this.y = document.documentElement.scrollTop;
		};
	} else {
		CurPoint = function () {
			this.x = document.body.scrollLeft;
			this.y = document.body.scrollTop;
		};
	}
} else if (window.pageXOffset !== undefined) {
	CurPoint = function () {
		this.x = window.pageXOffset;
		this.y = window.pageYOffset;
	};
} else {
	CurPoint = function () {
		this.x = window.scrollX;
		this.y = window.scrollY;
	};
}
//Page Scroll ed




