function init(){}

/*-------------------------------------
ロールオーバー
-------------------------------------*/
function ROfunction(){
	var imgNum=document.getElementsByTagName("img");
	var inputNum=document.getElementsByTagName("input");
	overNum=new Array;
	for(i=0;i<imgNum.length;i++){overNum[i]=imgNum[i];}
	for(i=0;i<inputNum.length;i++){overNum[i+imgNum.length]=inputNum[i];}
	for(i=0;i<overNum.length;i++){
		if(overNum[i].className.indexOf("Rover")!=-1){
			overNum[i].overimg=new Image();
			if(overNum[i].className.indexOf(":")!=-1){
				Replace=overNum[i].className.split(":");
				Replace=Replace[1].split(" ");
				overNum[i].overimg.src=Replace[0];
			}else{
				Replace = overNum[i].src.length;
				overNum[i].overimg.src=overNum[i].src.substring(0,Replace-4)+"_o"+overNum[i].src.substring(Replace-4,Replace);
			}
			overNum[i].setAttribute("out",overNum[i].src);
			overNum[i].onmouseover=new Function('this.src=this.overimg.src;');
			overNum[i].onmouseout=new Function('this.src=this.getAttribute("out");');
		}
	}
}


/*-------------------------------------
検索フォーム処理
-------------------------------------*/
function inputSwitch(obj,flag,string){
	if(flag == 'true'){
		$(obj).addClass("ac");
		if(obj.value.replace(/^[ 　]+/,"") == string) $(obj).val("");
	}
	if(flag == 'false'){
		if(obj.value.replace(/^[ 　]+/,"") == ""){
			$(obj).removeClass("ac");
			$(obj).val(string);
		}
	}
}

/*-------------------------------------
 NEWアイコン制御スクリプト
-------------------------------------*/
var nowIconDate = new Date();
function iconDateCH(year,month,day,period){
	publishDate = new Date(year,month-1,day);
	countDay = Math.floor((nowIconDate.getTime()-publishDate.getTime())/(1000*60*60*24));
	if(countDay >= 0 && countDay<period) document.write('<img src="/common/wr-img/wr2_icon_new.gif" width="26" height="11" alt="NEW!" />');
}


/*-------------------------------------
 背景色(奇数/偶数)
-------------------------------------*/
$(document).ready(function(){
	$(".topics ul").each(function(){
		jQuery(this).find("li:odd").addClass("bg");
	});
	$(".newsArea").each(function(){
		jQuery(this).find("dl:odd").addClass("bg");
	});
});


/*-------------------------------------
 角丸対応
-------------------------------------*/
$(document).ready(function(){
	$(".couner li").corner("5px keep");
	$("#CONTENTS #SIDE .pickUp").corner("5px keep");
	$("#CONTENTS #MAIN .LinkBtn").corner("5px keep");
	$("#CONTENTS #MAIN .LinkBtn").corner("5px keep");
	$("#CONTENTS #MAIN .contactArea h3").corner("5px keep");
});



/*-------------------------------------
 スムーズスクロール
-------------------------------------*/
// Easingの追加
jQuery.easing.quart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

jQuery(document).ready(function(){

	//ロールオーバーの実行
	ROfunction();

	//<a href="#***">の場合、スクロール処理を追加
	jQuery('a[href*=#HEADER]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var $target = jQuery(this.hash);
			$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				jQuery('html,body').animate({ scrollTop: targetOffset }, 1200, 'quart');
				return false;
			}
		}
	});

});



/*-------------------------------------
// 印刷時設定
-------------------------------------*/
function printsetting(printcss){

	broserType = chkBrowserType();
	cssPath = pathCommon + printcss;

//	cssPath = pathCommon + css;
	if (document.getElementById){
		printStyle = document.createElement("link");
		printStyle.setAttribute("href", cssPath);
		printStyle.setAttribute("rel", "stylesheet");
		printStyle.setAttribute("type", "text/css");
		document.getElementsByTagName('head')[0].appendChild(printStyle);
		print();
	}
}


//印刷用CSS設定
function printHandler(){
	printsetting("/common/wr-css2/common_print.css");
}



/*-------------------------------------
 左ナビゲーションの高さ取得＆表示エリア調整
-------------------------------------*/
DefaultPageContentsHeight = 0;
function setHightIframe(){
	if(top.navi.document.body.clientHeight){
		frameContentsHeight = top.navi.document.body.clientHeight;
	}else{
		frameContentsHeight = top.navi.document.height;
	}
	//IFRAMEの高さ設定
	document.getElementById("navi").height = frameContentsHeight;
}


