chkCookie();

function getRandomNum(){
	var num=Math.floor(Math.random()*10000000000)+1;
	return num;
}
function setCookie(setname,setdata){
	t = new Date();
	t.setTime(t.getTime()+(30*365*1000*60*60*24));
	expt = t.toGMTString();
	document.cookie = setname+"="+escape(setdata)+";expires="+expt+";PATH=/";
}
function getCookie(getname){
	cName = getname+"=";
	getdata = null;
	cCookie = document.cookie+";";
	start = cCookie.indexOf(cName);
	if (start != -1){
		end = cCookie.indexOf(";",start);
		getdata = unescape(cCookie.substring(start+cName.length,end));
	}
	return getdata;
}
function chkCookie(){
	//Cookieの取得
	ident = getCookie("visitor-ident");
	//なかったらセット
	if(ident==null){
		var num1=getRandomNum();
		var num2=getRandomNum();
		var num3=getRandomNum();
		setCookie("visitor-ident",String(num1) + String(num2) + String(num3));
	}
}
function submitForm() {
	//alert(document.frmLogin.userid.value);
	//alert(document.frmLogin.top_save.checked);
	if(document.frmLogin.top_save.checked == true){
		SetCookie("userid", document.frmLogin.userid.value);
		SetCookie("pass", document.frmLogin.pass.value);
		SetCookie("top_save", "on");
	}else{
		clearCookie("userid");
		clearCookie("pass");
		clearCookie("top_save");
	}

	document.frmLogin.submit();
}
/*スマートなロールオーバー*/

var defImg;
function ImgChange(target, img){
  if(document.getElementById){
    defImg = document.getElementById(target).getAttribute("src");
    document.getElementById(target).setAttribute("src", img);
  }
}
function ImgBack(target){
  if(document.getElementById){
    document.getElementById(target).setAttribute("src",defImg);
  }
}
function RollOver (obj,val) {
  obj.src = val;
} 


/*店舗ポップアップ*/
function popopen(htmlname){
window.open(htmlname,"WindowOpen1","width=650,height=670,status=no,resizable=yes,toolbar=no,scrollbars=yes");
}
function popopen2(htmlname){
window.open(htmlname,"WindowOpen1","width=780,height=670,status=no,resizable=yes,toolbar=no,scrollbars=yes");
}
function popopen3(htmlname){
window.open(htmlname,"WindowOpen1","width=370,height=300,status=no,resizable=no,toolbar=no,scrollbars=no");
}

