
/**
 * 画像マウスオーバー
 *
 * @param name 属性名
 * @param file ファイル名
 */
function myImgOn(name,file) {
	document[name].src = file;
}

function myImgOf(name,file) {
	document[name].src = file;
}

/**
 * FORM遷移
 *
 * @param i mode値
 */
var _cartflg = 0;
function myCartSale(i) {
	if (_cartflg == 1) {
		alert("ただいま送信中です。しばらくお待ちください。");
		return false;
	}
	_cartflg = 1;
	document.fmCart.mode.value = i;
	document.fmCart.submit();
}

function myCartCal(i,j) {
	if (i == 'del') {
		document.fmCart.cartItcd.value = j;
		document.fmCart.action = "./cartDel.php";
		document.fmCart.submit();
	} else if (i == 'sel_del') {
		document.fmCart.cartItcd.value = 'SELECTED_DELETE';
		document.fmCart.action = "./cartDel.php";
		document.fmCart.submit();
	} else {
		document.fmCart.action = "./cartCal.php";
		document.fmCart.submit();
	}
}

/**
 * ここから独自
 *
 */

var arrayID = new Array();

// サブメニューの表示／非表示
function ctrlMenu(idName){

	if(arrayID[idName]=="1"){
		noneLayer(idName);
		arrayID[idName]="0";
	}else{
		blockLayer(idName);
		arrayID[idName]="1";
	}

}

// サブメニュー表示
function blockLayer(idName){

	if(document.getElementById)
		document.getElementById(idName).style.display = 'block';
	else if (document.all)
		document.all(idName).style.display = 'block';
}

// サブメニュー非表示
function noneLayer(idName){

	if (document.getElementById)
		document.getElementById(idName).style.display = 'none';
	else if(document.all)
		document.all(idName).style.display = 'none';

}

// ページ送りボタンのカラー変更
function onBtnOver(i) {
	if(i.style.backgroundColor = "#dedede"){
		i.style.backgroundColor = "#4aa9ff";
		i.style.color = "#ffffff";
	}else{ i.style.backgroundColor = "#474d67";
	}
}
function onBtnOut(i) {
	if(i.style.backgroundColor = "#4aa9ff"){
		i.style.backgroundColor = "#dedede";
		i.style.color = "#000000";
	}
}

// ページ送りボタンのカラー変更
function cursorFocus(i) {
	if(i.style.backgroundColor = "#ffffff"){
		i.style.backgroundColor = "#ffff99";
		i.style.color = "#000000";
		i.style.border = "1px solid";
		i.style.borderColor = "#cccccc";
	}else{ 
		i.style.backgroundColor = "#ffff99";
	}
}
function cursorOut(i) {
	if(i.style.backgroundColor = "#ffff99"){
		i.style.backgroundColor = "#ffffff";
		i.style.color = "#000000";
		i.style.border = "1px solid";
		i.style.borderColor = "#cccccc";
	}
}

// アーティストインデックス　リンク制御

var hide1;
var hide2;
var hide3;
var hide4;
var hide5;
var hide6;
var hide7;
var hide8;
var hide9;
var hide10;
var hide11;

function pdmenu(x,y) {
	clearTimeout(y);
	document.getElementById('submenu' + x).style.display="block";
	document.getElementById('submenu' + x).style.zIndex="100";
}

function pdmenuhide(x) {
	document.getElementById('submenu' + x).style.display="none";
	document.getElementById('submenu' + x).style.zIndex="10";
}

// トップページランキングエリア

// ランキングNo.1　矢印制御とキャプション出力
function rankslide(idName) {
	if (document.getElementById) {
		document.getElementById(idName).style.backgroundPositionX = '0px' ;
	}
	if (document.getElementById) {
		document.getElementById('rankingCapt2').style.display = 'none' ;
		document.getElementById('rankingCapt3').style.display = 'none' ;
		document.getElementById('rankingCapt4').style.display = 'none' ;
		document.getElementById('rankingCapt5').style.display = 'none' ;
	}
	if (document.getElementById) {
		document.getElementById('rankingCapt1').style.display = 'block' ;
	}
}

// マウスアウトで矢印を非表示
function rankslideBack(idName) {
	if (document.getElementById) {
		document.getElementById(idName).style.backgroundPositionX = '-40px' ;
		}
}

// マウスオーバーで矢印表示
function slide(idName,captId) {
	if (document.getElementById) {
		document.getElementById(idName).style.backgroundPositionY = '-128px' ;
		document.getElementById(idName).style.backgroundPositionX = '0px' ;
	}
	if (document.getElementById) {
		document.getElementById('rankingCapt1').style.display = 'none' ;
		document.getElementById('rankingCapt2').style.display = 'none' ;
		document.getElementById('rankingCapt3').style.display = 'none' ;
		document.getElementById('rankingCapt4').style.display = 'none' ;
		document.getElementById('rankingCapt5').style.display = 'none' ;
	}
	if (document.getElementById) {	
		document.getElementById(captId).style.display = 'block' ;
	}
}

// マウスアウトで矢印を非表示
function slideBack(idName) {
	if (document.getElementById) {
		document.getElementById(idName).style.backgroundPositionY = '0px' ;
		}
}


var arryID = new Array();

// サブメニューの表示／非表示
function ctrlMenu2(idName){

	if(arryID[idName]=="1"){
		noneLayer2(idName);		// noneLayerを呼ぶ：画像を非表示
		arryID[idName]="0";
	}else{
		blockLayer2(idName);		// blockLayerを呼ぶ：画像を表示
		arryID[idName]="1";
	}

}

// 該当を表示にする
function blockLayer2(idName){

	if(document.getElementById)
		document.getElementById(idName).style.display = 'block';
	else if (document.all)
		document.all(idName).style.display = 'block';

}

// 該当を非表示にする
function noneLayer2(idName){

	if (document.getElementById)
		document.getElementById(idName).style.display = 'none';
	else if(document.all)
		document.all(idName).style.display = 'none';

}


function pageShw(url) {
	window.open(url,"window_name","width=1000,height=600,scrollbars=0,resezable=1,menubar=0,toolbar=0,location=0,directories=0,status=0");
}


// AJAX CART
function ajaxCartAdd(_x,_c) {
	var _fm = document["it_" + _x];
	var _sp = document.getElementById("sp_" + _x);
	var _id = '';
	if (_c == 1) {
		_id = _fm["ih_" + _x].value;
	} else {
		_id = _fm["is_" + _x].options[_fm["is_" + _x].selectedIndex].value;
	}
	j$.ajax({
		type: "POST",
		url:  "/m/cart/cartAjx.php",
		cache: false,
		async: false,
		dataType: "script",
		data: "site=R&spanCode=" + _x + "&idetIncd=" + _id,
		error: function() { alert('通信に失敗しました。'); }
	});
}

window.onunload = function() {
	if(navigator.userAgent.indexOf("Firefox") != -1) {
		_cartflg = 0;
	}
}


