/*
============================== article ==============================

			1：初期設定
			2：リンクの点線を消す
			3：年度取得
			4：ゆっくりとTOPへスクロール
			5：Safari検索窓
			99：デバッグ

====================================================================
*/


// :::::::: 1.初期設定 ::::::::

mainUrl = "http://www.";


//:::::::: 2.リンクの点線を消す ::::::::
function linkLineDel(){
	a=document.getElementsByTagName("a");
	for(i=0;i<a.length;i++){
		a[i].onfocus=function(){this.blur();}
	}
}


// :::::::: 3.年度取得 ::::::::
function getYear() {
var now = new Date();
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
	}
document.write(fourdigits(now.getYear()));
}


// :::::::: 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))
  })
})


// :::::::: 5：Safari検索窓 ::::::::
function checkBrowser(){
	var uAgent = navigator.userAgent.toUpperCase();
	baseValue = "'サイト内検索'";
	noValue = "''";
	inputSafari = '<input type="search" id="search_box" value="サイト内検索"';
	inputOthr = '<input type="text" id="search_box" class="searchBox" value="サイト内検索"';
	safariElement = ' autosave="webdog" results="5"';
	onfocus1 = ' onfocus="if (this.value == ';
	onfocus2 = ') { this.value=';
	onblur1 = ' }" onblur="if (!this.value) { this.value=';
	onblur2 = ' }" />&nbsp;';
	outInput1 = inputSafari + safariElement + onfocus1 + baseValue + onfocus2 + noValue + onblur1 + baseValue + onblur2;
	outInput2 = inputOthr + onfocus1 + baseValue + onfocus2 + noValue + onblur1 + baseValue + onblur2;
	
 	if(uAgent.indexOf("SAFARI") >= 0){
		document.write(outInput1);
	} else {
		document.write(outInput2);
	}
}


// :::::::: 99.デバッグ ::::::::
function debug(){
	alert(mainUrl);
}


// E N D