var cookieName = "LawsonStore100SelectAreaID"; var cookieExp = 365; var cookieData = "zenkoku"; var newExp = "7"; var areaArray = new Array("zenkoku","tohoku","kanto","chubu","kinki","kyusyu"); var htmlArray = new Array(); var cntArray = new Array(); $(function(){ //cookie取得 if ($.cookie(cookieName)) { cookieData = $.cookie(cookieName); } //今日の日付 var today = ""; $.post("/common/js/getdate.php",{}, function (data, status) { today = data; }); //JSON取得 $.getJSON("/product/valueline/json/vl.json", function(data){ for (var i=0; i 3) continue; //HTML生成 var html = '
  • '; if (data[i].newflg) { if ( compdate(today, data[i].openday) < newExp ) { html += ''; } } html += '' + decodeURI(data[i].name) + ''; html += '

    ' + decodeURI(data[i].name) + '

  • '; htmlArray[area][category] += html; } } setHtml(cookieData); }) $(".ariaList li a[href=#"+cookieData+"] img").removeClass("js_rollover"); $(".ariaList li a[href=#"+cookieData+"] img").attr("src", "/product/images/btn_side_"+cookieData+"_on.gif"); $(".ariaList li a[href=#"+cookieData+"] img").hover( function () { $(this).attr("src", "/product/images/btn_side_"+cookieData+"_on.gif"); } ); dispArea(); /* timer = setInterval( function(){ if ( $(".mod-selectarea dl dd ul li a").length == 6 ) { $(".mod-selectarea dl dd ul li a").click(changeArea); clearInterval(timer); } }, 100); $(".ariaList li a").click(changeArea); */ }); function setHtml(area) { //野菜と果物 if ( (typeof htmlArray[area]["vegetable"] == "undefined") || (htmlArray[area]["vegetable"] == "") ) { htmlArray[area]["vegetable"] = "該当のデータはありません"; } $('#VltopVegetable').empty(); $('#VltopVegetable').append(htmlArray[area]["vegetable"]); //お肉 if ( (typeof htmlArray[area]["meat"] == "undefined") || (htmlArray[area]["meat"] == "") ) { htmlArray[area]["meat"] = "該当のデータはありません"; } $('#VltopMeat').empty(); $('#VltopMeat').append(htmlArray[area]["meat"]); //アイス if ( (typeof htmlArray[area]["icecream"] == "undefined") || (htmlArray[area]["icecream"] == "") ) { htmlArray[area]["icecream"] = "該当のデータはありません"; } $('#VltopIcecream').empty(); $('#VltopIcecream').append(htmlArray[area]["icecream"]); //飲み物 if ( (typeof htmlArray[area]["drink"] == "undefined") || (htmlArray[area]["drink"] == "") ) { htmlArray[area]["drink"] = "該当のデータはありません"; } $('#VltopDrink').empty(); $('#VltopDrink').append(htmlArray[area]["drink"]); //デザート if ( (typeof htmlArray[area]["dessert"] == "undefined") || (htmlArray[area]["dessert"] == "") ) { htmlArray[area]["dessert"] = "該当のデータはありません"; } $('#VltopDessert').empty(); $('#VltopDessert').append(htmlArray[area]["dessert"]); //冷凍食品 if ( (typeof htmlArray[area]["frozen"] == "undefined") || (htmlArray[area]["frozen"] == "") ) { htmlArray[area]["frozen"] = "該当のデータはありません"; } $('#VltopFrozen').empty(); $('#VltopFrozen').append(htmlArray[area]["frozen"]); //デイリー商品 if ( (typeof htmlArray[area]["daily"] == "undefined") || (htmlArray[area]["daily"] == "") ) { htmlArray[area]["daily"] = "該当のデータはありません"; } $('#VltopDaily').empty(); $('#VltopDaily').append(htmlArray[area]["daily"]); //雑貨 if ( (typeof htmlArray[area]["sundries"] == "undefined") || (htmlArray[area]["sundries"] == "") ) { htmlArray[area]["sundries"] = "該当のデータはありません"; } $('#VltopSundries').empty(); $('#VltopSundries').append(htmlArray[area]["sundries"]); //加工食品 if ( (typeof htmlArray[area]["processed"] == "undefined") || (htmlArray[area]["processed"] == "") ) { htmlArray[area]["processed"] = "該当のデータはありません"; } $('#VltopProcessed').empty(); $('#VltopProcessed').append(htmlArray[area]["processed"]); //パン if ( (typeof htmlArray[area]["bread"] == "undefined") || (htmlArray[area]["bread"] == "") ) { htmlArray[area]["bread"] = "該当のデータはありません"; } $('#VltopBread').empty(); $('#VltopBread').append(htmlArray[area]["bread"]); //調味料 if ( (typeof htmlArray[area]["seasoning"] == "undefined") || (htmlArray[area]["seasoning"] == "") ) { htmlArray[area]["seasoning"] = "該当のデータはありません"; } $('#VltopSeasoning').empty(); $('#VltopSeasoning').append(htmlArray[area]["seasoning"]); //お菓子 if ( (typeof htmlArray[area]["snack"] == "undefined") || (htmlArray[area]["snack"] == "") ) { htmlArray[area]["snack"] = "該当のデータはありません"; } $('#VltopSnack').empty(); $('#VltopSnack').append(htmlArray[area]["snack"]); } function dispArea() { if ( $(".mod-selectarea dl dd ul li a").length > 5 ) { $(".mod-selectarea dl dd ul li a").click(changeArea); $(".ariaList li a").click(changeArea); return; } else { wkTimer = setTimeout(dispArea, 100); } }