jQuery(document).ready(function($) {
//ロールオーバー
	var postfix = '_on';
	$('.over').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);
			}
		);
	});

//スムーズスクロール
	jQuery.easing.quart = function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	};  
	$('.pageTop a').click(function () {
		$('html,body').animate({ scrollTop: 0 }, 1000, 'quart');
		return false;
	});

//ファンクションの起動
	js_window_open();

});

/*	//	ポップアップ - a要素にclass="js_window_open-width-height"でポップアップ
-----------------------------------------------------------------------------------------------------------------*/
function js_window_open(){
	var js_para = null;
	// js_para[0] = width
	// js_para[1] = height
	// js_para[2] = window.name
	$('a[class^="js_window_open"], area[class^="js_window_open"]').each(function(index){
		$(this).click(function(){
			var wo = null;
			// get window width & height
			js_para = $(this).attr('class').match(/[0-9]+/g);
			// get window.name
			window.name ? js_para[2] = window.name+'_' : js_para[2] = ('');
			wo = window.open(this.href, js_para[2]+'popup'+index,'width='+js_para[0]+',height='+js_para[1]+',scrollbars=yes');
			wo.focus();
			return false;
		});
	});
}

/*	//	opacityOver
-----------------------------------------------------------------------------------------------------------------*/
$(function(){
		   
		$(".opacityOver, .itemBoxLv2 .sideR li img, #thickbox-thumb img, #thickbox-change img").fadeTo(1,1);
		$(".opacityOver, .itemBoxLv2 .sideR li img, #thickbox-thumb img, #thickbox-change img").hover(
		  function () {
			$(this).stop().fadeTo(200, 0.7);
		  },
		  function () {
			$(this).stop().fadeTo(200, 1);
		  }
		);
		
		$(".opacityOver02").fadeTo(1,1);
		$(".opacityOver02").hover(
		  function () {
			$(this).stop().fadeTo(100, 0.5);
		  },
		  function () {
			$(this).stop().fadeTo(200, 1);
		  }
		);

});
/*	//	imgChange
-----------------------------------------------------------------------------------------------------------------*/
$(function(){
	$("#thickbox-change a").click(function(){
		$(this).attr("href","");

		//変数宣言とslice()
		var imgUrlS = $(this).children("img").attr("src");
		var imgUrlL = "";
		var pass = "";
		var ss = "";
		var txt = ".jpg";
		ss = imgUrlS.indexOf("_ss");
		pass = imgUrlS.slice(0,ss);
		//slice()結果＋".jpg"
		imgUrlL = pass + txt;
		//大きい画像に切り替え
		$("#thickbox-img img").attr("src",imgUrlL).attr("alt",$(this).children("img").attr("alt"));

		return false;


	});
});


/*	//	Firefox用CSSを呼び出し（ルート相対パスなのでサーバー上でのみ）
-----------------------------------------------------------------------------------------------------------------*/
var firefox = (navigator.userAgent.indexOf("Firefox") != -1)? true : false; 
if(firefox) document.write('<link rel="stylesheet" type="text/css" media="print" href="/common/css/fx_print.css" />');




