// JavaScript Document
// ポップアップ
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 cText(obj){
if(obj.value==obj.defaultValue){
obj.value="";
}
}

// 汎用ロールオーバー
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);  
}  

// このページの最初へ
var scrollStep = 1;
function scrollToTop() {
   if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat"){
      var ScrollPs = document.body.parentNode.scrollTop;
   }else{
      var ScrollPs = document.body.scrollTop;
   }
   if(scrollStep < 50 && ScrollPs) {
      ScrollPs = (ScrollPs > 2) ? Math.ceil(ScrollPs*.2) : 1;
      scrollStep++;
      scrollBy(0,-ScrollPs);
      setTimeout("scrollToTop()",10);
   }else{
      scrollTo(0,0);
      scrollStep = 1;
   }
}


function chngimg(image,id)
    {
        document.images[id].src=image;
    }


