/*
============================== CONTENTS ==============================

			1：初期設定
			2：target属性の代替
			3：CSS切り換え
			4：フッターの年度取得
			99：デバッグ

====================================================================
*/

// :::::::: 初期設定 ::::::::

mainUrl = "http://www.";

// :::::::: target属性の代替 ::::::::
function wopen(url) {
	if (url) {
		opwin = window.open(url,'');
		//opwin.moveTo(330,0);
		//opwin.focus();
	}
}
//:::::::: 2.リンクの点線を消す ::::::::
function linkLineDel(){
	a=document.getElementsByTagName("a");
	for(i=0;i<a.length;i++){
		a[i].onfocus=function(){this.blur();}
	}
}

// :::::::: 4.ゆっくりとアンカーへスクロール ::::::::
Event.observe(window, 'load', function() {
  $$('[href^=#]:not([href=#])').each(function(element) {
    element.observe('click', function(event) {
      new Effect.ScrollTo(this.hash.substr(1));
      Event.stop(event);
    }.bindAsEventListener(element))
  })
})

// :::::::: Sub Window Open (Win-IE4不具合回避済み) ::::::::
var newwin;
function WinOpen(URL,WN,F) {
	if(newwin){
		if(!newwin.closed){
			newwin.location.href=URL;
			newwin.focus();
		}else{
			newwin = window.open(URL,WN,F);
		}
	}else{
		newwin = window.open(URL,WN,F);
	}
}
	
// :::::::: TOPのFlash呼び出し ::::::::
function loadFlash(url,width,height){
	document.write('<object type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'">');
	document.write('<param name="movie" value="'+url+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<embed src="'+url+'" quality="high" pluginspage="http://www.macromedia.com/jp/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" />');
	document.write('</object>');
}

//no-block.tplから移動　20090407
// セレクトボックスに項目を割り当てる。
function lnSetSelect(name1, name2, id, val) {
        sele1 = document.form1[name1];
        sele2 = document.form1[name2];
        lists = eval('lists' + id);
        vals = eval('vals' + id);

        if(sele1 && sele2) {
                index = sele1.selectedIndex;

                // セレクトボックスのクリア
                count = sele2.options.length;
                for(i = count; i >= 0; i--) {
                        sele2.options[i] = null;
                }

                // セレクトボックスに値を割り当てる
                len = lists[index].length;
                for(i = 0; i < len; i++) {
                        sele2.options[i] = new Option(lists[index][i], vals[index][i]);
                        if(val != "" && vals[index][i] == val) {
                                sele2.options[i].selected = true;
                        }
                }
        }
}


// :::::::: フッターの年度取得 ::::::::
function getYear() {
var now = new Date();
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
	}
document.write(fourdigits(now.getYear()));
}

// :::::::: デバッグ ::::::::
function debug(){
	alert(accUrl);
}


// E N D
