// プラットフォーム・ブラウザごとのフォントスタイル読込
var plat = (navigator.userAgent.indexOf("Win") >= 0) ;
if(plat) {
	document.write('<link rel="stylesheet" href="/css/font_win.css" type="text/css" media="all">');
}else{
	var plat = (navigator.userAgent.indexOf("Safari") >= 0) ;
	if(plat) {
		document.write('<link rel="stylesheet" href="/css/font_safari.css" type="text/css" media="all">');
	}else
	{document.write('<link rel="stylesheet" href="/css/font_mac.css" type="text/css" media="all">');}
}

var plat = (navigator.userAgent.indexOf("Opera") >= 0) ;
if(plat) {
	document.write('<link rel="stylesheet" href="/css/font_opera.css" type="text/css" media="all">');
}else{}

// トップフラッシュ
function setFlash(){
　　var so = new SWFObject("/swf/mainimg.swf", "mainimg", "860", "201", "8", "#ffffff");
　　//ムービーファイル名、ムービーのID、width,height,Flashのバージョン,背景色
　　//パラメーターの追加
　　so.addParam("quality", "high");
　　so.addParam("salign", "lt");
　　//変数を渡す場合
　　document.write(so.getSWFHTML());
}

// ポップアップ
function popupmap(filename,winname) {
newWin=window.open(filename,winname,"width=670,height=600,menubar=1,scrollbars=1,toolbar=1,resizable=1,status=1");
}

function popupgallery(filename,winname) {
newWin=window.open(filename,winname,"width=640,height=640,menubar=1,scrollbars=1,toolbar=1,resizable=1,status=1");
}

function popupmovie(filename,winname) {
newWin=window.open(filename,winname,"width=640,height=540,menubar=1,scrollbars=1,toolbar=1,resizable=1,status=1");
}

function PrintPage(){
	if(document.getElementById || document.layers){
		window.print();	
	}
}

function openWindow(url,winname,x,y){
	window.open(url,winname,"menubar=1,scrollbars=1,toolbar=1,resizable=1,status=1,width=" + x + ",height=" + y + "'");
}


// 汎用ロールオーバー
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."));  
                }  
            }  
        }  
    }  
}  
if(window.addEventListener) {  
    window.addEventListener("load", smartRollover, false);  
}  
else if(window.attachEvent) {  
    window.attachEvent("onload", smartRollover);  
} 

// プリント
function PrintPage(){
	if(document.getElementById || document.layers){
		window.print();
	}
}

// このページの最初へ
function scrollToTop() {
	var x1 = x2 = x3 = 0;
	var y1 = y2 = y3 = 0;
	if (document.documentElement) {
		x1 = document.documentElement.scrollLeft || 0;
		y1 = document.documentElement.scrollTop || 0;
	}
	if (document.body) {
		x2 = document.body.scrollLeft || 0;
		y2 = document.body.scrollTop || 0;
	}
	x3 = window.scrollX || 0;
	y3 = window.scrollY || 0;
	var x = Math.max(x1, Math.max(x2, x3));
	var y = Math.max(y1, Math.max(y2, y3));
	window.scrollTo(Math.floor(x / 1.4), Math.floor(y / 1.4));
	if (x > 0 || y > 0) {
		window.setTimeout("scrollToTop()", 10);
	}
}
