//===== マウスオーバー =====//
function ImgChange(theImg) {
	cPass = theImg.src;
	chkwrd = cPass.search("_on");
	fnleng = cPass.length - 4;
	ext = cPass.substr(fnleng,4);
	if(chkwrd!=-1) {
		nPass = cPass.substr(0,chkwrd) + ext;
	} else {
		nPass = cPass.substr(0,fnleng) + "_on" + ext;
	}
	theImg.src= nPass;
}

//===== ポップアップウィンドウ =====//
function initOpenNewWindow() {
	var popupEvent = function(event) {
		window.open(this.href);
		event.preventDefault();
		event.stopPropagation();
	}
	$("a.cart").each(function(i) { $(this).click(popupEvent); $(this).keypress(popupEvent);});
	$("a.btCart").each(function(i) { $(this).click(popupEvent); $(this).keypress(popupEvent);});
	$("a.login").each(function(i) { $(this).click(popupEvent); $(this).keypress(popupEvent);});
	$("a.store").each(function(i) { $(this).click(popupEvent); $(this).keypress(popupEvent);});
	$("a.map").each(function(i) { $(this).click(popupEvent); $(this).keypress(popupEvent);});
	$("a.gLink").each(function(i) { $(this).click(popupEvent); $(this).keypress(popupEvent);});
}
$(document).ready(initOpenNewWindow);

//===== サブウィンドウ =====//
function initOpenSubWindow() {
	var popupEvent = function(event) {
		window.open(this.href,"subwin","width=520,height=700,scrollbars=no");
		event.preventDefault();
		event.stopPropagation();
	}
	$("a.subwin").each(function(i) { $(this).click(popupEvent); $(this).keypress(popupEvent);});
	$("a.contact").each(function(i) { $(this).click(popupEvent); $(this).keypress(popupEvent);});
}
$(document).ready(initOpenSubWindow);


