/**
 * @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();
	//アンカーリンクをスムージング
		$("area[href^=#],a[href^=#]").smoothScroll();
	//対象の要素をスクロールに追従するようにする
		//$("#fixBox").fixPosition("stopperID","normal");
	}
	//onload
	$(function() {
		config();
	});
})(jQuery);

function fastLoader () {
	var def = "def";
	if(location.hash) {
		def = location.href.split("#")[1];
	}
	$("#modelroom")
		.find("#baseImg")
			.each(function(){
				//preload
				$(this).attr("dsrc",this.src);
				var img1 = new Image();
				var img2 = new Image();
				var img3 = new Image();
				img1.src = "imgs/01/img-01.jpg";
				img2.src = "imgs/01/img-02.jpg";
				img3.src = "imgs/01/img-03.jpg";
			})
		.end()
		.find("area.imageSwitch")
			.each(function(index){
				$(this)
                    .hover(
                        function(){
                            $("#baseImg").attr("src","imgs/01/img-0"+(index+1)+".jpg");
                        },
                        function(){
                            $("#baseImg").attr("src",$("#baseImg").attr("dsrc"));
                        }
                    )
            })
        .end()
	.end();	
}

//FUNCTION moveOpener
//pFile = file
function moveOpener(pFile){
	if(/MSIE/.test(navigator.userAgent)){
		if(typeof window.opener.name == "string"){
			opener.focus();
			void(opener.location.href = pFile);
		}else{
			window.open(pFile);
		}
	}else{
		if(opener){
			opener.focus();
			void(opener.location.href = pFile);		
		}else{
			window.open(pFile);
		}
	}
}