$(function(){

	//読み込み時にフェードイン
	if ( !jQuery.support.leadingWhitespace ) {
		$('#footer').removeAttr('filter');
		$('#container').removeAttr('filter');
	} else {
		$('#footer').animate({"opacity":1},500);
		$('#container').delay(1000).animate({"opacity":1},500);
	};
	
	//aタグクリック時にフェードアウト実行
if ( jQuery.support.leadingWhitespace ) {
	$('a:not([target=_blank]):not([class="nofade"])').click(function(){
			//alert("クリック");
			var url = $(this).attr("href");
			var url2 = url.substr(0,1);
			var url3 = url.substr(0,6);
			if (url2 != "#" && url3 != "mailto") {
				$('body').animate({"opacity":0},500,function(){
				location.href = url;
				});
			return false;
			};
	});
};
	
	//LazyLoadが画像読み込みの遅延を行う
	$('img:not([class="nolazy"])').lazyload({ threshold : 200 });

	//IE6判定
	var IE6 = (navigator.userAgent.indexOf("MSIE 6")>=0) ? true : false;

	if(IE6){
	//IE6用の処理
	
		//スクロールバーの無い画面で「scrollme」を消す
		var sh = $(window).height();
		var db = $(document).height();
		if (sh >= db) {
			$(".footer_scroll img").fadeOut("slow");
		}

		//スクロールポジションを取得する
		function getScrollPosition() {
			return (document.documentElement.scrollTop || document.body.scrollTop);   
		}

		//40px以上スクロールすると「scrollme」が消える
		$(window).scroll(function(){
			var scTop = getScrollPosition();
			if(scTop > 40) {
				$(".footer_scroll img").fadeOut("slow");
			} 
			if(scTop < 40) {
				$(".footer_scroll img").fadeIn("slow");
			}
		});
	
	}　else {
	//それ以外の処理
	
		//スクロールバーの無い画面で「scrollme」を消す
		var sh = $(window).height();
		var db = $(document).height();
		if (sh >= db) {
			$(".footer_scroll").fadeOut("slow");
		}

		//スクロールポジションを取得する
		function getScrollPosition() {
			return (document.documentElement.scrollTop || document.body.scrollTop);   
		}

		//40px以上スクロールすると「scrollme」が消える
		$(window).scroll(function(){
			var scTop = getScrollPosition();
			if(scTop > 40) {
				$(".footer_scroll").fadeOut("slow");
			} 
			if(scTop < 40) {
				$(".footer_scroll").fadeIn("slow");
			}
		});
	
	}
	
	//IE6用 position:fix; バグ修正パッチ
    $(function(){
        $('#footer').exFixed(); // for IE6
    });

});

