$(function(){

window.setTimeout(function() {
    {$("#main-img #photo #in img,#sub-img #photo #in img").fadeIn(1000);}
      }, 1000);
window.setTimeout(function() {
    {$("#loading").fadeOut(500);}
      }, 1000);

//ロールオーバー

var postfix = '_on';
	$('#gloval-navi a img,#floating-menu a img,#company-info .info-left h3 a img,#company-info .info-right h3 a img,#header-sub-navi a img,.icon-popup a img,#bt-download a img').not('[src*="'+ postfix +'."]').each(function() {
	var img = $(this);
	var src = img.attr('src');
	var src_on = src.substr(0, src.lastIndexOf('.'))
		+ postfix
		+ src.substring(src.lastIndexOf('.'));
		$('<img>').attr('src', src_on);
		img.hover(
	function() {
		img.attr('src', src_on);
		},
	function() {
		img.attr('src', src);
			}
		);
	});

//ロールオーバーここまで

//カラムの高さ調節

//classがheightJustifyの要素に対しての処理
	$("#just-height-box").each(function(){

	//対象要素設定
		var JustifyBox = $(this).children();

	//最大の高さの取得
		var Tallest = 0;
		JustifyBox.each(function(){
			var ThisHeight = $(this).height();
			if(ThisHeight > Tallest){
				Tallest = ThisHeight;
			};
		});

	//高さを設定
		JustifyBox.height(Tallest);

	});

//カラムの高さ調節ここまで

//フォントサイズ変更

//フォントサイズ設定
	//var FontSize = [];
	//FontSize["S"] = 10;
	//FontSize["M"] = 12;
	//FontSize["L"] = 13;

//フォントサイズ変更ボタン設定
	//var ChangeBtn = "#fontsize-changer img";
	//var SearchImg = ["#fontS img","#fontM img","#fontL img"];

//フォントサイズ変更関数
	//function FontSizeSet(fs){
		//$('body p,a,th,td,dt,dd,span,address *').css("font-size",fs+"px");
	//};

//画像置換関数
	//function OnFont(){
		//$(this).attr("src",$(this).attr("src"));
	//};
	//function OvFont(io){
		//$(io).attr("src",$(io).attr("src").replace(/^(.+)(\.[a-z]+)$/,"$1_ov$2"));
	//};
	//function OffFont(io){
		//$(io).attr("src",$(io).attr("src").replace(/^(.+)_ov(\.[a-z]+)$/,"$1$2"));
	//};

//クッキー設定関数
	//function FontCookie(ck){
		//$.cookie("fontsize",ck,{path:'/',expires:7});
	//};

//クッキー確認関数
	//function CookieChack(fs){
		//return $.cookie("fontsize")==fs;
	//};

//ロード時表示設定
	//function LoadFont(fs,si){
		//FontSizeSet(FontSize[fs]);
		//OvFont(SearchImg[si]);
	//};
	//if(CookieChack("fontS")){
		//LoadFont("S",0);
	//}
	//else if(CookieChack("fontM")){
		//LoadFont("M",1);
	//}
	//else if(CookieChack("fontL")){
		//LoadFont("L",2);
	//}
	//else {
		//FontCookie("fontM");
		//LoadFont("M",1);
	//};

//画像プリロード設定
	//function ImgPreload(io){
		//$(ChangeBtn).not(SearchImg[io]).each(function(){
			//$("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/,"$1_ov$2"));
		//});
	//};
	//if(CookieChack("fontS")){
		//ImgPreload(0);
	//}
	//else if(CookieChack("fontM")){
		//ImgPreload(1);
	//}
	//else if(CookieChack("fontL")){
		//ImgPreload(2);
	//};

//ホバーイベント
	//$(ChangeBtn)
	//.hover(
	//function(){
		//if(!$(this).attr("src").match("_ov")){
			//OvFont(this);
		//};
	//},
	//function(){
		//if($(this).attr("src").match("_ov")){
			//if(CookieChack("fontS")){
				//OffFont(SearchImg[1]),OffFont(SearchImg[2]);
			//}
			//else if(CookieChack("fontM")){
				//OffFont(SearchImg[0]),OffFont(SearchImg[2]);
			//}
			//else if(CookieChack("fontL")){
				//OffFont(SearchImg[0]),OffFont(SearchImg[1]);
			//};
		//};
	//});

//クリックイベント
	//function ClickFont(ck,fs,io1,io2){
		//FontCookie(ck);
		//FontSizeSet(FontSize[fs]);
		////OffFont(SearchImg[io1]),OffFont(SearchImg[io2]);
		//OnFont();
	//};
	//$(SearchImg[0]).click(function(){
	//	ClickFont("fontS","S",1,2);
	//});
	//$(SearchImg[1]).click(function(){
	//	ClickFont("fontM","M",0,2);
	//});
	//$(SearchImg[2]).click(function(){
		//ClickFont("fontL","L",0,1);
	//});

//フォントサイズ変更スクリプトここまで


//ページ内スムーススクロール

//スクロール関数
	function Scroll(sp){
		$((navigator.userAgent.indexOf("Opera") != -1) ? document.compatMode == "BackCompat" ? "body" : "html" : "html,body").animate({scrollTop:sp},300);
	};

//クリックイベンント

	//ページのトップへ戻る場合
	$("#footer-container #page-top-navi #bt-pagetop a").click(function(){
		Scroll(0);
		return false;
	});

	//それ以外のページ内リンクの場合
	$("a[href*=#]:not(#footer-container #page-top-navi #bt-pagetop,a[href=#])").click(function(){
		var Id = this.href.substring(this.href.indexOf("#"),this.href.length),
		TargetOffset = $(Id).offset().top;
		Scroll(TargetOffset);
		return false;
	});

//ページ内スムーススクロールここまで


});


//function gonews(nid) {
	
	//location.href = "news/?nid=" + nid + "#" + nid;
//}
