/**
 * @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.png").enablePNG();
	//Flash
		//$("object, embed").enableFlash();
	//ポップアップリンクに置換
		$(".commonPop").easyPop();
	//他ドメインリンク時にpageTracker有効化
		//$("a,area").blankLogToGoogle();
	//アンカーリンクをスムージング
		$("a[href^=#]").smoothScroll();
	//対象の要素をスクロールに追従するようにする
		//$("#fixBox").fixPosition("stopperID","normal");
	}
	//onload
	$(function() {
		config();
		if($("body.floatNav")[0]) {
			$("#sideArea").fixPosition("footer","10");
		}
	});
})(jQuery);


$(function(){
	if($("#frameArea")[0]){
		resizeMain();
		$(window).resize(function(){
			resizeMain();
		});
		timerID = setInterval('resizeMain()', 200);
	}
});
function resizeMain(){
	var h = getWindowHeight();
	$("#frameArea").css({
		"height": (h-100-30)+"px",
		"width": "100%",
		"margin-bottom": "30px"
	});
	$("#frameMin").css({
		"height": (h-238-100-80)+"px",
		"width": "100%",
		"margin-bottom": "0"	
	});
}
function getWindowHeight() {
  return document.documentElement.clientHeight && document.compatMode && document.compatMode=="CSS1Compat" ?  (navigator.userAgent.indexOf('Opera') > -1 && parseFloat(window.opera.version()) < 9.5 ? document.body.clientHeight : document.documentElement.clientHeight) : document.body.clientHeight;
}
function drawFrame(frameSrc, isLocal) {
	var domain = "http://www.sonymusic.co.jp/";
	var onloadH = getWindowHeight();
	onloadH = onloadH-100-30;
	var iframeStr = "";
	iframeStr += '<iframe id="frameArea" frameborder="0" ';
	if(isLocal){
		iframeStr += 'src="'+frameSrc+'" ';
	}else{
		iframeStr += 'src="'+domain+frameSrc+'" ';
	}
	iframeStr += 'width="100%" height="'+onloadH+'"';
	iframeStr += '></iframe>';
	document.write(iframeStr);
}
function drawFrameMin(frameSrc,isLocal) {
	var domain = "http://www.sonymusic.co.jp/";
	var onloadH = getWindowHeight();
	onloadH = onloadH-238-100-80;
	var iframeStr = "";
	iframeStr += '<iframe id="frameMin" frameborder="0" ';
	if(isLocal){
		iframeStr += 'src="'+frameSrc+'" ';
	}else{
		iframeStr += 'src="'+domain+frameSrc+'" ';
	}
	iframeStr += 'width="100%" height="'+onloadH+'"';
	iframeStr += '></iframe>';
	document.write(iframeStr);
}
