/*
js.js
Copyright (C) 2007 Media Promotion Link
Create:  2007-11-13
Modify: 2008-01-16
*/

$(function(){

    if ($("img.thumbShop")) {
      $("img.thumbShop").mouseover(function() {
        $("img#zoomShop").attr("src", this.src);
      });
      $("img.thumbShop").mouseout(function() {
        $("img#zoomShop").attr("src", $("a.slidea img").attr("src"));
      });
    }

    //GoogleMaps
    if ($("dl#shopAddress dd span a")) {
      $("dl#shopAddress dd span a").click(function() {
        window.open(this.href, "googlemap", "width=500, height=500, toolbar=no, menubar=yes, scrollbar=no");
        return false;
      });
    }

    //GoogleMaps
    if ($("dl.shopAddress dd span a")) {
      $("dl.shopAddress dd span a").click(function() {
        window.open(this.href, "googlemap", "width=500, height=500, toolbar=no, menubar=yes, scrollbar=no");
        return false;
      });
    }

    //GoogleMaps(search result)
    if ($("a.gmaps")) {
      $("a.gmaps").click(function() {
        window.open(this.href, "googlemap", "width=500, height=500, toolbar=no, menubar=yes, scrollbar=no");
        return false;
      });
    }


});

  function mOver(parent, obj) {
        $("img#zoomShop"+parent).attr("src", obj.src);
}
  function mOut(parent, obj) {
        var src = $("ul#imgList"+parent+" li a.slidea img").attr("src");
        $("img#zoomShop"+parent).attr("src", src);
  }


function showPopup(classname) {

      $("div#explanatoryNote").remove();
      $("."+classname).css("position", "relative");
      $("."+classname).css("display", "block");
      $("."+classname).after('<div id="explanatoryNote" style="position: absolute; width: 157px; height: 139px; padding-left:75px; top: 15px; ">'
       +'<img src="images/icon_description.gif" alt="" usemap="#mapLink" /><map name="mapLink" id="mapLink">'
       +'<area shape="rect" coords="135, 7, 150, 21" href="#" id="explanatoryNoteClose" title="閉じる" onclick="removePopup();"/></map></div>');

      $("area#explanatoryNoteClose").click(function() {
        $("div#explanatoryNote").remove();
        return false;
      });

return false;
}


function removePopup() {
}


function newMark(obj, type, days, year, mon, day) {
  date = new Date();
  source = date.getTime();
  dest = Date.UTC(year, mon-1, day);
  process = Math.floor((source-dest) / 24 / 60 / 60 / 1000);

  if (process < days) {
    if (type == 0) { //画像を表示
      classes = $("."+obj).attr("class") + " newInfo";
      $("."+obj).attr("class", classes);
    }
    if (type == 1) { //文字列を表示
    document.write('<span class="newNew"><img src="common/images/new02.gif" alt="新着" /></span>');}
  }
}

