
function setUrlParam(num){
asahikei = num;
setCookie("asahikei", asahikei);
}

function setMetaText(){
asahikei = getCookie("asahikei");
document.write("訪問ページ：" + asahikei + "<br>");
if ( asahikei == 1 ){
	url="www.asahikei.co.jp/top_1.html";
}
else if( asahikei == 2 ){
	url="www.asahikei.co.jp/nabe";

}
else if( asahikei == 3 ){
	url="www.asahikei.co.jp/osechi";

}
else{
	url="www.asahikei.co.jp/top_1.html";
}

document.write("<meta http-equiv=\"Refresh\" content=\"0;URL=http://" + url + "\">");

//document.write("訪問ページ：" + asahikei + "<br>");
//document.write(" meta http-equiv=\"Refresh\" content=\"1;URL=http://" + url + "\">");

}
// clearCookie("asahikei");

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("");
}
function setCookie(key, val, tmp) {
    tmp = key + "=" + escape(val) + "; ";
    // tmp += "path=" + location.pathname + "; ";
    tmp += "path=/; ";
    tmp += "expires=Tue, 31-Dec-2030 23:59:59; ";
    document.cookie = tmp;
}
function clearCookie(key) {
    document.cookie = key + "=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
}

