/**
 * @name main.js
 * @fileOverview
 * @version 1.0
 * @description
 * <p>(c) FOURDIGIT Inc. Licensed <a href="http://ja.wikipedia.org/wiki/GNU_General_Public_License">GNU General Public License</a>.</p>
 */
//他ライブラリと共存する場合、下の一行削除($無効化)
//jQuery.noConflict();
(function($){
	var config = function () {
	//bodyのクラスにブラウザ情報を追加
		$.addClassUA();
	//easyOverのターゲット設定
		$("img.ahover, .ahoverArea img").easyOver();
	//IE5,6にてPNG有効化 (pngfixの読み込みが必要)
		$("img[src$=png],p.png").enablePNG();
	//Flash
		//$("object, embed").enableFlash();
	//ポップアップリンクに置換
		$(".commonPop").easyPop();
	//他ドメインリンク時にpageTracker有効化
		//$("a,area").blankLogToGoogle();
	//アンカーリンクをスムージング
		$("a[href^=#]").smoothScroll();
	//対象の要素をスクロールに追従するようにする
		//$("#fixBox").fixPosition("stopperID","normal");
	}
	//onload
	$(function() {
		config();
		switch (jQuery("body").attr("id")) {
			case "pageID":
				//eachPageFunction
			break;
			case "pageID":
				//eachPageFunction
			break;
		}
	});
})(jQuery);


(function($j){
	$j.positionFixed = function(el){
		$j(el).each(function(){
			new fixed(this)
		})
		return el;					
	}
	$j.fn.positionFixed = function(){
		return $j.positionFixed(this)
	}
	var fixed = $j.positionFixed.impl = function(el){
		this.target = $j(el).css('position','fixed')
		if(!this.ie6)return;
		this.bindEvent();
	}
	$j.extend(fixed.prototype,{
		ie6 : $.browser.msie && $.browser.version < 7.0,
		bindEvent : function(){
			var target=this.target;
			target
			.css('position','absolute')
			.basePos = {
				top: parseInt(target.css('top')) || 0,
				right: parseInt(target.css('right')) || 0
			}
			target.parents().each(function(){
				var o = $j(this);
				if (o.css('position') == 'relative') 
					o.after(target)
			})
			$j(window).scroll(this.scrollEvent());
		},
		scrollEvent : function(){
			var target=this.target;
			return function(){
				target.css({
					top: $j(document).scrollTop() + target.basePos.top,
					right: $j(document).scrollLeft() + target.basePos.right
				})
			}
		}
	})
})(jQuery)

$(function(){
	if($("#floatingBnr")[0]){
		$("#floatingBnr").positionFixed();
		$("#draggable").draggable();
	}
})
function hideBnr () {
	$("#floatingBnr").fadeOut();
}
function showBnr () {
	$("#floatingBnr").fadeIn();
}

