function shopIndexInit() {

 var rowElmts = miz$('shop-index-body').getElementsByTagName('TABLE')[0].getElementsByTagName('TR');
 var rowElmtLength = rowElmts.length;

 for (var i=0; i<rowElmtLength; i++) {
  if (!mizuyari.ua.isWinIE) {

   var colElmts = rowElmts[i].getElementsByTagName('TD');
   var colElmtLength = colElmts.length;
   for (var j=0; j<colElmtLength; j++) {
    if (mizuyari.containsClass(colElmts[j],'area')) continue;
    var AElmt = colElmts[j].parentNode.getElementsByTagName('A')[0];
    if (AElmt.target != "") {
     colElmts[j].setAttribute("onclick", "openMapWindow(this.parentNode.getElementsByTagName('A')[0].href);");
    } else {
     colElmts[j].setAttribute("onclick", "location.href = this.parentNode.getElementsByTagName('A')[0].href;");
    }
    colElmts[j].setAttribute("onmouseover", "this.style.cursor='pointer'; mizuyari.addClass(this.parentNode,'active');");
    colElmts[j].setAttribute("onmouseout", "mizuyari.removeClass(this.parentNode,'active');");
   }

   if (rowElmts[i].getElementsByTagName("A")[0]) {

    var AElmt = rowElmts[i].getElementsByTagName("A")[0];
    if (AElmt.target != "") {
     rowElmts[i].getElementsByTagName("A")[0].setAttribute("onclick", "openMapWindow(this.href); return false;");
     rowElmts[i].getElementsByTagName("A")[0].setAttribute("onkeypress", "openMapWindow(this.href); return false;");
    } else {
     rowElmts[i].getElementsByTagName("A")[0].setAttribute("onclick", "location.href = this.href;");
     rowElmts[i].getElementsByTagName("A")[0].setAttribute("onkeypress", "location.href = this.href;");
    }

   }

  } else {

   var colElmts = rowElmts[i].getElementsByTagName('TD');
   var colElmtLength = colElmts.length;
   for (var j=0; j<colElmtLength; j++) {
    if (mizuyari.containsClass(colElmts[j],'area')) continue;
    var AElmt = colElmts[j].parentNode.getElementsByTagName('A')[0];
    if (AElmt.target != "") {
     colElmts[j].setAttribute("onclick", new Function("openMapWindow(this.parentNode.getElementsByTagName('A')[0].href);"));
    } else {
     colElmts[j].setAttribute("onclick", new Function("location.href = this.parentNode.getElementsByTagName('A')[0].href;"));
    }
    colElmts[j].setAttribute("onmouseover",  new Function("this.style.cursor='pointer'; mizuyari.addClass(this.parentNode,'active');"));
    colElmts[j].setAttribute("onmouseout",  new Function("mizuyari.removeClass(this.parentNode,'active');"));
   }

   if (rowElmts[i].getElementsByTagName("A")[0]) {

    var AElmt = rowElmts[i].getElementsByTagName("A")[0];

    if (AElmt.target) {
     rowElmts[i].getElementsByTagName("A")[0].setAttribute("onclick", new Function("openMapWindow(this.href); return false;"));
     rowElmts[i].getElementsByTagName("A")[0].setAttribute("onkeypress", new Function("openMapWindow(this.href); return false;"));
    } else {
     rowElmts[i].getElementsByTagName("A")[0].setAttribute("onclick", new Function("location.href = this.href;"));
     rowElmts[i].getElementsByTagName("A")[0].setAttribute("onkeypress", new Function("location.href = this.href;"));
    }

   }

  }
 }

}

function openMapWindow(url) {
 // 700, 540
 openWindow(url,'map','width=720,height=560,toolbar=no,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,favorites=yes');
}

mizuyari.addOnLoadEvent(shopIndexInit);
