// JavaScript Document
//画像の先読み（imgs）
data=new Array(
	"/imgs/rbtn_ov.gif",
	"/imgs/lbtn_01o.jpg",
	"/imgs/lbtn_02o.jpg",
	"/imgs/lbtn_03o.jpg",
	"/imgs/lbtn_04o.jpg",
	"/imgs/lbtn_05o.jpg",
	"/imgs/lbtn_06o.jpg",
	"/imgs/lbtn_07o.jpg",
	"/imgs/lbtn_08o.jpg",
	"/imgs/lbtn_09o.jpg",
	//"/imgs/lbtn_10o.jpg", 未存在のため削除[kuwahara]:20070929
	"/imgs/lbtn_11o.jpg",
	"/imgs/lbtn_12o.jpg",
	"/imgs/lbtn_13o.jpg",
	"/imgs/mbtn_01u.jpg",
	"/imgs/mbtn_02u.jpg",
	"/imgs/mbtn_03u.jpg");

btn=new Array();
for(i=0;i<data.length;i++){btn[i]=new Image();btn[i].src=data[i];}

//スワップイメージ
function swapImg(str,num){
	document.images[str].src ="/imgs/" + num + ".jpg";
}

//
function viewCart() {
	var sid = getCookie('PHPSESSID');
	mado=window.open( 'https://secure.kamos.co.jp/score/shopping.php?act=form&PHPSESSID='+sid , 'regist' , "width=600,height=600,scrollbars=yes,menubar=yes,toolbar=no,location=yes,directories=no,resizable=yes");
	if(navigator.appVersion.charAt(0)>=3) mado.focus();
	return true;
}


// Cookie
function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
	tmp1 = " " + document.cookie + ";";
	xx1 = xx2 = 0;
	len = tmp1.length;
	while (xx1 < len) {
		xx2 = tmp1.indexOf(";", xx1);
		tmp2 = tmp1.substring(xx1 + 1, xx2);
		xx3 = tmp2.indexOf("=");
		if (tmp2.substring(0, xx3) == key) {
			return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
		}
		xx1 = xx2 + 1;
	}
	return("");
}
