// ロールオーバー
j$(document).ready(function(){
	j$("img[src*='_on']").addClass("current");
	j$("img,input").mouseover(function(){
		if (j$(this).attr("src")){
		j$(this).attr("src",j$(this).attr("src").replace("_off.", "_on."));
		}
	});
	j$("img[class!='current'],input").mouseout(function(){
		if (j$(this).attr("src")){
		j$(this).attr("src",j$(this).attr("src").replace("_on.", "_off."));
		}
	});

	//外部リンクを新規ウィンドウでオープン!!大放出!!
//	j$("a[@href^=http]").click(function(){
//		window.open(this.href,"_blank");
//		return false;
//	});
});


// スクロール
j$.easing.elasout = function(x, t, b, c, d) {
	var s=1.70158;var p=0;var a=c;
	if (t==0) return b;
	if ((t/=d)==1) return b+c;
	if (!p) p=d*.3;
	if (a < Math.abs(c)) { a=c; var s=p/4; }
	else var s = p/(2*Math.PI) * Math.asin (c/a);
	return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
};
j$(document).ready(function(){
	j$("a[href^=#]").click(function(){
		j$.scrollTo( j$(j$(this).attr('href').toString()), 800,{});
		return false;
	});
});


// ページ送り
function changePage(no, page, selection) {
	if (isNaN(no)) {
		return;
	}
	if (page == null || page == "" || page == undefined) {
		return;
	}
	location.href = page + "?page=" + no + "&selection=" + selection;
}

// 表示切替
function jumpPage(id, act){
	if (id == null || id == "" || id == undefined) {
		return;
	}
	var frm = document.getElementById(id);
	if (frm != null) {
		frm.submit();
	}
}

// 表示ドロップダウンリスト初期設定
function setMenu() {
  var cls = new LocationSearch(location.search);
	var items = cls.getItems();
	var val;
	for (itm in items) {
		val = unescape(cls.item(itm));
		if (val == null || val == "" || val == undefined) {
			val = -1;
		}
		if (document.getElementById(itm) != null) {
			document.getElementById(itm).value = val;
		}
	}
}

// 表示ジャンル初期設定
function setTab() {
  var cls = new LocationSearch(location.search);
	var items = cls.getItems();
	var val;
	var isInit = true;
	for (itm in items) {
		val = unescape(cls.item(itm));
		if (val == null || val == "" || val == undefined) {
			val = -1;
		}
		if (document.getElementById(itm) != null) {
			document.getElementById(itm).className = val;
		}
		if (itm == "selection") {
			isInit = false;
		}
	}
	if (isInit) {
		document.getElementById("selectionA").className = "nowselect";
	}
}

// 別ウィンドウ表示
function openWin(t) {
	var scriptwin = window.open(t,"subWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1");
	if (scriptwin.focus != null) {
		scriptwin.focus();
	}
}

function openWin(t, w) {
	var scriptwin = window.open(t,w,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1");
	if (scriptwin.focus != null) {
		scriptwin.focus();
	}
}

