$(function(){
    $("#shopmenu .smenutable2 img").mouseover(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)_1(\.[a-z]+)$/, "$1_2$2"))
    }).mouseout(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)_2(\.[a-z]+)$/, "$1_1$2"));
    }).each(function(){
        $("<img>").attr("src",$(this).attr("src").replace(/^(.+)_1(\.[a-z]+)$/, "$1_2$2"))
    })
});

function getCookie(key) {
	var tmp1 = " " + document.cookie + ";";
	var xx1,xx2,xx3,tmp2;
	xx1 = xx2 = 0;
	var 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(tmp2.substring(xx3 + 1, xx2 - xx1 - 1));
		}
		xx1 = xx2 + 1;
	}
	return("");
}
function setCookie(key, val, lf) {
	var tmp = key + "=" + val + "; ";
	var d = new Date();
	d.setTime(d.getTime() + lf*24*60*60*1000);
	tmp += "domain=cooljapannow.jp;";
	tmp += "path=/;";
	tmp += "expires=" + d.toGMTString() + ";";
	document.cookie = tmp;
}

