// UTILITY

var toid = "";
var oDummyDiv = document.createElement("DIV");
function SaymallCatalog_createElement (html)/*{{{*/
{
  oDummyDiv.insertAdjacentHTML('afterBegin', html);
  var oEl = oDummyDiv.children(0);
  while (oDummyDiv.children.length > 0) {
    oDummyDiv.removeChild(oDummyDiv.children(0));
  }
  return oEl;
}/*}}}*/
function SaymallCatalog_displayElement (obj)/*{{{*/
{
  document.write("<div id=SaymallCatalog_divTemp></div>\n");
  document.all.SaymallCatalog_divTemp.insertAdjacentElement('afterBegin', obj);
  document.all.SaymallCatalog_divTemp.removeNode();
}/*}}}*/
function SaymallCatalog_displayTableOfHrBorder (innerHTML, borderFrame, align, width, height, borderColor, backgroundColor)/*{{{*/
{
  if (!align) align = 'left';
  if (!width) width = '100%';
  if (!height) height = 26;
  if (!borderFrame) borderFrame = 'hsides';
  if (!borderColor) borderColor = '#B9A1EA';
  if (!backgroundColor) backgroundColor = '#ECECFF';

  var cat1 = cat.substr(0, 10);
  var oMenubar = [];
  if(height == 0 || "_crt" == cat ) {
    oMenubar.back =  "";
    oMenubar.next =  "";
  //} else if ("1000000224"==cat1 ) {
  } else if ("1000000224"==cat1 || cat1.substr(0, 4) == "_chp") {
      var mWidth = 550;
      var mLeft = 500;   
      var lengthLimit = 1750;   

    oMenubar.back =  ""
      + "  <td id=menu_"+borderFrame+"_back width=25>"
      + getJsLink("SaymallCatalog_moveCatList('back',"+mWidth+","+mLeft+","+lengthLimit+")", "<img id=ImgmenuBack_"+borderFrame+" src='"+IMG_PREFIX+"/saymall/menu_back.gif' border=0 align=absmiddle>")
      + " </td>";
    oMenubar.next =  ""
      + "  <td id=menu_"+borderFrame+"_next width=25>"
      + getJsLink("SaymallCatalog_moveCatList('next',"+mWidth+","+mLeft+","+lengthLimit+")", "<img id=ImgmenuNext_"+borderFrame+" src='"+IMG_PREFIX+"/saymall/menu_next.gif' border=0 align=absmiddle>")
      + "  </td>";
  } else {
    oMenubar.back =  "";
    oMenubar.next =  "";
  }

  document.write(""
    + "<table cellspacing=0 cellpadding=0"
    + "   width="+width+" height="+height
    + "   bgcolor="+backgroundColor+" bordercolor="+borderColor
    + "   border=1 frame="+borderFrame+" rules=rows"
    + "   style='table-layout:fixed; border-collapse:collapse; border-style:solid; border:0'>"
    + "<tr>"
    + "  <td width=10></td>"
    + oMenubar.back
    + "  <td align="+align+">"+innerHTML+"</td>"
    + oMenubar.next
    + "</tr>"
    + "</table>"
  );

  if(height != 0 && ("1000000224"==cat1 || cat1.substr(0, 4) == "_chp")) {
  if('undefined' == typeof(document.all["spanCatList_"+borderFrame]))
  {
    document.all["menu_"+borderFrame+"_back"].innerHTML="";
    document.all["menu_"+borderFrame+"_next"].innerHTML="";
  }
  else
  {
    if(document.all["spanCatList_"+borderFrame].innerHTML == "") {
       document.all["menu_"+borderFrame+"_back"].innerHTML="";
       document.all["menu_"+borderFrame+"_next"].innerHTML="";
    }else{
      var movenum = Math.ceil(parseInt(document.all["spanCatList_above"].innerHTML.length)/lengthLimit);
      if(movenum>1)
      document.all["ImgmenuNext_"+borderFrame].src = IMG_PREFIX+"/saymall/menu_next_ani.gif";
    }
  }
  }

}/*}}}*/

// CATEGORY Ã³¸®
function SaymallCatalog_updateCatLogo (bDetail)/*{{{*/
{
  if('undefined' != typeof(document.all.spanLocationOfGNB))
  {
    var LocationList = [];
    LocationList[LocationList.length] = "<a href='http://www.sayclub.com'>Home</a>";
    LocationList[LocationList.length] = "<a href='http://saymall.sayclub.com'>¼¼ÀÌ¸ô</a>";
    if (cat4 == '_coordi')
    {
      LocationList[LocationList.length] = "<a href='http://saymall.sayclub.com/saymall_catalog.nwz?cat=_coordi'>ÄÚµð¼¥</a>";
      LocationList[LocationList.length] = "»ó¼¼Á¤º¸";
    }
    else if('_' == cat1)
      LocationList[LocationList.length] = Category_getTitle(cat);
    else
    {
      if(cat.length >=10)
      LocationList[LocationList.length] = "<a href='http://saymall.sayclub.com/saymall_catalog.nwz?cat=" + cat1 + "'>" + Category_getTitle(cat1) + "</a>";
 
      if(cat.length >=20)
    {
    if(cat2 == "1000000001_1000002159")
      LocationList[LocationList.length] = Category_getTitle(cat2);
    else if(cat2 == "1000000224_1000003001") ; //by madscv Event
    else
      LocationList[LocationList.length] = "<a href='http://saymall.sayclub.com/saymall_catalog.nwz?cat=" + cat2 + "'>" + Category_getTitle(cat2) + "</a>";
    }
      if(bDetail)
      {
        //if (cat3 == '1000000113_1000000114_1000000120')
        //  LocationList[LocationList.length] = "<a href='http://contents.sayclub.com/magic/contents_list.nwz?cat=contents_fortune_all'>¿î¼¼</a>";
        //else if (cat3 == '1000000113_1000000114_1000000122')
        if (cat3 == '1000000113_1000000114_1000000122')
          LocationList[LocationList.length] = "<a href='http://contents.sayclub.com/magic/contents_list.nwz?cat=luck'>º¹±Ç</a>";
    else if(cat3.substr(0,21) == "1000000001_1000002159")
      LocationList[LocationList.length] = "<a href='http://saymall.sayclub.com/saymall_catalog.nwz?cat="+Category_getSubTop(cat3)+"'>"+Category_getTitle(cat3)+"</a>";
        else
          LocationList[LocationList.length] = "<a href='http://saymall.sayclub.com/saymall_catalog.nwz?cat=" + cat3 + "'>" + Category_getTitle(cat3) + "</a>";

        LocationList[LocationList.length] = "»ó¼¼Á¤º¸";
      //LocationList[LocationList.length] = "<a href='http://saymall.sayclub.com/saymall_catalog.nwz?cat="+Category_getSubTop(cat3)+">"+Category_getTitle(cat3)+"</a>";
      }
      else 
      {
        if(cat.length >=30)
        LocationList[LocationList.length] = Category_getTitle(cat3);
      }
    }
    document.all.spanLocationOfGNB.innerHTML = LocationList.join(" > ");
  }

  if("_CP_" == cat.substr(0,4) && cat.length !=14)//ºê·£µåº° º¸±â ´­·¶À»¶§-ÀüÃ¼ º¸±â
  {
    document.all.tableCatLogo2.style.display = 'block';
    document.all.tableCatLogo.style.display = 'none';
    document.all.spanCat3Title2.innerText = Category_getTitle(cat4);
    document.all.spanCat3ItemCount2.innerText = ' (' + CntList_getItemCount(cat4, sex) + ')';
  }
  else if("_CP_" == cat.substr(0,4) && cat.length == 14)
  {
    if(cat == "_CP_1000000010")//fila
    {
      document.all.imgCat2.src = IMG_PREFIX + "/saymall/fashion/img_fila_logo.gif";
      //document.all.imgCat3.src = IMG_PREFIX + "/saymall/fashion/img_fila_photo.gif";
      document.all.imgCat3.src = IMG_PREFIX + "/saymall/fashion/img_fila_photo2.gif";
    }
    else if(cat == "_CP_1000000047")//Thursday island
    {
      document.all.imgCat2.src = IMG_PREFIX + "/saymall/fashion/img_thursday_logo.gif";
      document.all.imgCat3.src = IMG_PREFIX + "/saymall/fashion/img_thursday_photo.gif";
    }
    else if(cat == "_CP_1000000060")//Ngene
    {
      document.all.imgCat2.src = IMG_PREFIX + "/saymall/fashion/img_ngene_logo.gif";
      document.all.imgCat3.src = IMG_PREFIX + "/saymall/fashion/img_ngene_photo.gif";
    }
    else if(cat =="_CP_1000000101")//AMH
    {
      document.all.imgCat2.src = IMG_PREFIX + "/saymall/fashion/img_amh_logo.gif";
      document.all.imgCat3.src = IMG_PREFIX + "/saymall/fashion/img_amh_photo.gif";
    }
    else//etc
    {
      document.all.tableCatLogo2.style.display = 'block';
      document.all.tableCatLogo.style.display = 'none';
      document.all.spanCat3Title2.innerText = Category_getTitle(cat4);
      document.all.spanCat3ItemCount2.innerText = ' (' + CntList_getItemCount(cat4, sex) + ')';
    }  
  }
  else if("_coordi" == cat)
  {
    document.all.tableCatLogo.style.display = 'block';
    document.all.tableCatLogo2.style.display = 'none';
    document.all.spanCat2Title.innerText = "Ä³¸¯ÅÍ¸ô";
    document.all.spanCat3Title.innerText = 'ÄÚµð¼¥';
    document.all.spanCat3ItemCount.innerText = '';
    document.all.imgCat2.style.display = "none";
    document.all.imgCat2.src = IMG_PREFIX + "/saymall/logo_1000000001_1000000431.gif";
    document.all.imgCat2.style.display = "block";
  }
  else if ("_" == cat1) {
    document.all.tableCatLogo2.style.display = 'block';
    document.all.tableCatLogo.style.display = 'none';
    document.all.spanCat3Title2.innerText = Category_getTitle(cat4);
    document.all.spanCat3ItemCount2.innerText = ' (' + CntList_getItemCount(cat4, sex) + ')';
  }
  else if(cat.length == 10)
  {
    document.all.tableCatLogo.style.display = 'block';
    document.all.tableCatLogo2.style.display = 'none';
    document.all.spanCat2Title.innerText = Category_getTitle(cat1);
    document.all.spanCat3Title.innerText = '';
    document.all.spanCat3ItemCount.innerText = '';
    document.all.imgCat2.style.display = "none";
    document.all.imgCat2.src = IMG_PREFIX + "/saymall/logo_" + cat2 + ".gif";
    document.all.imgCat2.style.display = "block";
  }
  else if(cat.length == 21)
  {
    document.all.tableCatLogo.style.display = 'block';
    document.all.tableCatLogo2.style.display = 'none';
    if (cat.substr(0,21) != '1000000001_1000000532')
    {
      document.all.spanCat2Title.innerText = Category_getTitle(cat1);
      document.all.spanCat3Title.innerText = Category_getTitle(cat2);
      document.all.spanCat3ItemCount.innerText = ' (' + CntList_getItemCount(cat2, sex) + ')';
      document.all.imgCat2.style.display = "none";
      document.all.imgCat2.src = IMG_PREFIX + "/saymall/logo_" + cat2 + ".gif";
      document.all.imgCat2.style.display = "block";
    }
  }
  else {
    document.all.tableCatLogo.style.display = 'block';
    document.all.tableCatLogo2.style.display = 'none';

    if(cat=="1000000001_1000000431_1000002121")//Ä³¸¯ÅÍ ÄÝ·º¼Ç - º½ ÆÐ¼Ç ÃàÁ¦ - ÀüÃ¼ º¸±â
    {
      document.all.tableCatLogo.style.display='none';
      document.all.tableCatLogo2.style.display='block';
      document.all.spanCat3Title2.innerText = Category_getTitle(cat3);
      document.all.spanCat3ItemCount2.innerText = ' (' + CntList_getItemCount(cat3, sex) + ')';
    } 
    else if(cat.substr(33,10)=="1000002127" || cat.substr(33,10) == "1000000285")//fila
    {
      document.all.imgCat2.src = IMG_PREFIX + "/saymall/fashion/img_fila_logo.gif";
      document.all.imgCat3.src = IMG_PREFIX + "/saymall/fashion/img_fila_photo.gif";
    }
    else if(cat.substr(33,10)=="1000002125" || cat.substr(33,10) == "1000000282")//Ngene
    {
      document.all.imgCat2.src = IMG_PREFIX + "/saymall/fashion/img_ngene_logo.gif";
      document.all.imgCat3.src = IMG_PREFIX + "/saymall/fashion/img_ngene_photo.gif";
    }
    else if(cat.substr(33,10)=="1000002122" || cat.substr(33,10) =="1000001122" || cat.substr(33,10) == "1000000379")//AMH
    {
      document.all.imgCat2.src = IMG_PREFIX + "/saymall/fashion/img_amh_logo.gif";
      document.all.imgCat3.src = IMG_PREFIX + "/saymall/fashion/img_amh_photo.gif";
    }else if(cat.substr(33,10)=="1000002126"|| cat.substr(33,10)=="1000000281")//Thursday island
     {
      document.all.imgCat2.src = IMG_PREFIX + "/saymall/fashion/img_thursday_logo.gif";
      document.all.imgCat3.src = IMG_PREFIX + "/saymall/fashion/img_thursday_photo.gif";
    }else if (cat.substr(0,21) != '1000000001_1000000532')
    {
      document.all.spanCat2Title.innerText = Category_getTitle(cat2);
      document.all.spanCat3Title.innerHTML = Category_getTitle(cat3);
      document.all.spanCat3ItemCount.innerText = ' (' + CntList_getItemCount(cat3, sex) + ')';
      document.all.imgCat2.style.display = "none";
      document.all.imgCat2.src = IMG_PREFIX + "/saymall/logo_" + cat2 + ".gif";
      document.all.imgCat2.style.display = "block";
    }

  }
}/*}}}*/
function SaymallCatalog_displayCatLogo (bDetail)/*{{{*/
{
  var strGiftHTML = "";
  if ('fortune'==giftfor) {
    // º¹±Ç »ó¼¼º¸±âÀÏ ¶§
    strGiftHTML = ""
      + "<font color=#CC6600>º¹±Ç¸í´ç! Áï¼®º¹±Ç 1µî ´çÃ·ÀÚ Åº»ý</font>&nbsp;"
      + "<img src='"+IMG_PREFIX+"/saymall/19_icon.gif' width=26 height=26 align=absmiddle>";
  }
  else {
    // ÀÏ¹ÝÀûÀÎ °æ¿ì
    var strGiftLink = "";
    if("1000000113"==cat.substr(0, 10) || "_mhp"==cat)
      strGiftLink = "<a href='http://saymall.sayclub.com/saymall_my_magic.nwz'>¢Ñ&nbsp;³ªÀÇ ¾ÆÀÌÅÛ</a>";
    else if("1000000224_1000000265"==cat.substr(0, 21) || "_chp" == cat.substr(0,4))
      strGiftLink = "<a href='javascript:openMyHompy('controlmenu=skin');'>¢Ñ&nbsp;½ºÅ² ¹Ù²Ù±â</a>";
    else if("1000000224_1000003039"==cat.substr(0, 21))
      strGiftLink = "<a href='javascript:openMyHompy('controlmenu=deco');'>¢Ñ&nbsp;½ºÅ²µ¥ÄÚ¾ÆÀÌÅÛ ²Ù¹Ì±â</a>";
    else if("1000000224_1000000268"==cat.substr(0, 21))
      strGiftLink = "<a href='javascript:openMyHompy('controlmenu=playroom');'>¢Ñ&nbsp;¸»Ç³¼± ¹Ù²Ù±â</a>";
    else if("1000000224_1000000225"==cat.substr(0, 21) || "1000000224"==cat.substr(0, 10))
      strGiftLink = "<a href='javascript:openMyHompy('controlmenu=playroom');'>¢Ñ&nbsp;³ªÀÇ È¨ÇÇ°ü¸®</a>";
    else if (''==giftfor && 'F'==sex)
      strGiftLink = ""
        + "<img src='"+IMG_PREFIX+"/ico_my_buy.gif' width=15 height=16 align=absmiddle> "
        + "<a href='http://saymall.sayclub.com/saymall_catalog.nwz?giftfor=M&cat=" + cat + "' onclick='AppletSession.setvalue(\"CharList_PutOn\", \"\")'>³²ÀÚÀÇ»ó ¼±¹°ÇÏ±â</a>";
    else if(''==giftfor && 'M'==sex)
      strGiftLink = ""
        + "<img src='"+IMG_PREFIX+"/ico_my_buy.gif' width=15 height=16 align=absmiddle> "
        +  "<a href='http://saymall.sayclub.com/saymall_catalog.nwz?giftfor=F&cat=" + cat + "' onclick='AppletSession.setvalue(\"CharList_PutOn\", \"\")'>¿©ÀÚÀÇ»ó ¼±¹°ÇÏ±â</a>";
    else if('F'==giftfor)
      strGiftLink = ""
        + "<img src='"+IMG_PREFIX+"/ico_my_buy.gif' width=15 height=16 align=absmiddle> "
        + "<a href='http://saymall.sayclub.com/saymall_catalog.nwz?cat=" + cat + "' onclick='AppletSession.setvalue(\"CharList_PutOn\", \"\")'>³²ÀÚÀÇ»ó ¼îÇÎÇÏ±â</a>";
    else if('M'==giftfor)
      strGiftLink = ""
        + "<img src='"+IMG_PREFIX+"/ico_my_buy.gif' width=15 height=16 align=absmiddle> "
        + "<a href='http://saymall.sayclub.com/saymall_catalog.nwz?cat=" + cat + "' onclick='AppletSession.setvalue(\"CharList_PutOn\", \"\")'>¿©ÀÚÀÇ»ó ¼îÇÎÇÏ±â</a>";

    if (strGiftLink) {
      strGiftHTML = ""
        + "<b>"+strGiftLink+"</b>";
    }
  }
  
  // "_" == cat1
  document.write(""
    + "<table id=tableCatLogo2 border=0 width=610 cellspacing=0 cellpadding=0"
    + "  style='table-layout:fixed; display:none;'>"
    + "<col width=15><col width=595>"
    + "  <tr>"
    + "   <td height=17></td>"
    + "   <td></td>"
    + "  </tr>"
    + "  <tr>"
    + "   <td bgcolor=#C0C0C0 height=1></td>"
    + "   <td bgcolor=#C0C0C0></td>"
    + "  </tr>"
    + "  <tr>"
    + "   <td bgcolor=#ECECEC height=28></td>"
    + "   <td bgcolor=#ECECEC>"
    + "     <table cellpadding=0 cellspacing=0 border=0 width=98% style='table-layout:fixed;'>"
    + "     <tr>"
    + "       <td width=20>"
    + "         <table cellpadding=0 cellspacing=0 border=0 width=13 height=13 style='table-layout:fixed;'>"
    + "         <tr> "
    + "           <td bgcolor=#918BE3 width=13><img src='"+IMG_PREFIX+"/ico_titlebar.gif' width=13 height=13 align=absmiddle border=0></td>"
    + "         </tr>"
    + "         </table>"
    + "       </td>"
    + "       <td width=400><SPAN id=spanCat3Title2 style='font-weight:bold'></SPAN>"
    + "    <SPAN id=spanCat3ItemCount2 style='FONT-SIZE: 8pt'></SPAN></td>"
    + "       <td align=right>"+strGiftHTML
    + "       </td>"
    + "     </tr>"
    + "     </table>"
    + "   </td>"
    + " </tr>"
    + " <tr>"
    + "   <td bgcolor=#C0C0C0 height=1></td>"
    + "   <td bgcolor=#C0C0C0></td>"
    + " </tr>"
    + "</table>"
  );
  
  if(cat.substr(0,4)== "_CP_" || cat.substr(0,32) == "1000000001_1000000431_1000002121" ||
           cat=="1000000001_1000000002_1000000283_1000000285" ||
           cat=="1000000001_1000000002_1000000007_1000000281" || 
           cat=="1000000001_1000000002_1000000007_1000000282" || 
           cat=="1000000001_1000000002_1000000007_1000000379" ||
           cat=="1000000001_1000000002_1000000011_1000001122")
  { /* {{{ */
    document.write(""
      +"<div id=tableCatLogo>"
      +"<table  width='610' border='0' cellspacing='0' cellpadding='0' background='http://filei.sayclub.kr/images/tiffany/saymall/fashion/img_top.gif' height=30>"
      +" <tr width='610'>"
      +"  <td width=12 height=30></td>"
      +"  <td width=217 height=30><img id=imgCat2 src='"+IMG_PREFIX+"/saymall/fashion/img_ngene_logo.gif'></td>"
      +"  <td>"
      +"  <table border='0' cellspacing='0' cellpadding='0'>"
      +"  <tr>"
      +"   <td width=20><a href='http://hompy.sayclub.com/'><img src='http://filei.sayclub.kr/images/tiffany/hompy/favorite_ico.gif' border=0 align=absmiddle width=17 height=17></a></td>"
      +"   <td width=102 >´Ù¸¥ ºê·£µå º¸±â</td>"
      +"      <td><script>SS_write(\""
      +"           <select style='width:110px;height=20;' onchange='SaymallCatalog_moveCat(this.value)'>"
      +"           <option value=-1> - ºê·£µå ¼±ÅÃ - </option>"
      +"           <option value='_CP_1000000101'>AMH</option>"
      +"           <option value='_CP_1000000047'>Thursday Island</option>"
      +"           <option value='_CP_1000000060'>Ngene</option>"
      +"           <option value='_CP_1000000010'>FILA</option>"
      +"           </select>\",5)</script>"
      +"      </td>"
      +"    </tr>"
      +"  </table>"
      +"  </td>"
      +"  <td width=20 align=center><img src='"+IMG_PREFIX+"/saymall/fashion/img_line.gif'></td>"
      +"  <td width=133>"+strGiftHTML+"</td>"
      +"  </tr>"
      +"</table>"
      +"<table width='610%' border='0' cellspacing='0' cellpadding='0'>"
      +"  <tr>"
      +"     <td height=1></td>"
      +"  </tr>"
      +"</table>"
      +"<table width='610' border='0' cellspacing='7' cellpadding='0' background='"+IMG_PREFIX+"/saymall/fashion/img_bottom.gif' height=103>"
      +"   <tr>"
      +"    <td width=431 bgcolor='#F3EAF4' align=center><img id=imgCat3 src='"+IMG_PREFIX+"/saymall/fashion/img_ngene_photo.gif' border=0 width='429' height='87'></td>"
      +"    <td width=159>"
      +"     <table width='100%' border='0' cellspacing='0' cellpadding='0' valign='top'>"
      +"      <tr valign=bottom>"
      +"        <td height=21><img src='"+IMG_PREFIX+"/saymall/fashion/img_event.gif'></td>"
      +"      </tr>"
      +"      <tr>"
      +"        <td height=7></td>"
      +"      </tr>"
      +"      <tr valign=top>"
      +"      <td height=61><b><font color=#E10000><font></b><br>"
      +"       <a href='#'></a><br>"
      +"      </td>"
      +"      </tr>"
      +"     </table>"
      +"    </td>"
      +"   </tr>"
      +"</table>"
      +"</div>"
    );
  } /* }}} */
  else
  {
    document.write(""
      + "<table id=tableCatLogo border=0 width=610 cellspacing=0 cellpadding=0"
      + "  style='table-layout:fixed; display:none;'>"
      + "<col width=74><col width=78><col width=15><col><col width=105><col width=160><col width=16>"
      + "<tr valign=bottom height=17 bgcolor=#FFFFFF>"
      + "  <td rowspan=2><img id=imgCat2 src='"+IMG_PREFIX+"/saymall/logo_"+cat2+".gif' width=74 height=45></td>"
      + "  <td colspan=6></td>"
      + "</tr>"
      + "<tr height=28>"
      + "  <td bgcolor=#C0C0C0><SPAN id=spanCat2Title style='font-weight:bold; color:#FFFFFF;'></SPAN></td>"
      + "  <td bgcolor=#ECECEC><img src='"+IMG_PREFIX+"/saymall/ttl_img03.gif' width=13 height=28></td>"
      + "  <td bgcolor=#ECECEC><SPAN id=spanCat3Title style='font-weight:bold; margin-left:10px;'></SPAN>"
      + "    <SPAN id=spanCat3ItemCount style='FONT-SIZE: 8pt'></SPAN></td>"
      + "  <td bgcolor=#ECECEC>"+SaymallCatalog_cat4SelectList()+"</td>"
      + "  <td bgcolor=#ECECEC align=right >"+strGiftHTML+"</td>"
      + "  <td bgcolor=#ECECEC>&nbsp;</td>"
      + "</tr>"
      + "</table>"
    );
  }

  SaymallCatalog_updateCatLogo(bDetail);
}/*}}}*/

//----------- CAT4 ¸®½ºÆ® Ãâ·ÂÇÏ±â by madscv --------------------//
function SaymallCatalog_cat4SelectList()/*{{{*/
{
  return "";
  if ("1000000001_1000002159" != cat2 || cat == "1000000001_1000002159")  //--- by madscv
    return "";
  var pCat = ('_'!=cat1) ? cat : cat4;
    if('_'!=cat1 && cat.length > 40)
      pCat = cat3;

    var SubCatList = Category_getSubList(pCat);

    var CatTitleList = [];
    CatTitleList[pCat] = '´Ù¸¥Ä³¸¯ÅÍº¸±â';
    for (var i in SubCatList) {
      if(CntList_getItemCount(SubCatList[i], sex) > 0)
        CatTitleList[SubCatList[i]] = Category_getTitle(SubCatList[i]);
    }
 
  var strTmpOption = "";
  var strCatOption = ""
    + "<script>SS_write(\"<select name=catoption style='width:110;font-size:9pt' onChange='javascript:SaymallCatalog_moveCat4(this.value);'>";
  for (var cat_i in CatTitleList) {
    if(CntList_getItemCount(cat_i, sex) > 0)
    {
      strTmpOption += ""
      +  "<option value='"+cat_i+"' "
      + (cat_i==cat ? "selected='selected'" : "")+">"+CatTitleList[cat_i]+"</option>";
    }
  }

  if(strTmpOption != "")
  {
    strCatOption += strTmpOption+"</select>\");</script>";
    return strCatOption;
  }
  return "";
}/*}}}*/

function SaymallCatalog_moveCat4(cat4)/*{{{*/
{
  if(cat4.length != 43)
    return false;
  else
    SaymallCatalog_moveCat(cat4);
}/*}}}*/


function SaymallCatalog_moveCatList (direct,width,moveLeft,lengthLimit)/*{{{*/
{
  if(!width) width = 550;
  if(!moveLeft) moveLeft= 500;
  if(!lengthLimit) lengthLimit= 1000;
  var curPixelLeft = parseInt(document.all["spanCatList_above"].style.pixelLeft);
  var ImgMenu = [];
  ImgMenu.menu_back = IMG_PREFIX+"/saymall/menu_back.gif";
  ImgMenu.menu_back_ani = IMG_PREFIX+"/saymall/menu_back_ani.gif";
  ImgMenu.menu_next = IMG_PREFIX+"/saymall/menu_next.gif";
  ImgMenu.menu_next_ani = IMG_PREFIX+"/saymall/menu_next_ani.gif";
  var maxnum = Math.ceil(parseInt(document.all["spanCatList_above"].innerHTML.length)/lengthLimit);
  
  if(direct == "next") {
    var maxnum = Math.ceil(parseInt(document.all["spanCatList_above"].innerHTML.length)/lengthLimit);
    var leftPos = Math.abs(curPixelLeft) + moveLeft;
    var curnum = leftPos/moveLeft + 1;

    if(curnum > maxnum)
      return; 

    document.all["spanCatList_above"].style.clip="rect(0 "+eval(leftPos+width)+" 12 "+leftPos+")";
    document.all["spanCatList_above"].style.pixelLeft = eval(curPixelLeft-moveLeft); 
    document.all["spanCatList_below"].style.clip="rect(0 "+eval(leftPos+width)+" 12 "+leftPos+")";
    document.all["spanCatList_below"].style.pixelLeft = eval(curPixelLeft-moveLeft); 

  }else if(direct == "back") {
    var leftPos = Math.abs(curPixelLeft) - moveLeft;
    var curnum = Math.abs(curPixelLeft)/moveLeft;
    if(leftPos < 0)
      return false;
    document.all["spanCatList_above"].style.clip="rect(0 "+eval(leftPos+width)+" 12 "+leftPos+")";
    document.all["spanCatList_above"].style.pixelLeft = eval(curPixelLeft+moveLeft);
    document.all["spanCatList_below"].style.clip="rect(0 "+eval(leftPos+width)+" 12 "+leftPos+")";
    document.all["spanCatList_below"].style.pixelLeft = eval(curPixelLeft+moveLeft);
  }

  if( parseInt(curnum+1) <= maxnum) {
    document.all["ImgmenuNext_above"].src = ImgMenu.menu_next_ani;
    document.all["ImgmenuNext_below"].src = ImgMenu.menu_next_ani;
  }else {
    document.all["ImgmenuNext_above"].src = ImgMenu.menu_next;
    document.all["ImgmenuNext_below"].src = ImgMenu.menu_next;
  }

  if(parseInt(curnum-1) > 0) {
    document.all["ImgmenuBack_above"].src = ImgMenu.menu_back_ani;
    document.all["ImgmenuBack_below"].src = ImgMenu.menu_back_ani;
  }else {
    document.all["ImgmenuBack_above"].src = ImgMenu.menu_back;
    document.all["ImgmenuBack_below"].src = ImgMenu.menu_back;
  }

}/*}}}*/
function SaymallCatalog_changeImgMenu () {/*{{{*/
}/*}}}*/
function SaymallCatalog_updateSortList (whereFrame)/*{{{*/
{
  if ("_"==cat1 || ("1000000001_1000000052_1000000058"==cat3 && bLogged))
  {
  if(cat.substr(0,4) == "_chp")
    eval("document.all.divSortList_"+whereFrame+".style.display = 'block'");
  else
    eval("document.all.divSortList_"+whereFrame+".style.display = 'none'");
  }
  else
    eval("document.all.divSortList_"+whereFrame+".style.display = 'block'");
}/*}}}*/
function SaymallCatalog_displaySortList (whereFrame)/*{{{*/
{
  // Sort View Image Button - by madscv (2004/07/18)
  var SortList = [];
  SortList['regdate'] = "sort_regdate";
  SortList['popular'] = "sort_popular";
  SortList['point'] = "sort_point";
  var strSortOption = "";
  for (var sort_i in SortList) {
  var sort_sel = "";
    if(sort_i==sort) sort_sel = "_sel";
    strSortOption += ""
    +  "<a href=javascript:SaymallCatalog_moveSort('"+sort_i+"');><img src='http://filei.sayclub.kr/images/saymall/"+SortList[sort_i]+sort_sel+".gif' border='0'></a> "
  }
  return strSortOption;

}/*}}}*/
function SaymallCatalog_toggleButton (obj)/*{{{*/
{
  if ('none'==obj.childNodes(0).style.display) {
    obj.childNodes(0).style.display = 'inline';
    obj.childNodes(1).style.display = 'none';
  }
  else {
    obj.childNodes(1).style.display = 'inline';
    obj.childNodes(0).style.display = 'none';
  }
}/*}}}*/

// ITEM Ã³¸®
var oPanelTable;
function SaymallCatalog_getItemTable (oItem)/*{{{*/
{
  if('1000000224' == cat1 || '_nhp' == cat1 || '_nhp' == cat)
    ITEM_PREFIX = HOMPY_PREFIX;

  if(oItem.usetype == 'r' || oItem.usetype == 'e' || oItem.usetype == 'i' || oItem.usetype == 'b' || oItem.usetype == 'y' || oItem.usetype == 'n')
    ITEM_PREFIX = 'http://filei.sayclub.kr/charimg/hompy';
  else
    ITEM_PREFIX = 'http://filei.sayclub.kr/charimg/item_real2';
  
  var LocationStr = "";

  if('1000000126_1000000127_1000000128' == cat3)
    LocationStr = "g";
  else
    LocationStr = "s";
  var Img = [];
  Img.IcoFree = "<img src='"+IMG_PREFIX+"/saymall/img_saymall_free.gif' align=top>";
  Img.IcoNew = "<img src='"+IMG_PREFIX+"/saymall/img_saymall_new.gif' align=top>";
  Img.IcoPoint = "<img src='"+IMG_PREFIX+"/ico_points_my.gif' align=absmiddle>";
  Img.IcoCoupon = "<img src='"+IMG_PREFIX+"/ico_coupon_my.gif' align=absmiddle>";
  var BtnToggle = ""
    + " onmouseover='SaymallCatalog_toggleButton(this)'"
    + " onmouseout='SaymallCatalog_toggleButton(this)'";
  var BtnAttr = ""
    + " border=0 align=absmiddle";

  if('x' == oItem.usetype)
  {
    Img.BtnBuy = getJsLink("open_win('http://saymall.sayclub.com/saymall_buy_pkg.nwz?charge_id="+oItem.charge_id+"&locations="+LocationStr+"','buy',410,400)", ""
      + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_buy_2.gif' "+BtnAttr+" style='display:none'>" 
      + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_buy.gif' "+BtnAttr+"></a>", BtnToggle);
    Img.BtnGift = getJsLink("open_win('http://saymall.sayclub.com/saymall_gift_pkg.nwz?charge_id="+oItem.charge_id+"&locations="+LocationStr+"','gift',410,400)", ""
      + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_present_2.gif' "+BtnAttr+" style='display:none'>" 
      + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_present.gif' "+BtnAttr+"></a>", BtnToggle);
    Img.BtnWish = "";
    Img.Item = "<img src='"+ITEM_PREFIX+"/"+oItem.filename+"' width=100 height=120 style='border:1 solid #CCCCCC;'>";
  }
  else
  {
    if ('s' == oItem.usetype)
    {
      Img.BtnBuy = getJsLink("open_win('http://saymall.sayclub.com/saymall_buy_rcharge.nwz?charge_id="+oItem.charge_id+"&locations="+LocationStr+"','buy',410,400)", ""
        + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_apply_2.gif' "+BtnAttr+" style='display:none'>" 
        + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_apply.gif' "+BtnAttr+"></a>", BtnToggle);
    }
    else
    {
      Img.BtnBuy = getJsLink("open_win('http://saymall.sayclub.com/saymall_buy_product.nwz?saleinfo_id="+oItem.charge_id+"&locations="+LocationStr+"','buy',410,400)", ""
        + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_buy_2.gif' "+BtnAttr+" style='display:none'>" 
        + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_buy.gif' "+BtnAttr+"></a>", BtnToggle);
    }
    Img.BtnGift = getJsLink("open_win('http://saymall.sayclub.com/saymall_gift_product.nwz?saleinfo_id="+oItem.charge_id+"&locations="+LocationStr+"','gift',410,400)", ""
      + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_present_2.gif' "+BtnAttr+" style='display:none'>" 
      + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_present.gif' "+BtnAttr+"></a>", BtnToggle);
    Img.BtnWish = getJsLink("open_win('http://saymall.sayclub.com/saymall_cart_manage.nwz?cmd=add&charge_id="+oItem.charge_id+"','cart',410,400)", ""
      + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_wish_2.gif' "+BtnAttr+" style='display:none'>" 
      + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_wish.gif' "+BtnAttr+"></a>", BtnToggle);

    Img.Item = "<img src='"+ITEM_PREFIX+"/d_"+oItem.filename+"' width=75 height=75 style='border:1 solid #CCCCCC;'>";
  }
  
  //add blank process
  Img.Item = "<img src='"+ITEM_PREFIX+"/img_blank.gif' width=77 height=77 style='position:absolute' border=0>"+Img.Item;
  
  if('i' == oItem.usetype && fixedUser)
  {
      Img.BtnBuy = getJsLink("open_win('http://saymall.sayclub.com/saymall_select_fixedcharge.nwz?charge_id="+oItem.charge_id+"&locations="+LocationStr+"','buy',410,400)", ""
      + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_select_2.gif' "+BtnAttr+" style='display:none'>" 
      + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_select.gif' "+BtnAttr+"></a>", BtnToggle);
  }

  Img.BtnExchange = getJsLink("javascript:confirmExchangeCoupon('" + oItem.charge_id + "','" + oItem.point + "')", ""
    + "<img src='"+IMG_PREFIX+"/saymall/btn_saymall_exchanges.gif' "+BtnAttr+" style='display:none'>" 
    + "<img src='"+IMG_PREFIX+"/saymall/btn_saymall_exchange.gif' "+BtnAttr+"></a>", BtnToggle);

  var Txt = [];
  if(giftfor == 'M' || giftfor == 'F') {
    Txt.LinkShopping = "";
    Img.BtnBuy = "";
    Img.BtnWish = "";
    Img.BtnExchange = "";
  }
  else if (cat.substr(0,21) == '1000000001_1000000532') {
    Txt.LinkShopping = "";
    Img.BtnBuy = "";
    Img.BtnWish = "";
    Img.BtnGift = "";
  }
  else {
    Img.BtnExchange = "";
    if('_crt' == cat)
    {
      Txt.LinkShopping = getJsLink("open_win('http://saymall.sayclub.com/saymall_cart_manage.nwz?cmd=del&charge_id="+oItem.charge_id+"&page="+page+"', 'cart', 410, 400)", "[³ªÀÇÂò»óÇ° »èÁ¦]");
      Img.BtnWish = "";
    }
    else  
      if  ("1000000126_1000000127_1000000134"!=cat.substr(0, 32) && "1000000001_1000000566" != cat.substr(0,21) && "1000000224_1000000598" != cat.substr(0,21)) {
      if("1000002409" != cat.substr(0,10))
        Txt.LinkShopping = getJsLink("open_win('http://saymall.sayclub.com/saymall_asktobuy.nwz?charge_id="+oItem.charge_id+"&locations="+LocationStr+"', 'asktobuy', 410, 400)", "<img src='"+IMG_PREFIX+"/saymall/renovation/icon.gif' border=0>"+" ¼±¹°¹Þ±â");
      else
        Txt.LinkShopping = "";
      }
      else {
        Txt.LinkShopping = "";
      }
  }

  if("1000000113_1000002696"==cat.substr(0, 21))
  {
    Txt.LinkShopping = "";
    Img.BtnWish = "";
    Img.Item = "<img src='"+ITEM_PREFIX+"/d_"+oItem.filename+"' width=75 height=75 style='border:0;'>";
  }

  if('115004' == oItem.charge_id)
  {
    Img.BtnBuy = getJsLink("open_win('http://my.sayclub.com/mobile/mobile_notify_buypop.nwz','buy',410,400)", ""
    + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_buy_2.gif' "+BtnAttr+" style='display:none'>" 
    + "<img src='"+IMG_PREFIX+"/saymall/renovation/btn_buy.gif' "+BtnAttr+"></a>", BtnToggle);
    Img.BtnGift = "";
    Img.BtnWish = "";
    Txt.LinkShopping = "";
  }

  // »óÇ° type º° ±¸¸Å , ¼±¹° ¸µÅ© ¿©ºÎ 
  switch(oItem.usetype)
  {
    case 'h' : // Çì¾î ¾ÆÀÌÅÛ
      Img.BtnGift = "";
      break;
    case 's' : // Á¤¾×Á¦ ¾ÆÀÌÅÛ
      Img.BtnGift = "";
      Img.BtnWish = "";
      Txt.LinkShopping = "";
      break;
    case 'z' : // »óÇ°±Ç ¾ÆÀÌÅÛ
      Img.BtnBuy = "";
      Img.BtnWish = "";
      Txt.LinkShopping = "";
      break;
    default :
      break;
  }
  if("1000002409" == cat.substr(0,10)) Img.BtnWish = "";
 
  // °¢ action º° ¸µÅ© 
  Img.ItemLinkDress = getJsLink("SaymallDress_putOnItem("+oItem.charge_id+", "+oItem.layer+", '"+oItem.filename+"', '"+oItem.ishead+"', '"+oItem.codestr+"')", Img.Item);
  //Img.ItemLinkRoom = getJsLink("SaymallRoom_putOnItem("+oItem.charge_id+", "+oItem.layer+", '"+oItem.filename+"', '"+oItem.ishead+"', '"+oItem.codestr+"', "+oItem.flexstartlayer+","+oItem.flexendlayer+","+oItem.x_pos+","+oItem.y_pos+")", Img.Item);
  Img.ItemLinkRoom = getJsLink("SaymallRoom_putOnItem("+oItem.charge_id+", "+oItem.layer+", '"+oItem.filename+"', '"+oItem.title+"', '"+oItem.codestr+"', '"+oItem.point+"')", Img.Item);

  Img.ItemLinkBalloon = getJsLink("SaymallRoom_putOnBalloon('"+oItem.filename+"','"+oItem.charge_id+"')", Img.Item);

  if ('y' == oItem.usetype || 'n' == oItem.usetype)
    Img.ItemLinkSkinPreview = getJsLink("open_win('saymall_preview_deco.nwz?charge_id="+oItem.charge_id+"&filename="+oItem.filename+"&locations="+LocationStr+"&giftfor="+giftfor+"','detail',892,565)",Img.Item);
  else
    Img.ItemLinkSkinPreview = getJsLink("open_win('saymall_preview_skin.nwz?charge_id="+oItem.charge_id+"&filename="+oItem.filename+"&locations="+LocationStr+"&giftfor="+giftfor+"','detail',892,565)",Img.Item);

  // ²Ç¼ö : °ÔÀÓ¸Ó´Ï ¸ðÀ¸±â ÆäÀÌÁö¿¡¼­ ³ª¿À´Â Ä«Å»·Î±×(saygame.sayclub.com)¿¡¼­
  // LinkDetailÀ» ´©¸£¸é saygame.sayclub.com/saymall_catalog_detail.nwz°¡ 
  // ºÒ¸®°í, ¼¼ÀÌ¸ô¿¡¼­ LinkDetailÀº saymall.sayclub.com/saymall_catalog_detail
  // ÀÌ ºÒ¸®°Ô µÈ´Ù. (µÑÀÇ Â÷ÀÌ´Â Header¿Í ¿ÞÂÊ ¸Þ´ºÀÇ Á¸Àç ¿©ºÎ)
  if('r' == oItem.usetype || 'e' == oItem.usetype || 'b' == oItem.usetype)
    Txt.LinkDetail = "javascript:void window.open('saymall_preview_detail.nwz?charge_id="+oItem.charge_id+"&filename="+oItem.filename+"&locations="+LocationStr+"&giftfor="+giftfor+"','detail','width=460, height=400, resizable=no, scroll=no');";
  else if(cat.substr(0,21) == '1000000001_1000000532') {
    Txt.LinkDetail = "javascript:SaymallDress_putOnItem("+oItem.charge_id+", "+oItem.layer+", '"+oItem.filename+"', '"+oItem.ishead+"', '"+oItem.codestr+"');";
  }
  else if('i' == oItem.usetype)
    Txt.LinkDetail = "javascript:void window.open('saymall_preview_skin.nwz?charge_id="+oItem.charge_id+"&filename="+oItem.filename+"&locations="+LocationStr+"&giftfor="+giftfor+"','detail','width=892, height=565, resizable=no, scroll=no');";
  else if('y' == oItem.usetype || 'n' == oItem.usetype)
    Txt.LinkDetail = "javascript:void window.open('saymall_preview_deco.nwz?charge_id="+oItem.charge_id+"&filename="+oItem.filename+"&locations="+LocationStr+"&giftfor="+giftfor+"','detail','width=892, height=565, resizable=no, scroll=no');";
  else if('s' == oItem.usetype)
    Txt.LinkDetail = "javascript:void window.open('saymall_charge_detail.nwz?charge_id="+oItem.charge_id+"&filename="+oItem.filename+"&locations="+LocationStr+"&giftfor="+giftfor+"','detail','width=410, height=200, resizable=no, scroll=no');";
  else if('x' == oItem.usetype)
    Txt.LinkDetail = "saymall_catalog_detail.nwz?charge_id="+oItem.charge_id+"&locations="+LocationStr+"&giftfor="+giftfor+"&level=pkg";
  else
    Txt.LinkDetail = "saymall_catalog_detail.nwz?charge_id="+oItem.charge_id+"&locations="+LocationStr+"&giftfor="+giftfor;

  targetStr = "";
  if("undefined" != typeof(detail_page))
  {
    if (detail_page == 'new') {
      Txt.LinkDetail = "money_earn.nwz?itemsrl="+oItem.charge_id+"&locations="+LocationStr+"&method=4&msn=1&giftfor="+giftfor;
      targetStr = " target=_parent ";
    }
  }

  if (oItem.gamemoney)
  {
    Txt.LinkShopping = "<b><font class=orange>"+ oItem.gamemoney+ "</font></b>";
    oItem.newflag = false;
  }

  var oDescTable = SaymallCatalog_createElement(""
    + "<table width=125 border=0 cellpadding=0 cellspacing=0 style='table-layout:fixed; margin-left:10px;'>"
    + "<tr><td height=18></td></tr>"
    + "<tr><td height=16></td></tr>"
    + "<tr><td height=7></td></tr>"
    + "<tr><td height=18></td></tr>"
    + "<tr><td></td></tr>"
    + "</table>"
  );

  var cutlength = 15;
  if(oItem.newflag)
    var cutlength = 11;
  oItem.titlestr = util_cut_str(oItem.title,cutlength,'');
  if(oItem.title.length > oItem.titlestr.length)
    oItem.titlestr = oItem.titlestr + "...........";
  var strIcon = (0==oItem.point) ? Img.IcoFree+" " : (oItem.newflag ? Img.IcoNew+" " : "");

  if('i' == oItem.usetype || 'y' == oItem.usetype || 'n' == oItem.usetype)
    oDescTable.cells(1).innerHTML = Img.IcoPoint+" "+oItem.point+" "+"<a href=\""+ Txt.LinkDetail+ "\" " + targetStr + ">[¹Ì¸®º¸±â]</a>";
  else if (cat.substr(0,21) == '1000000001_1000000532')
    oDescTable.cells(1).innerHTML = Img.IcoCoupon+" ÄíÆù"+(oItem.point/10000)+"°³";
  else
    oDescTable.cells(1).innerHTML = Img.IcoPoint+" "+oItem.point+" "+"<a href=\""+ Txt.LinkDetail+ "\" " + targetStr + ">[»ó¼¼Á¤º¸]</a>";

  if('117719' == oItem.charge_id)
  {
    oDescTable.cells(0).innerHTML = "<nobr>"+strIcon+"<a href=\""+Txt.LinkDetail+"\" " + targetStr + " title='"+oItem.title+"'>"+oItem.titlestr.bold()+"</a> <a href=\"javascript:open_win('http://my.sayclub.com/popup_whoru_preview.nwz','_viewwru',491,691);\">[¹Ì¸®º¸±â]</a></nobr>";
  }
  else {
    oDescTable.cells(0).innerHTML = "<nobr>"+strIcon+"<a href=\""+Txt.LinkDetail+"\" " + targetStr + " title='"+oItem.title+"'>"+oItem.titlestr.bold()+"</a></nobr>";
  }

  // for Couponshop
  if (cat.substr(0,21) == '1000000001_1000000532') {
    Txt.LinkShopping = "<a href=\""+ Txt.LinkDetail+ "\"" + targetStr + ">[Âø¿ëÇØº¸±â]</a>";
    oDescTable.cells(3).innerHTML = Txt.LinkShopping;
    oDescTable.cells(4).innerHTML = Img.BtnExchange;
  }
  else {
    oDescTable.cells(3).innerHTML = Txt.LinkShopping;
    oDescTable.cells(4).innerHTML = (-1!="AB".indexOf(oItem.buytype) ? Img.BtnBuy : "")+("A"==oItem.buytype?"&nbsp;":"")+(-1!="AG".indexOf(oItem.buytype) ? Img.BtnGift : "")+"&nbsp;"+Img.BtnWish;
  }

  var oItemTable = SaymallCatalog_createElement(""
    + "<table border=0 cellpadding=0 cellspacing=0>"
    + "<tr valign=top>"
    + "  <td width=83></td>"
    + "  <td></td>"
    + "</tr>"
    + "</table>"
  );

  if('c'==oItem.usetype ||'t'==oItem.usetype || 'h'==oItem.usetype || 'd'==oItem.usetype)
    oItemTable.cells(0).innerHTML =  Img.ItemLinkDress;
  else if('r'==oItem.usetype || 'e'==oItem.usetype)
    oItemTable.cells(0).innerHTML =  Img.ItemLinkRoom;
  else if('b'==oItem.usetype)
    oItemTable.cells(0).innerHTML =  Img.ItemLinkBalloon;
  else if('i'==oItem.usetype || 'y' == oItem.usetype || 'n' == oItem.usetype)
    oItemTable.cells(0).innerHTML =  Img.ItemLinkSkinPreview;
  else
    oItemTable.cells(0).innerHTML =  Img.Item;

  oItemTable.cells(1).appendChild(oDescTable);

  return oItemTable;
}/*}}}*/
function SaymallCatalog_getBlankItemTable ()/*{{{*/
{
  var oItemTable = SaymallCatalog_createElement(""
    + "<table border=0 cellpadding=0 cellspacing=0>"
    + "<tr valign=top>"
    + "  <td width=83></td>"
    + "  <td></td>"
    + "</tr>"
    + "</table>"
  );
  oItemTable.cells(0).innerHTML = "<img src='"+IMG_PREFIX+"/img_blank.gif' width=75 height=75 style='border:1 solid #CCCCCC'>";
  oItemTable.cells(1).innerHTML = "<font color=gray>ÀÐ´Â Áß...</font>";

  return oItemTable;
}/*}}}*/
function SaymallCatalog_replaceItem (i, oItemTable)/*{{{*/
{
  var iRow = Math.floor(i/numPerRow) * 2 + 1;
  var iCell = i % numPerRow;

  if (oItemTable != null) {
    while (oPanelTable.rows(iRow).cells(iCell).childNodes.length > 0) {
      var oOldItemTable = oPanelTable.rows(iRow).cells(iCell).childNodes(0);
      oPanelTable.rows(iRow).cells(iCell).removeChild(oOldItemTable);
      oOldItemTable.removeNode(true);
    }
    oPanelTable.rows(iRow).cells(iCell).appendChild(oItemTable);
  }
  else {
    oPanelTable.rows(iRow).cells(iCell).childNodes(0).style.visibility = 'hidden';
  }
}/*}}}*/
function SaymallCatalog_initPanel ()/*{{{*/
{
  //var max = oPanelTable.rows.length;
  var max = ((oPanelTable.rows.length-1)/2) * numPerRow;
  for (var i=0; i < max; i++) {
    SaymallCatalog_replaceItem(i, SaymallCatalog_getBlankItemTable());
  }
}/*}}}*/
function SaymallCatalog_displayPanel (max)/*{{{*/
{
  oPanelTable = SaymallCatalog_createElement(""
    + "<table border=0 cellpadding=0 cellspacing=0 style='table-layout:fixed'>"
    + "</table>"
  );

  var oTr = oPanelTable.insertRow();
  var oTd = oTr.insertCell();
  oTd.colSpan = numPerRow;
  oTd.style.height = 24;
  oTd.style.backgroundImage = 'url('+IMG_PREFIX+'/img_hori_sep.gif)';
  oTd.style.backgroundRepeat = 'repeat-x';
  oTd.style.backgroundPositionY = 'center';

  for (var i=0; i < Math.ceil(max/numPerRow); i++) {
    var oTr = oPanelTable.insertRow();
    for (var j=0; j < numPerRow; j++) {
      var oTd = oTr.insertCell();
    }
    var oTr = oPanelTable.insertRow();
    var oTd = oTr.insertCell();
    oTd.colSpan = numPerRow;
    oTd.style.height = 24;
    oTd.style.backgroundImage = 'url('+IMG_PREFIX+'/img_hori_sep.gif)';
    oTd.style.backgroundRepeat = 'repeat-x';
    oTd.style.backgroundPositionY = 'center';
  }

  SaymallCatalog_initPanel();
  SaymallCatalog_displayElement(oPanelTable);
}/*}}}*/

function SaymallCatalog_isWide(usetype)
{
  if(usetype=='MYFT' || (usetype=='HPFT' && cat.substr(0,32)=='1000000224_1000003039_1000003955')
    ||(usetype=='CFFT' && cat.substr(0,32)=='1000003855_1000003858_1000003866') || usetype=='z')
    return true;
  else
    return false;
}
function SaymallCatalog_displayItemsNew (Items)/*{{{*/
{
  var strItemsHTML='';
  cntForFont = 0;
  var idx = 0;
  for(i in Items)
  {
    strItemsHTML += SaymallCatalog_makeDivHtml(Items[i]);
    idx++;
    if(SaymallCatalog_isWide(Items[i].usetype) && cat!='cart' && idx%2==0 )
    {
      if(Items.length!=idx)
        strItemsHTML += "<table width=558 border=0 cellpadding=0 cellspacing=0 style='position:inline;margin-left:10;margin-bottom:15'><tr><td height=1 background='http://filei.sayclub.kr/images/incredible/saymall/dotline_01.gif'></td></tr></table>";
      else
        strItemsHTML += "<table width=558 border=0 cellpadding=0 cellspacing=0 style='position:inline;margin-left:10;margin-bottom:10'><tr><td></td></tr></table>";
    }
    
  }

  var oDiv = document.getElementById('catalogTable');
  oDiv.innerHTML = strItemsHTML;
}/*}}}*/
function SaymallCatalog_displayItemsNewToday (Items)/*{{{*/
{
  var strItemsHTML='';
  cntForFont = 0;
  var idx = 0;
  for(i in Items)
  {
    if (Items[i].usetype=='MYFT') Items[i].usetype = "";
    strItemsHTML += SaymallCatalog_makeDivHtml(Items[i]);
    idx++;
    if(SaymallCatalog_isWide(Items[i].usetype) && cat!='cart' && idx%2==0 )
    {
      if(Items.length!=idx)
        strItemsHTML += "<table width=558 border=0 cellpadding=0 cellspacing=0 style='position:inline;margin-left:10;margin-bottom:15'><tr><td height=1 background='http://filei.sayclub.kr/images/incredible/saymall/dotline_01.gif'></td></tr></table>";
      else
        strItemsHTML += "<table width=558 border=0 cellpadding=0 cellspacing=0 style='position:inline;margin-left:10;margin-bottom:10'><tr><td></td></tr></table>";
    }
    
  }

  var oDiv = document.getElementById('catalogTable');
  oDiv.innerHTML = strItemsHTML;
}/*}}}*/
function SaymallCatalog_makeDivHtml(oItem)/*{{{*/
{
  var cattype = SaymallCatalog_cattypeByUsetype(oItem.usetype);
  var strImgHtml = saymall_returnImgHtml(oItem.usetype, oItem.product_id, oItem.saleinfo_id, oItem.cont_id, oItem.layer, oItem.ishead, oItem.cat_id, lastCat, oItem.filename, oItem.codestr, oItem.title, oItem.point);
  var imgNew;
    if(oItem.newflag=='1')
      imgNew = "<IMG src='http://filei.sayclub.kr/images/incredible/bullet/ic_n02.gif' width=9 height=11 border=0 align=absmiddle> ";
    else
      imgNew = '';
  //params check
  var idx = 0;
  var arrParams = new Array('usetype', 'product_id', 'saleinfo_id', 'cont_id', 'layer', 'ishead', 'cat_id', 'location', 'filename', 'codestr', 'title', 'point');
  for(idx in arrParams)
    eval("if(typeof(oItem."+arrParams[idx]+")=='undefined'){oItem."+arrParams[idx]+"='';}");

  //make item talbe case by case

  if(oItem.usetype=='MYFT' && cat!='cart')
  {/*{{{*/
    if(cntForFont%2 ==0)
      var strHTML = "<div class='catBoxFont'>";
    else
      var strHTML = "<div class='catBoxFontRight'>";
    cntForFont++;
    strHTML += "<div class='catNameFont'>"+imgNew+"<a href=\"javascript:SaymallCatalog_openWinByAction('info', '"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"','"+oItem.cont_id+"','"+oItem.cat_id+"','"+oItem.location+"','"+oItem.filename+"');\" onfocus='blur()' class=mall_link>"+oItem.title+"</b></a></div>";
    strHTML += strImgHtml;//image & image link part
    strHTML += "<div class='catCashFont'>";
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_saycash02.gif' align=absmiddle>"+oItem.point;
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_giftbox.gif' align=absmiddle class=bullet><a href='#' onclick=\"SaymallCatalog_openWinByAction('ask','"+oItem.usetype+"','"+oItem.product_id+"','','"+oItem.cont_id+"','"+oItem.cat_id+"')\" class=small_link small>¼±¹°¹Þ±â</a>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('buy','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_buy.gif' name='btn_buy' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('gift','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_gift.gif' name='btn_gift' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('wishadd','"+oItem.usetype+"','"+oItem.product_id+"','s'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_hope.gif' name='btn_hope' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += "</div>";
    strHTML += "</div>";

  }/*}}}*/
  else if(oItem.usetype=='HPFT' && cat.substr(0,32)=='1000000224_1000003039_1000003955' && cat!='cart')
  {/*{{{*/
    if(cntForFont%2 ==0)
      var strHTML = "<div class='catBoxFont'>";
    else
      var strHTML = "<div class='catBoxFontRight'>";
    cntForFont++;
    strHTML += "<div class='catNameFont'>"+imgNew+"<a href='#' onClick=\"javascript:SaymallCatalog_openWinByAction('info', '"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"','"+oItem.cont_id+"','"+oItem.cat_id+"','"+oItem.location+"','"+oItem.filename+"');\" onfocus='blur()' class=mall_link>"+oItem.title+"</b></a></div>";
    strHTML += strImgHtml;//image & image link part
    strHTML += "<div class='catCashFont'>";
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_saycash02.gif' align=absmiddle>"+oItem.point;
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_giftbox.gif' align=absmiddle class=bullet><a href='#' onclick=\"SaymallCatalog_openWinByAction('ask','"+oItem.usetype+"','"+oItem.product_id+"','','"+oItem.cont_id+"','"+oItem.cat_id+"')\" class=small_link small>¼±¹°¹Þ±â</a>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('buy','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_buy.gif' name='btn_buy' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('gift','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_gift.gif' name='btn_gift' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('wishadd','"+oItem.usetype+"','"+oItem.product_id+"','s'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_hope.gif' name='btn_hope' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += "</div>";
    strHTML += "</div>";

  }/*}}}*/
  else if(oItem.usetype=='CFFT' && cat.substr(0,32)=='1000003855_1000003858_1000003866' && cat!='cart')
  {/*{{{*/
    if(cntForFont%2 ==0)
      var strHTML = "<div class='catBoxFont'>";
    else
      var strHTML = "<div class='catBoxFontRight'>";
    cntForFont++;
    strHTML += "<div class='catNameFontWide'>"+imgNew+"<a href='#' onClick=\"javascript:SaymallCatalog_openWinByAction('info', '"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"','"+oItem.cont_id+"','"+oItem.cat_id+"','"+oItem.location+"','"+oItem.filename+"');\" onfocus='blur()' class=mall_link>"+oItem.title+"</b></a></div>";
    strHTML += strImgHtml;//image & image link part
    strHTML += "<div class='catCashFont'>";
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_apple.gif' align=absmiddle>"+parseInt(oItem.point)/100+'°³';
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_saycash02.gif' align=absmiddle>"+oItem.point;
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('buy','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_buy.gif' name='btn_buy' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('gift','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_gift.gif' name='btn_gift' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += "</div>";
    strHTML += "</div>";

  }/*}}}*/
  else if(oItem.usetype=='z' && cat!='cart')
  {/*{{{*/
    if(cntForFont%2 ==0)
      var strHTML = "<div style='margin-left:7;margin-bottom:10;width:273;display:inline'>";
    else
      var strHTML = "<div style='margin-left:12;margin-bottom:12;width:273;display:inline'>";
    cntForFont++;

    strHTML += "<table width=273 border=0 cellpadding=0 cellspacing=0><col width=1></col><col width=271></col><col width=1></col><tr> <td></td> <td bgcolor=#D9D9D9></td> <td></td> </tr> <tr> <td bgcolor=#D9D9D9></td> <td align=center bgcolor=#FBFBFB style='padding:4 0 0 0'>";
    strHTML += "  <table width=263 border=0 cellpadding=0 cellspacing=0><col width=1></col><col width=261></col><col width=1></col> <tr> <td></td> <td bgcolor=#D9D9D9></td> <td></td> </tr> <tr> <td bgcolor=#D9D9D9></td> <td height=23 class='dress space_top2' bgcolor=#FFFFFF> <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_star01.gif' align=absmiddle style='margin:0 0 2 6'>";
    strHTML += oItem.title;
    strHTML += "</td> <td bgcolor=#D9D9D9></td> </tr> <tr> <td></td> <td bgcolor=#D9D9D9></td> <td></td> </tr> </table>";
    strHTML += " <table width=263 border=0 cellpadding=0 cellspacing=0> <col width=119 align=center valign=bottom></col><col width=10></col><col width=*></col> <tr><td height=13 colspan=3></td></tr> <tr> <td>";
    strHTML += "<img src='http://filei.sayclub.kr/charimg/item_real2/wd_"+oItem.filename+"'></td><td><img src='http://filei.sayclub.kr/images/incredible/saymall/dotline_h05.gif' align=absmiddle></td><td valign=top>";
    strHTML += " <table border=0 cellpadding=0 cellspacing=0> <tr> <td>";
    strHTML += " <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/bul_08.gif' align=absmiddle style='margin:0 0 2 1'>";
    strHTML += " °¡°Ý : <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_saycash03.gif' align=absmiddle class=bullet>";
    strHTML += " <b>"+oItem.point+"</b></td></tr>";
    strHTML += "<tr height=22><td class=txt><img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_giftbox.gif' align=absmiddle class=bullet>";
    strHTML += "<a href='#' onclick=\"SaymallCatalog_openWinByAction('ask','"+oItem.usetype+"','"+oItem.product_id+"','','"+oItem.cont_id+"','"+oItem.cat_id+"')\" class=small_link small>¼±¹°¹Þ±â</a>";
    strHTML += "</td></tr> <tr> <td>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('gift','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_gift2.gif' align=absmiddle></a>";
    strHTML += "</td> </tr> </table> </td> </tr> <tr><td height=20 colspan=3></td></tr> </table> </td> <td bgcolor=#D9D9D9></td> </tr> <tr> <td></td> <td bgcolor=#D9D9D9></td> <td></td> </tr> </table>"; 
    strHTML += "</div>";
  }/*}}}*/
  else if(cattype=='cafe' && cat!='cart')
  {/*{{{*/
    var strHTML = "<div class='catBox'>";
    strHTML += strImgHtml;
    strHTML += "<div class='catName'>"+imgNew+"<a href='#' onClick=\"javascript:SaymallCatalog_openWinByAction('info', '"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"','"+oItem.cont_id+"','"+oItem.cat_id+"','"+oItem.location+"','"+oItem.filename+"');\" onfocus='blur()' class=mall_link>"+oItem.title+"</b></a></div>";
    strHTML += "<div class='catCash'>";
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_apple.gif' align=absmiddle>"+parseInt(oItem.point)/100+'°³';
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_saycash02.gif' align=absmiddle>"+oItem.point;
    strHTML += "</div>";
    strHTML += "<div class='catButton'>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('buy','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_buy.gif' name='btn_buy' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('gift','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_gift.gif' name='btn_gift' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += "</div>";
    strHTML += "</div>";
  }/*}}}*/
  else if(cattype=='character' && cat.substr(0,21)=='1000003890_1000009300')
  {/*{{{*/
    var strHTML = "<div class='catBox'>";
    strHTML += strImgHtml;
    strHTML += "<div class='catName'>"+imgNew+"<a href='#' onClick=\"javascript:SaymallCatalog_openWinByAction('info', '"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"','"+oItem.cont_id+"','"+oItem.cat_id+"','"+oItem.location+"','"+oItem.filename+"');\" onfocus='blur()' class=mall_link>"+oItem.title+"</b></a></div>";
    strHTML += "<div class='catCash'>";
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_saycash02.gif' align=absmiddle>"+oItem.point;
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/03_rose.gif' align=absmiddle>"+getRoseRewardCnt(oItem.point)+'°³';
    strHTML += "</div>";
    strHTML += "<div class='catButton'>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('buy','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_buy.gif' name='btn_buy' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('gift','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_gift.gif' name='btn_gift' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += "</div>";
    strHTML += "</div>";
  }/*}}}*/
  else if(cattype=='character' && cat.substr(0,21)=='1000009761_1000009762')
  {/*{{{*/
    var strHTML = "<div class='catBox'>";
    strHTML += strImgHtml;
    strHTML += "<div class='catName'>"+imgNew+"<a href='#' onClick=\"javascript:SaymallCatalog_openWinByAction('info', '"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"','"+oItem.cont_id+"','"+oItem.cat_id+"','"+oItem.location+"','"+oItem.filename+"');\" onfocus='blur()' class=mall_link>"+oItem.title+"</b></a></div>";
    strHTML += "<div class='catCash'>";
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_saycash02.gif' align=absmiddle>"+oItem.point;
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/03_rose.gif' align=absmiddle>"+getRoseRewardCnt(oItem.point)+'°³';
    strHTML += "</div>";
    strHTML += "<div class='catButton'>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('buy','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_buy.gif' name='btn_buy' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('gift','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_gift.gif' name='btn_gift' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += "</div>";
    strHTML += "</div>";
  }/*}}}*/
  else
  {/*{{{*/
    var strHTML = "<div class='catBox'>";
    strHTML += strImgHtml;
    strHTML += "<div class='catName'>"+imgNew+"<a href='#' onClick=\"javascript:SaymallCatalog_openWinByAction('info', '"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"','"+oItem.cont_id+"','"+oItem.cat_id+"','"+oItem.location+"','"+oItem.filename+"');\" onfocus='blur()' class=mall_link>"+oItem.title+"</b></a></div>";
    strHTML += "<div class='catCash'>";
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_saycash02.gif' align=absmiddle>"+oItem.point;
    if('undefined'!=typeof(giftfor) && giftfor=='')
      strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_giftbox.gif' align=absmiddle class=bullet><a href='#' onclick=\"SaymallCatalog_openWinByAction('ask','"+oItem.usetype+"','"+oItem.product_id+"','','"+oItem.cont_id+"','"+oItem.cat_id+"')\" class=small_link small>¼±¹°¹Þ±â</a>";
    strHTML += "</div>";
    strHTML += "<div class='catButton'>";
    if(cat=='cart' || ('undefined'!=typeof(giftfor)&&giftfor==''))
      strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('buy','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_buy.gif' name='btn_buy' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('gift','"+oItem.usetype+"','"+oItem.product_id+"','"+oItem.saleinfo_id+"', '"+oItem.cont_id+"','"+oItem.cat_id+"', lastCat, '"+oItem.filename+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_gift.gif' name='btn_gift' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    if(cat!='cart' && giftfor=='')
      strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('wishadd','"+oItem.usetype+"','"+oItem.product_id+"','s'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_hope.gif' name='btn_hope' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    else if(cat=='cart' && ('undefined'!=typeof(bMyCart) && bMyCart))
      strHTML += " <a href='#' onClick=\"javascript:void(SaymallCatalog_openWinByAction('wishdel','"+oItem.usetype+"','"+oItem.product_id+"'))\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_hopedel.gif' name='btn_hopedel' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += "</div>";
    strHTML += "</div>";
   }/*}}}*/

  return strHTML; 
}/*}}}*/
function SaymallCatalog_makeItemTable(oItem)/*{{{*/
{
  //img url set
  var imgUrl = SaymallCatalog_prefixByUsetype(oItem.usetype);
  var cattype = SaymallCatalog_cattypeByUsetype(oItem.usetype);
  if(oItem.usetype!='MYFT')
    var strHTML = "<img src='"+imgUrl+"d_"+oItem.filename+"' class='line_goods'>";
  else
    var strHTML = "<img src='"+imgUrl+"wd_"+oItem.filename+"' class='line_goods'>";

  if(cattype=='character')
  {
//    strHTML = "<div>"+ getJsLink("SaymallDress_putOnItem("+oItem.charge_id+", "+oItem.layer+", '"+oItem.filename+"', '"+oItem.ishead+"', '"+oItem.codestr+"')", strHTML)+"</div>";
    strHTML = "<div class='catImg'>" + gen_catalog(strHTML, oItem, 'axMenu111') + "</div>";
  }
  else if(cattype=='hompy')
  {
    strHTML = "<div class='catImg'>" + gen_catalog(strHTML, oItem, 'axMenu111') + "</div>";
  }
  else if(cattype=='cafe')
  {
    strHTML = "<div class='catImg'>" + gen_catalog(strHTML, oItem, 'axMenu111') + "</div>";
  }
  else if(cattype=='chatting')
  {
    strHTML = "<div class='catImg'>" + gen_catalog(strHTML, oItem, 'axMenu111') + "</div>";
  }
  else if(cattype=='item')
  {
    strHTML = "<div class='catImg'>" + gen_catalog(strHTML, oItem, 'axMenu111') + "</div>";
  }
  else if(cattype=='cart')
  {
    strHTML = gen_wishbox(strHTML, oItem);
  }
  return strHTML;
}/*}}}*/
function SaymallCatalog_rolloverButton(oImg)/*{{{*/
{
  oImg.src = 'http://filei.sayclub.kr/images/incredible/saymall/button/'+oImg.name+'_on.gif';
}/*}}}*/
function SaymallCatalog_rolloutButton(oImg)/*{{{*/
{
  oImg.src = 'http://filei.sayclub.kr/images/incredible/saymall/button/'+oImg.name+'.gif';
}/*}}}*/


function SaymallCatalog_displayCatList()/*{{{*/
{
  var strCatList = SaymallCatalog_updateCatList();
  var oDiv = document.getElementById('spanCatList');
  oDiv.innerHTML = strCatList;
}/*}}}*/
function SaymallCatalog_updateCatList()/*{{{*/
{
  var pCat = ('_'!=cat1) ? cat : cat4;
  if('_'!=cat1 && cat.length > 40)
  {
    pCat = cat1+'_'+cat2+'_'+cat3;
  }


  var SubCatList = Category_getSubList(pCat);

  var CatTitleList = [];
  CatTitleList[pCat] = 'ÀüÃ¼º¸±â';

  for (var i in SubCatList)
  {
    if(CntList_getItemCount(SubCatList[i], sex) > 0)
      CatTitleList[SubCatList[i]] = Category_getTitle(SubCatList[i]);
  }

  var CatLinkList = [];
  for (var cat_i in CatTitleList) 
  {
    if(CntList_getItemCount(cat_i, sex) > 0)
      CatLinkList[CatLinkList.length] = getJsLink("SaymallCatalog_moveCat('"+cat_i+"')", (cat_i == cat) ? CatTitleList[cat_i].bold() : CatTitleList[cat_i]);
  }
    return CatLinkList.join(" <span style='color:#99A3D8'>|</span> ");
}/*}}}*/

function SaymallCatalog_setCatLogo()/*{{{*/
{
  var oDiv = document.getElementById('divCategoryTitle');
  var strHtml = '';
  strHtml = Category_getTitle(cat);

  strHtml += ' (' + CntList_getItemCount(cat, sex) + ')';
  oDiv.innerHTML = strHtml;
}/*}}}*/

//page moving
function SaymallCatalog_updatePageLink ()/*{{{*/
{
  var PageLinkList = [];
  var PrevPage = Math.floor((page-1)/10)*10;
  var NextPage = Math.ceil(page/10)*10 + 1;
  var Filter = "";
//  var Filter = "style=\"filter:gray();\"";

  var cntItems = CntList_getItemCount(cat, sex);
  var cntPages = CntList_getPageCount(cat, sex);  
//  if (cntPages > 10) {
    if (PrevPage <= 0)
    {
      PrevLink = "<td >";
      PrevLink += "<img src='http://filei.sayclub.kr/images/incredible/button/btn_prev_end.gif' align=absmiddle class=btn "+Filter+">";
      PrevLink += "<img src='http://filei.sayclub.kr/images/incredible/button/btn_prev.gif' align=absmiddle "+Filter+">";
      PrevLink += "</td>";
    }
    else
    {
       PrevLink = "<td> ";
       PrevLink += getJsLink("SaymallCatalog_movePage(1)","<img src='http://filei.sayclub.kr/images/incredible/button/btn_prev_end.gif' align=absmiddle class=btn >");
       PrevLink += getJsLink("SaymallCatalog_movePage("+PrevPage+")","<img src='http://filei.sayclub.kr/images/incredible/button/btn_prev.gif' align=absmiddle class=btn >");
       PrevLink += "</td>";
    }
//  }
//  else
//    PrevLink = "";
  
  for (var i=(1 + PrevPage); i <= (cntPages < NextPage ? cntPages : (NextPage-1)); i++) {
    PageLinkList[PageLinkList.length] = getJsLink("SaymallCatalog_movePage("+i+")", ((i==page) ? (" "+i+" ").bold() : (" "+i+" ")) );
  }
  
//  if (cntPages > 10) {
    if (cntPages < NextPage)
    {
      NextLink = ""  
        + "<td><img src='"+IMG_PREFIX+"/saymall/btn_nav_next.gif' width=20 height=16 border=0 align=absmiddle "+Filter+"></td>"; 
      NextLink = "<td>";
      NextLink += "<img src='http://filei.sayclub.kr/images/incredible/button/btn_next.gif' align=absmiddle class=btn "+Filter+">";
      NextLink += "<img src='http://filei.sayclub.kr/images/incredible/button/btn_next_end.gif' align=absmiddle "+Filter+">";
      NextLink += "</td>";
    }
    else
    {
      NextLink = ""  
        + "<td>"+getJsLink("SaymallCatalog_movePage("+NextPage+")", "<img src='"+IMG_PREFIX+"/saymall/btn_nav_next.gif' border=0 align=absmiddle>")+"</td>"
        + "<td style='padding:3 8 0 8;'>"+getJsLink("SaymallCatalog_movePage("+cntPages+")", (" "+cntPages+" ").bold())+"</td>"; 
      NextLink = "<td align=right>";
      NextLink += getJsLink("SaymallCatalog_movePage("+NextPage+")","<img src='http://filei.sayclub.kr/images/incredible/button/btn_next.gif' align=absmiddle class=btn >");
      NextLink += getJsLink("SaymallCatalog_movePage("+cntPages+")","<img src='http://filei.sayclub.kr/images/incredible/button/btn_next_end.gif' align=absmiddle class=btn >");
      NextLink += "</td>"
        +"<td class=space_top style='padding-left:5px'>..."+getJsLink("SaymallCatalog_movePage("+cntPages+")",cntPages)+"</td>";
    }
//  } 
//  else
//    NextLink = "";

if(cntPages<=10)
{
  PrevLink = '';
  NextLink = '';
}

  var strPageLink = "" 
    + "<table border=0 cellpadding=0 cellspacing=0>"
    + "<tr>"
    +   PrevLink
    +   "<td style='padding:3 8 0 8;'>"+PageLinkList.join("<img src='http://filei.sayclub.kr/images/incredible/cafe/line_01.gif' align=absmiddle style='margin:0 2 4 2 '>")+"</td>"
    +   NextLink
    + "</tr>"
    + "</table>";

  return strPageLink; 
}/*}}}*/
function SaymallCatalog_displayPageLink()/*{{{*/
{
  //ÆäÀÌÁö¿¡¼­ ÃÖÃÊ·Î ºÎ¸§.
    var oLinkAbove = document.getElementById('divPageLinktop');
    var oLinkBelow = document.getElementById('divPageLinkbottom');
    var strLinkHTML = SaymallCatalog_updatePageLink();
    if(oLinkAbove)
      oLinkAbove.innerHTML = strLinkHTML;
    if(oLinkBelow)
      oLinkBelow.innerHTML = strLinkHTML;

}/*}}}*/
function SaymallCatalog_move ()/*{{{*/
{
  //document.location.href = pageUrl+"?cat="+cat+"&sort="+sort+"&giftfor="+giftfor+"&page="+page+"&HairStyle="+HairStyle;
  document.location.href = pageUrl+"?cat="+cat+"&giftfor="+giftfor+"&HairStyle="+HairStyle;
}/*}}}*/
function SaymallCatalog_makeSrcUrl(strCat, strSort, strSex, intPage)/*{{{*/
{
  if(giftfor!='')
    strSex = giftfor;
  var strJsUrl = strUrlPrefix + '/' + strCat + '/' + strSort+'_'+strSex+'_'+intPage+'.js';

  return strJsUrl;
}/*}}}*/
function SaymallCatalog_setSortButtons()/*{{{*/
{
  var arrSortListId = new Array('divSortList_above', 'divSortList_below');
  var oSortList;
  for(i=0;i<arrSortListId.length;i++)
  {
    oSortList = document.getElementById(arrSortListId[i]);
    if(oSortList)
      oSortList.innerHTML = SaymallCatalog_displaySortList();
  }
}/*}}}*/
function SaymallCatalog_movePage (new_page)/*{{{*/
{
  if(cat=='cart')
  {
//    location.href = 'http://saymall.sayclub.com/saymall_my_wishbox.nwz?page='+new_page;
    page = new_page;
    //SaymallCatalog_showPage();
    SaymallCatalog_displayItemsNew(WishList_get());
    var oLinkAbove = document.getElementById('divPageLinktop');
    var oLinkBelow = document.getElementById('divPageLinkbottom');
    var strLinkHTML = SaymallCatalog_updatePageLink();
    if(oLinkAbove)
      oLinkAbove.innerHTML = strLinkHTML;
    if(oLinkBelow)
      oLinkBelow.innerHTML = strLinkHTML;
   
    return;
  }

  page = new_page;
  strSrc = SaymallCatalog_makeSrcUrl(cat, sort, sex, page);
  ItemList_init();
  document.all.catjs.onreadystatechange = SaymallCatalog_showPage;
  document.all.catjs.src = strSrc;
}/*}}}*/
function SaymallCatalog_showPage()/*{{{*/
{
  //ÆäÀÌÁö ÀÌµ¿½Ã¿¡ È£ÃâµÊ.
  if(this.readyState=='loaded');
  {
    SaymallCatalog_displayItemsNew(ItemList_get());
    var oLinkAbove = document.getElementById('divPageLinktop');
    var oLinkBelow = document.getElementById('divPageLinkbottom');
    var strLinkHTML = SaymallCatalog_updatePageLink();
    if(oLinkAbove)
      oLinkAbove.innerHTML = strLinkHTML;
    if(oLinkBelow)
      oLinkBelow.innerHTML = strLinkHTML;
   }
 }/*}}}*/
function SaymallCatalog_moveSort (new_sort)/*{{{*/
{
  sort = new_sort;
  page = 1;
  
  SaymallCatalog_movePage(1);
}/*}}}*/
function SaymallCatalog_moveCat (new_cat, new_page)/*{{{*/
{
  cat = new_cat;
  var arrCat = new_cat.split('_');
  if(new_cat!=origin_cat && arrCat.length<4)//in cat3
  {
    SaymallCatalog_move();
    return;
  }

  for(i=0;i<arrCat.length;i++)
    eval("cat"+(i+1)+"='"+arrCat[i]+"';");
  page = ('undefined'!=typeof(new_page)) ? new_page : 1;

//automation
  strSrc = SaymallCatalog_makeSrcUrl(cat, sort, sex, page);
  ItemList_init();
  document.all.catjs.onreadystatechange = SaymallCatalog_showPage;
  document.all.catjs.src = strSrc;
  SaymallCatalog_displayCatList();
}/*}}}*/

//usetype
function SaymallCatalog_prefixByUsetype(usetype)/*{{{*/
{
  switch(usetype)
  {
    //character item
    case 'c':
    case 'd':
    case 'h':
    case 't':
      return 'http://filei.sayclub.kr/charimg/item_real2/';
      break; 
    //hompy item
    case 'b':
    case 'e':
    case 'i':
    case 'k':
    case 'n':
    case 'y':
    case 'r':
    case 'HPFT':
    case 'HPTB':
      return 'http://filei.sayclub.kr/charimg/hompy/';
      break;
    //cafe item
    case 'CFFT':
    case 'CFSK':
    case 'CFDS':
    case 'CFDP':
      return 'http://filei.sayclub.kr/charimg/cafe/';
      break;
    //myfont item
    case 'MYFT':
      return 'http://filei.sayclub.kr/charimg/font/';
      break;
    //character battle item
    case 'CBIT':
      return 'http://filei.sayclub.kr/charimg/battle/';
      break;
    default :
      return 'http://filei.sayclub.kr/charimg/item_real2/';
      break; 
  }
}/*}}}*/
function SaymallCatalog_cattypeByUsetype(usetype)/*{{{*/
{
  if(cat=='cart')
    return 'cart';
  switch(usetype)
  {
    //character item
    case 'c':
    case 'd':
    case 'h':
    case 't':
      return 'character';
      break; 
    //hompy item
    case 'b':
    case 'e':
    case 'i':
    case 'k':
    case 'n':
    case 'y':
    case 'r':
    case 'HPFT':
      return 'hompy';
      break;
    //cafe item
    case 'CFFT':
    case 'CFSK':
    case 'CFDS':
    case 'CFDP':
      return 'cafe';
      break;
    //myfont item
    case 'MYFT':
    case 'w':
    case 'z':
      return 'item';
      break;
    case 'f':
      return 'magic';
      break;
    case 'CBIT':
      return 'battle';
      break;
    default :
      //alert('usetype È®ÀÎ/Ãß°¡ ¿ä¸Á :'+usetype );
      return '';
      break; 
  }
}/*}}}*/
function SaymallCatalog_actiontypeByUsetype(usetype)/*{{{*/
{
  //puton, putin, info
  switch(usetype)
  {
    //character item
    case 'c':
    case 'd':
    case 'h':
    case 't':
      return 'puton';
      break; 
    //playroom item
    case 'b':
    case 'e':
    case 'r':
      return 'putin';
      break;
    //others ->into popup
    case 'i':
    case 'k':
    case 'n':
    case 'y':
    case 'HPFT':
    case 'CFFT':
    case 'CFSK':
    case 'MYFT':
    case 'CFDS':
    case 'CFDP':
    case 'w':
    case 'f':
    case 'z':
    case 'CBIT':
      return 'info';
      break;
    default :
//      alert('usetype È®ÀÎ/Ãß°¡ ¿ä¸Á :'+usetype );
      return 'info';
      break; 
  }
}/*}}}*/

//functions
function SaymallCatalog_openWinByAction(action, usetype, product_id, saleinfo_id, cont_id, cat_id, location, filename)/*{{{*/
{
  var arrParams = new Array('usetype', 'product_id', 'saleinfo_id', 'cont_id', 'cat_id', 'location', 'filename', 'giftfor');
  //check 
  if(action=='' || action=='undefined')
  {
    alert('¾×¼ÇÀÌ Á¤ÀÇµÇÁö ¾Ê¾Ò½À´Ï´Ù.');
    return false;
  }
  var strUrl;

  //location check
  if(typeof(location)=='undefined')
  {
    if(typeof(lastCat)!='undefined')
      var location = lastCat;
    else
      var location = 's'; 
  }

  var win_width = 500;
  var win_height = 500;

  switch(action)
  {
    case 'info' :
      if(usetype=='i') //È¨ÇÇ½ºÅ²
      {
        win_width = 995;
        win_height = 610;
        strUrl = 'http://saymall.sayclub.com/saymall_preview_skin.nwz?';
      }
      else if(usetype=='n' || usetype=='y') //È¨ÇÇµ¥ÄÚ
      {
        win_width = 995;
        win_height = 610;
        strUrl = 'http://saymall.sayclub.com/saymall_preview_deco.nwz?';
      }
      else if(usetype=='HPFT' || usetype == 'HPTB') //È¨ÇÇÆùÆ®
      {
        strUrl = 'http://saymall.sayclub.com/saymall_preview_skin.nwz?';
        win_width = 995;
        win_height = 610;
      }
      else if(usetype=='CFSK' || usetype=='CFFT' || usetype=='CFDS' || usetype=='CFDP') //Ä«Æä¾ÆÀÌÅÛ
      {
        strUrl = 'http://saymall.sayclub.com/saymall_preview_skin.nwz?';
        win_width = 995;
        win_height = 610;
      }
      else
      {
        if('MYFT' == usetype)
        {
          win_width = 450;
          win_height = 610;
        }
        strUrl = 'http://saymall.sayclub.com/saymall_popup_product_info.nwz?';
      }
      break; 
    case 'buy' :
      win_width = 410;
      win_height = 450;
      if(usetype.substr(0, 2)=='CF')
        strUrl = 'http://saymall.sayclub.com/saymall_buy_cafe_product.nwz?';
      else
        strUrl = 'http://saymall.sayclub.com/saymall_buy_product.nwz?';
      break;
    case 'gift' :
      win_width = 410;
      win_height = 550;
      if(usetype.substr(0, 2)=='CF')
        strUrl = 'http://saymall.sayclub.com/saymall_gift_cafe_product.nwz?';
      else
        strUrl = 'http://saymall.sayclub.com/saymall_gift_product.nwz?';
      break;
    case 'wishadd' :
      strUrl = 'http://saymall.sayclub.com/saymall_cart_manage.nwz?cmd=add';
      break;
    case 'wishdel' :
      strUrl = 'http://saymall.sayclub.com/saymall_cart_manage.nwz?cmd=del&';
      break;
    case 'ask' :
      strUrl = 'http://saymall.sayclub.com/saymall_asktobuy.nwz?'; 
      break;
    default:
      strUrl = '';
      alert('no action');
      return;
      break;
  }

  //var strTarget = '_' + action + (usetype ? '_'+usetype.toLowerCase() : '');
  var strTarget = '_' + action;

  var i; 
  for(i=0;i<arrParams.length;i++)
  {
    if(typeof(arrParams[i])!='undefined')
      eval("if(typeof("+arrParams[i]+")!='undefined' && "+arrParams[i]+"!='undefined'){strUrl += '&"+arrParams[i]+"='+"+arrParams[i]+";};");
  }
  //coordishop ano
  if('undefined'!=typeof(coordi_ano))
    strUrl += "&coordi_ano="+coordi_ano;
  if(toid && action == "gift")
    strUrl += "&toid="+toid;

  if(strUrl =='')
    alert('Àß¸øµÈ Á¤º¸ÀÔ´Ï´Ù.');
  else
    //open_win(strUrl, '', win_width,win_height);
    window.open(strUrl, strTarget, "width="+win_width+",height="+win_height + ", top=50, left=50");
    //window.open(strUrl, '', win_width,win_height);
    //window.open(strUrl, '', win_width,win_height);

  // ¿À´Ãº»»óÇ°
  if (action=='info' || action=='buy' || action=='gift')
  {
    SaymallCatalog_putTodayItem(usetype, product_id, saleinfo_id, cont_id, cat_id, location, filename);
  }
}/*}}}*/ 

function SaymallCatalog_putTodayItem(usetype, product_id, saleinfo_id, cont_id, cat_id, location, filename)/*{{{*/
{
  if (typeof(document.all.divTodayItem) != "undefined" && typeof(setCookieNoEscape) != "undefined" && MSRL)
  {
    var get_cookie = getCookie(MSRL);
    if (get_cookie) var arr_cookie = get_cookie.split("&");
    else var arr_cookie = [];
    if (arr_cookie.length >= 20) var start_i = 1;
    else var start_i = 0;
    var before_cookie = '';
    for (var i=start_i;i<arr_cookie.length;i++)
    {
      before_cookie += arr_cookie[i]+"&";
    }
    if (before_cookie.match(product_id)) return;

    if (/^d_/.test(filename) == true)
    {
      filename = filename.substring(2);
    }

    var str_cookie = before_cookie+usetype+"|"+product_id+"|"+saleinfo_id+"|"+cont_id+"|"+cat_id+"|"+location+"|"+filename;
    setCookieNoEscape(MSRL,str_cookie,86400000); 
    SaymallCatalog_todayItemInit(1);
  }
}/*}}}*/

function SaymallCatalog_todayItemInit(page)/*{{{*/
{
  if (typeof(document.all.divTodayItem) != "undefined" && typeof(getCookie) != "undefined" && MSRL)
  {
    var str_cookie = getCookie(MSRL);
    var totalcnt = 0;
    if (str_cookie) 
    {
      var arr_cookie = str_cookie.split("&");
      arr_cookie = arr_cookie.reverse();
      totalcnt = arr_cookie.length;
      var max_page_num = Math.ceil(totalcnt/3);
      if (page > 0) var next_page = page % max_page_num;
      else if (page <= 0) var next_page = (max_page_num+page) % max_page_num;
      if (next_page == 0) next_page = max_page_num;
      var next_num = (next_page*3)-2;
    }
    else 
    {
      var arr_cookie = [];
      var next_num = 1;
      var max_page_num = 1;
    }
    document.getElementById('today_imgcnt').innerText = totalcnt;
    if (max_page_num >= 7) var max_today_num = 20;
    else var max_today_num = max_page_num*3;
    for (var i=1;i<=max_today_num;i++)
    {
      if (i>=next_num && i<next_num+3)
      {
        if (arr_cookie[i-1])  
        {
          var arr_arr_cookie = arr_cookie[i-1].split("|");
          var usetype = arr_arr_cookie[0];
          var product_id = arr_arr_cookie[1];
          var saleinfo_id = arr_arr_cookie[2];
          var cont_id = arr_arr_cookie[3];
          var cat_id = arr_arr_cookie[4];
          var location = arr_arr_cookie[5];
          var filename = arr_arr_cookie[6];
          var imagename = SaymallCatalog_prefixByUsetype(usetype)+"d_"+filename;
          var inhtml = gen_pa_today(usetype,product_id,saleinfo_id,cont_id,cat_id,location,filename,"elMenu136","<img src="+imagename+" width=50 height=50 class=line_goods>");
        }
        else 
        {
          var imagename = "http://filei.sayclub.kr/images/incredible/saymall/today_noimg.gif";
          var inhtml = "<img src="+imagename+" width=50 height=50 class=line_goods>";
        }
        document.getElementById('today_img'+i).innerHTML = inhtml;
        document.getElementById('today_img'+i).style.display = "";
      }
      else
      {
        document.getElementById('today_img'+i).innerHTML = "<img src=http://filei.sayclub.kr/images/incredible/saymall/today_noimg.gif width=50 height=50 class=line_goods>";
        document.getElementById('today_img'+i).style.display = "none";
      }
    }
  }
}/*}}}*/

function SaymallCatalog_delTodayItem(product_id)/*{{{*/
{
  if (!MSRL) return;
  var str_cookie = getCookie(MSRL);
  if (str_cookie)
  {
    var arr_cookie = str_cookie.split("&");
    var res_cookie = '';
    for (var i=0;i<arr_cookie.length;i++)
    {
      var arr_arr_cookie = arr_cookie[i].split("|");
      if (arr_arr_cookie[1] == product_id) continue;
      res_cookie += "&"+arr_cookie[i];
    }
    res_cookie = res_cookie.substr(1);
    deleteCookie(MSRL);
    setCookieNoEscape(MSRL,res_cookie,86400000);
    if (typeof(today_page) != "undefined") SaymallCatalog_todayItemInit(today_page);
    else SaymallCatalog_todayItemInit(1);
  }
}/*}}}*/

var SaymallCatalotTimeoutId;
function SaymallCatalog_openLayer(action, usetype, product_id, saleinfo_id, cont_id, cat_id, location, filename)/*{{{*/
{
  var randnum = Math.floor(Math.random() * 5) + 1; 
  if ((usetype == 'c') && filename.search('01.gif') != -1 && typeof(LayerView) == 'object')
  {
    var arrtemp = filename.split(".");
    var imgname_1 = arrtemp[0].substr(0,arrtemp[0].length-1)+"1."+arrtemp[1];
    var imgname_2 = arrtemp[0].substr(0,arrtemp[0].length-1)+"2."+arrtemp[1];
    var imgname_3 = arrtemp[0].substr(0,arrtemp[0].length-1)+"3."+arrtemp[1];
    var imgname_4 = arrtemp[0].substr(0,arrtemp[0].length-1)+"4."+arrtemp[1];
    var imgname_5 = arrtemp[0].substr(0,arrtemp[0].length-1)+"5."+arrtemp[1];
    var layer_id = "layer"+product_id;
    var image_id = "image"+product_id;
    var x = window.event.clientX-window.event.offsetX+document.body.scrollLeft+60;
    var y = window.event.clientY-window.event.offsetY+document.body.scrollTop+60;
    if (typeof(document.all[layer_id]) != "object")
    {
      var html = "<table width=140 height=146 border=0 cellpadding=0 cellspacing=0>"
        +"<tr>"
        +"<td height=9><img src=http://filei.sayclub.kr/images/incredible/saymall/review_top.gif width=140 height=9></td>"
        +"</tr>"
        +"<tr>"
        +"<td background=http://filei.sayclub.kr/images/incredible/saymall/review_bg.gif>"
        +"<table border=0 align=center cellpadding=0 cellspacing=0>"
        +"<tr>"
        +"<td width=108><a style=cursor:hand onclick=\"javascript:SaymallCatalog_openWinByAction('"+action+"', '"+usetype+"', '"+product_id+"', '"+saleinfo_id+"', '"+cont_id+"', '"+cat_id+"', '"+location+"', '"+filename+"');return false;\">"
        +"<div id="+image_id+"_1 style=display:none><img src=http://filei.sayclub.kr/charimg/item_real2/"+imgname_1+" onerror=this.src=\"http://filei.sayclub.kr/charimg/item_real2/"+imgname_1+"\" width=100 height=120 class=line_goods /></div>"
        +"<div id="+image_id+"_2 style=display:none><img src=http://filei.sayclub.kr/charimg/item_real2/"+imgname_2+" onerror=this.src=\"http://filei.sayclub.kr/charimg/item_real2/"+imgname_1+"\" width=100 height=120 class=line_goods /></div>"
        +"<div id="+image_id+"_3 style=display:none><img src=http://filei.sayclub.kr/charimg/item_real2/"+imgname_3+" onerror=this.src=\"http://filei.sayclub.kr/charimg/item_real2/"+imgname_1+"\" width=100 height=120 class=line_goods /></div>"
        +"<div id="+image_id+"_4 style=display:none><img src=http://filei.sayclub.kr/charimg/item_real2/"+imgname_4+" onerror=this.src=\"http://filei.sayclub.kr/charimg/item_real2/"+imgname_1+"\" width=100 height=120 class=line_goods /></div>"
        +"<div id="+image_id+"_5 style=display:none><img src=http://filei.sayclub.kr/charimg/item_real2/"+imgname_5+" onerror=this.src=\"http://filei.sayclub.kr/charimg/item_real2/"+imgname_1+"\" width=100 height=120 class=line_goods /></div>"
        +"</a></td>"
        +"<td valign=top><img src=http://filei.sayclub.kr/images/incredible/saymall/icon_roll.gif width=8 height=8></td>"
        +"</tr>"
        +"</table>"
        +"</td>"
        +"</tr>"
        +"<tr>"
        +"<td height=9><img src=http://filei.sayclub.kr/images/incredible/saymall/review_bottom.gif width=140 height=9></td>"
        +"</tr>"
        +"</table>";
      var olayer = document.createElement("<div id="+layer_id+" style='position:absolute; display:block; top:"+y+"px; left:"+x+"px; z-index:6000000;'>");
      LayerView.appendChild(olayer);
      document.all[layer_id].innerHTML = html;
      eval(image_id+"_"+randnum+".style.display = '';");
      SaymallCatalogTimeoutId = setTimeout("SaymallCatalog_changeRandomMood('"+image_id+"','"+randnum+"')",1000);
    }
    else
    {
      for (var i=1;i<6;i++)
      {
        if (i == randnum) document.all[image_id+"_"+randnum].style.display = "";
        else document.all[image_id+"_"+i].style.display = "none";
      }
      document.all[layer_id].style.display = "block";
      document.all[layer_id].style.top = y;
      document.all[layer_id].style.left = x;
      SaymallCatalogTimeoutId = setTimeout("SaymallCatalog_changeRandomMood('"+image_id+"','"+randnum+"')",1000);
    }
  }
}/*}}}*/

function SaymallCatalog_hideLayer(product_id)/*{{{*/
{
  var layer_id = "layer"+product_id;
  if (typeof(document.all[layer_id]) == "object")
  {
    document.all[layer_id].style.display = "none";
    clearTimeout(SaymallCatalogTimeoutId);
  }
}/*}}}*/

function SaymallCatalog_changeRandomMood(image_id,currnum)/*{{{*/
{
  var nextnum = (currnum%5)+1;
  for (var i=1;i<6;i++)
  {
    if (i == nextnum) document.all[image_id+"_"+nextnum].style.display = '';
    else document.all[image_id+"_"+i].style.display = 'none';
  }
  SaymallCatalogTimeoutId = setTimeout("SaymallCatalog_changeRandomMood('"+image_id+"','"+nextnum+"')",1000);
}/*}}}*/

//wishlist
function WishList_get()/*{{{*/
{
  var key;
  var indexNum = 0;
  var startNum = listMax*(page-1);
  var endNum = startNum + listMax;
  var tmpData = [];
  for(key in ItemList_Data_)
  {
    if(indexNum>=startNum && indexNum<endNum)
    {
      tmpData[key] = ItemList_Data_[key];
    }
    indexNum++; 
  }
  return tmpData;
}/*}}}*/

//special
function SaymallCatalog_returnPageLink (page, cntItems, cntList )/*{{{*/
{
  var PageLinkList = [];
  var PrevPage = Math.floor((page-1)/10)*10;
  var NextPage = Math.ceil(page/10)*10 + 1;
  var Filter = '';// "style=\"filter:gray();\"";
  var cntPages = Math.ceil((cntItems)/cntList);  
//  if (cntPages > 10) {
    if (PrevPage <= 0)
    {
      PrevLink = "<td width=17>"
        + "<img src='http://filei.sayclub.kr/images/incredible/button/btn_prev.gif' align=absmiddle "+Filter+">"
        +"</td>";
    }
    else
    {
       PrevLink = "<td width=17>"
        + getJsLink("movePage("+PrevPage+")","<img src='http://filei.sayclub.kr/images/incredible/button/btn_prev.gif' align=absmiddle class=btn >")
        +"</td>";
    }
//  }
//  else
//    PrevLink = "";
  
  for (var i=(1 + PrevPage); i <= (cntPages < NextPage ? cntPages : (NextPage-1)); i++) {
    PageLinkList[PageLinkList.length] = getJsLink("movePage("+i+")", ((i==page) ? (" "+i+" ").bold() : (" "+i+" ")) );
  }
  
//  if (cntPages > 10) {
    if (cntPages < NextPage)
    {
      NextLink = ""  
        + "<td><img src='"+IMG_PREFIX+"/saymall/btn_nav_next.gif' width=20 height=16 border=0 align=absmiddle "+Filter+"></td>"; 
      NextLink = "<td width=24>"
        + "<img src='http://filei.sayclub.kr/images/incredible/button/btn_next.gif' align=absmiddle class=btn "+Filter+">"
        +"</td>";
    }
    else
    {
      NextLink = ""  
        + "<td>"+getJsLink("movePage("+NextPage+")", "<img src='"+IMG_PREFIX+"/saymall/btn_nav_next.gif' border=0 align=absmiddle>")+"</td>"
        + "<td style='padding:3 8 0 8;'>"+getJsLink("movePage("+cntPages+")", (" "+cntPages+" ").bold())+"</td>"; 
      NextLink = "<td width=24 align=right>"
        + getJsLink("movePage("+NextPage+")","<img src='http://filei.sayclub.kr/images/incredible/button/btn_next.gif' align=absmiddle class=btn >")
        +"</td>"
        +"<td class=space_top style='padding-left:5px'>..."+getJsLink("movePage("+cntPages+")",cntPages)+"</td>";
    }
//  } 
//  else
//    NextLink = "";

  var strPageLink = "" 
    + "<table border=0 cellpadding=0 cellspacing=0>"
    + "<tr>"
    +   PrevLink
    +   "<td style='padding:3 8 0 8;'>"+PageLinkList.join("<img src='http://filei.sayclub.kr/images/incredible/cafe/line_01.gif' align=absmiddle style='margin:0 2 4 2 '>")+"</td>"
    +   NextLink
    + "</tr>"
    + "</table>";

  return strPageLink; 
}/*}}}*/

//Catalog Table Generation
function saymall_returnImgHtml(usetype, product_id, saleinfo_id, cont_id, layer, ishead, cat_id, location, filename, codestr, title, point)/*{{{*/
{
  //params check
  var arrParams = new Array('usetype', 'product_id', 'saleinfo_id', 'cont_id', 'layer', 'ishead', 'cat_id', 'location', 'filename', 'codestr', 'title', 'point');
  for(var i=0;i<arrParams.length;i++)
  {
    eval("if(typeof("+arrParams[i]+")=='undefined') "+arrParams[i]+" = '';");
  }
  
  //img url set
  var imgUrl = SaymallCatalog_prefixByUsetype(usetype);
  var cattype = SaymallCatalog_cattypeByUsetype(usetype);
  var actiontype = SaymallCatalog_actiontypeByUsetype(usetype);

  if(cat!='cart' && ( (usetype=='CFFT' && cat.substr(0,32)=='1000003855_1000003858_1000003866') || usetype=='MYFT' || usetype=='z' || (usetype=='HPFT' && cat.substr(0,32)=='1000000224_1000003039_1000003955')))
    var strImg = "<img src='"+imgUrl+"wd_"+filename+"' class='line_goods'>";//ÆùÆ®, »óÇ°±Ç ÆäÀÌÁö¿¡¼­´Â ¿ÍÀÌµå ÀÌ¹ÌÁö º¸¿©ÁÜ.
  else
    var strImg = "<img src='"+imgUrl+"d_"+filename+"' class='line_goods'>";

  var strHTML = "";    

  //login check
  if(typeof(bLogged)=='undefined' || !bLogged)
    actiontype='';//»ó¼¼Á¤º¸Ã¢À¸·Î

  switch(actiontype)
  {
    case 'puton'://character ÀÔ¾îº¸±â
      strHTML += "<a style='cursor:hand' onmouseover=\"javascript:SaymallCatalog_openLayer('info', '"+usetype+"','"+product_id+"','"+saleinfo_id+"','"+cont_id+"','"+cat_id+"','"+location+"','"+filename+"');\" onclick=\"javascript:SaymallDress_putOnItem('"+product_id+"','"+layer+"','"+filename+"','"+ishead+"','"+codestr+"');\" onmouseout=\"javascript:SaymallCatalog_hideLayer('"+product_id+"');\" onfocus='blur()'>"+strImg+"</a>";   
      break;
    case 'putin'://playroom ³Ö¾îº¸±â
      if(usetype=='b')//¸»Ç³¼±
        strHTML += "<a style='cursor:hand' onclick=\"javascript:SaymallRoom_previewBalloon('"+product_id+"','"+filename+"');\"  onfocus='blur()'>"+strImg+"</a>";   
      else
        strHTML += "<a style='cursor:hand' onclick=\"javascript:SaymallRoom_putOnItem('"+product_id+"','"+layer+"','"+filename+"','"+title+"','"+codestr+"','"+point+"','"+''+"','"+''+"');\"  onfocus='blur()'>"+strImg+"</a>";   
      break;
    case 'info'://»ó¼¼Á¤º¸Ã¢
      strHTML += "<a style='cursor:hand' onmouseover=\"javascript:SaymallCatalog_openLayer('info', '"+usetype+"','"+product_id+"','"+saleinfo_id+"','"+cont_id+"','"+cat_id+"','"+location+"','"+filename+"');\" onclick=\"javascript:SaymallCatalog_openWinByAction('info', '"+usetype+"','"+product_id+"','"+saleinfo_id+"','"+cont_id+"','"+cat_id+"','"+location+"','"+filename+"');\" onmouseout=\"javascript:SaymallCatalog_hideLayer('"+product_id+"');\" onfocus='blur()'>"+strImg+"</a>";   
      break;
    default :
      strHTML += "<a style='cursor:hand' onmouseover=\"javascript:SaymallCatalog_openLayer('info', '"+usetype+"','"+product_id+"','"+saleinfo_id+"','"+cont_id+"','"+cat_id+"','"+location+"','"+filename+"');\" onclick=\"javascript:SaymallCatalog_openWinByAction('info', '"+usetype+"','"+product_id+"','"+saleinfo_id+"','"+cont_id+"','"+cat_id+"','"+location+"','"+filename+"');\" onmouseout=\"javascript:SaymallCatalog_hideLayer('"+product_id+"');\" onfocus='blur()'>"+strImg+"</a>";   
      break;
  }

  if (cont_id == '249345' || cont_id == "241502")
  {
    strHTML = "<a style='cursor:hand' onclick=\"javascript:open_win('http://saymall.sayclub.com/saymall_scratch.nwz','saymall_scratch',610,830);\"  onfocus='blur()'>"+strImg+"</a>";   
  }

  if (product_id == '69386' || product_id == "69387" || product_id == "69388")
  {
    strHTML = "<a href=\"http://saymall.sayclub.com/ladder/saymall_ladder.nwz\" target=\"_blank\"  onfocus='blur()'>"+strImg+"</a>";   
  }

  if (product_id == '74204' || product_id == "74205")
  {
    strHTML = "<a href=\"http://saymall.sayclub.com/wheel/sw.nwz\" target=\"_blank\"  onfocus='blur()'>"+strImg+"</a>";   
  }


  strHTML = "<div class=catImg>"+strHTML+"</div>";
  return strHTML;
}/*}}}*/


function Saymall_spAction(funcName, arrParams)/*{{{*/
{
//  strParam = usetype,product_id,layer,filename,ishead,codestr,cat_id,x_pos,y_pos,title
  if(funcName=='previewthis')
  {
    var uType = arrParams[0];
    //by usetype
    if(uType=='c' || uType=='d' || uType=='t' || uType=='h')//character item
    {
      SaymallDress_putOnItem(arrParams[1], arrParams[2], arrParams[3], arrParams[4], arrParams[5]);
    }
    else if(uType=='b') //balloon
    {
      SaymallRoom_putOnBalloon(arrParams[3], arrParams[1]);
    }
    else if(uType=='i' || uType=='n' || uType=='y') //skin, deco
    {
      SaymallCatalog_openWinByAction('preview', arrParams[1], '', arrParams[6], arrParams[0], arrParams[3]);
    }
    else if(uType=='r')
    {
      if('undefined'!=typeof(SaymallRoom_putOnItem) && 'undefined'!=typeof(document.all.playroom) )
        SaymallRoom_putOnItem(arrParams[1], arrParams[2], arrParams[3], arrParams[9], arrParams[5], arrParams[10])
    }
    else
    {
//alert('¾ÆÁ÷ ÇØ´ç Å¸ÀÔ¿¡ ´ëÇÑ ¹Ì¸®º¸±â°¡ ±¸ÇöµÇÁö ¾Ê¾Ò½À´Ï´Ù. : '+uType);
    }
  }
}/*}}}*/
function SaymallCatalog_makeDivHtmlBackup(oItem)/*{{{*/
{
  var cattype = SaymallCatalog_cattypeByUsetype(oItem.usetype);
  if(cattype=='cafe')
  {
    var strHTML = "<div class='catBox'>";
//    strHTML += SaymallCatalog_makeItemTable(oItem);//image & image link part
    strHTML += saymall_returnImgHtml(usetype, product_id, saleinfo_id, cont_id, cat_id, location, filename);
    strHTML += "<div class='catName'><a href='#' class=mall_link><b>"+oItem.title+"</b></a></div>";
    strHTML += "<div class='catCash'>";
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_apple.gif' align=absmiddle>"+parseInt(oItem.point)/100+'°³';
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_saycash02.gif' align=absmiddle>"+oItem.point;
    strHTML += "<br><img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_giftbox.gif' align=absmiddle class=bullet><a href='#' onclick=\"SaymallCatalog_openWinByAction('ask','"+oItem.product_id+"','s')\" class=small_link small>¼±¹°¹Þ±â</a>";
    strHTML += "</div>";
    strHTML += "<div class='catButton'>";
    strHTML += " <a href='#' onclick=\"SaymallCatalog_openWinByAction('buy','"+oItem.product_id+"','s', '"+oItem.cat_id+"', '"+oItem.usetype+"')\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_buy.gif' name='btn_buy' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += " <a href='#' onclick=\"SaymallCatalog_openWinByAction('gift','"+oItem.product_id+"','s', '"+oItem.cat_id+"', '"+oItem.usetype+"')\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_gift.gif' name='btn_gift' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    if(cat!='cart')
      strHTML += " <a href='#' onclick=\"SaymallCatalog_openWinByAction('wishadd','"+oItem.product_id+"','s')\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_hope.gif' name='btn_hope' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";

    strHTML += "</div>";
    strHTML += "</div>";
  }
  else if(oItem.usetype!='MYFT')
  {
    var strHTML = "<div class='catBox'>";
//    strHTML += SaymallCatalog_makeItemTable(oItem);//image & image link part

    strHTML += saymall_returnImgHtml(oItem.usetype, oItem.product_id, oItem.saleinfo_id, oItem.cont_id, oItem.layer, oItem.ishead, oItem.cat_id, lastCat, oItem.filename, oItem.codestr, oItem.title, oItem.point);
    strHTML += "<div class='catName'><a href='#' class=mall_link><b>"+oItem.title+"</b></a></div>";
    strHTML += "<div class='catCash'>";
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_saycash02.gif' align=absmiddle>"+oItem.point;
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_giftbox.gif' align=absmiddle class=bullet><a href='#' onclick=\"SaymallCatalog_openWinByAction('ask','"+oItem.product_id+"','s')\" class=small_link small>¼±¹°¹Þ±â</a>";
    strHTML += "</div>";
    strHTML += "<div class='catButton'>";
    strHTML += " <a href='#' onclick=\"SaymallCatalog_openWinByAction('buy','"+oItem.product_id+"','s', '"+oItem.cat_id+"', '"+oItem.usetype+"')\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_buy.gif' name='btn_buy' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    strHTML += " <a href='#' onclick=\"SaymallCatalog_openWinByAction('gift','"+oItem.product_id+"','s', '"+oItem.cat_id+"', '"+oItem.usetype+"')\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_gift.gif' name='btn_gift' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";
    if(cat!='cart')
      strHTML += " <a href='#' onclick=\"SaymallCatalog_openWinByAction('wishadd','"+oItem.product_id+"','s')\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_hope.gif' name='btn_hope' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a>";

    strHTML += "</div>";
    strHTML += "</div>";
  }
  else
  {
    if(cntForFont%2 ==0)
      var strHTML = "<div class='catBoxFont'>";
    else
      var strHTML = "<div class='catBoxFontRight'>";
    cntForFont++;
    strHTML += "<div class='catNameFont'><a href='#' class=mall_link><b>"+oItem.title+"</b></a></div>";
    strHTML += SaymallCatalog_makeItemTable(oItem);//image & image link part
    strHTML += "<div class='catCashFont'>";
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_saycash02.gif' align=absmiddle>"+oItem.point;
    strHTML += "  <img src='http://filei.sayclub.kr/images/incredible/saymall/bullet/ic_giftbox.gif' align=absmiddle class=bullet><a href='#' onclick=\"SaymallCatalog_openWinByAction('ask','"+oItem.product_id+"','s')\" class=small_link small>¼±¹°¹Þ±â</a>";
    strHTML += " <a href='#' onclick=\"SaymallCatalog_openWinByAction('buy','"+oItem.product_id+"','s', '"+oItem.cat_id+"', '"+oItem.usetype+"')\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_buy.gif' name='btn_buy' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a> ";
    strHTML += " <a href='#' onclick=\"SaymallCatalog_openWinByAction('gift','"+oItem.product_id+"','s', '"+oItem.cat_id+"', '"+oItem.usetype+"')\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_gift.gif' name='btn_gift' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a> ";
    strHTML += " <a href='#' onclick=\"SaymallCatalog_openWinByAction('wishadd','"+oItem.product_id+"','s')\"><img src='http://filei.sayclub.kr/images/incredible/saymall/button/btn_hope.gif' name='btn_hope' onMouseOut='SaymallCatalog_rolloutButton(this)' onMouseOver='SaymallCatalog_rolloverButton(this)' align=absmiddle class=bul_s></a> ";
    strHTML += "</div>";
    strHTML += "</div>";

  }

  return strHTML; 
}/*}}}*/

//gift for methods
function go_gift(gift)
{
//  AppletSession.setvalue("CharList_PutOn", "");
  location.href = pageUrl+"?cat="+cat+"&giftfor="+gift;
}
function go_nogift()
{
//  AppletSession.setvalue("CharList_PutOn", "");
  location.href = pageUrl+"?cat="+cat+"&giftfor=";
}

function getRoseRewardCnt(point)
{
  result = 0;
/*
    var cnt = 0; // reward·Î Áö±ÞÇÒ Àå¹Ì²É ¼ö
    var ratio = 30;  // Áö±ÞÀ²
    var characterRatio = 0.66;  // Áö±ÞÀ²

    if ( point >= 9900) ratio = 60;
    else if ( point >= 8900) ratio = 57;
    else if ( point >= 7900) ratio = 54;
    else if ( point >= 6900) ratio = 51;
    else if ( point >= 5900) ratio = 48;
    else if ( point >= 4900) ratio = 45;
    else if ( point >= 3900) ratio = 42;
    else if ( point >= 2900) ratio = 39;
    else if ( point >= 1900) ratio = 36;
    else if ( point >= 900) ratio = 33;

    //$cnt = number_format(round(point*ratio*3/100/100));
    var result = Math.round(((point*ratio*3)/100/100)* characterRatio);
*/
    if (point == 100)  result = 1;
    else if (point == 200)  result = 1;
    else if (point == 300)  result = 2;
    else if (point == 400)  result = 2;
    else if (point == 500)  result = 3;
    else if (point == 600)  result = 4;
    else if (point == 700)  result = 4;
    else if (point == 800)  result = 5;
    else if (point == 900)  result = 6;
    else if (point == 1000)  result = 6;
    else if (point == 1100)  result = 7;
    else if (point == 1200)  result = 7;
    else if (point == 1300)  result = 8;
    else if (point == 1400)  result = 9;
    else if (point == 1500)  result = 9;
    else if (point == 1600)  result = 10;
    else if (point == 1700)  result = 11;
    else if (point == 1800)  result = 11;
    else if (point == 1900)  result = 12;
    else if (point == 2000)  result = 13;
    else if (point == 2100)  result = 13;
    else if (point == 2200)  result = 14;
    else if (point == 2300)  result = 15;
    else if (point == 2400)  result = 15;
    else if (point == 2500)  result = 16;
    else if (point == 2600)  result = 17;
    else if (point == 2700)  result = 17;
    else if (point == 2800)  result = 18;
    else if (point == 2900)  result = 19;
    else if (point == 3000)  result = 20;
    else if (point == 3100)  result = 21;
    else if (point == 3200)  result = 22;
    else if (point == 3300)  result = 22;
    else if (point == 3400)  result = 23;
    else if (point == 3500)  result = 24;
    else if (point == 3600)  result = 25;
    else if (point == 3700)  result = 26;
    else if (point == 3800)  result = 26;
    else if (point == 3900)  result = 27;
    else if (point == 4000)  result = 28;
    else if (point == 4100)  result = 29;
    else if (point == 4200)  result = 29;
    else if (point == 4300)  result = 30;
    else if (point == 4400)  result = 31;
    else if (point == 4500)  result = 32;
    else if (point == 4600)  result = 33;
    else if (point == 4700)  result = 34;
    else if (point == 4800)  result = 34;
    else if (point == 4900)  result = 35;
    else if (point == 5000)  result = 36;
    else if (point == 5100)  result = 41;
    else if (point == 5200)  result = 42;
    else if (point == 5300)  result = 43;
    else if (point == 5400)  result = 44;
    else if (point == 5500)  result = 45;
    else if (point == 5600)  result = 46;
    else if (point == 5700)  result = 47;
    else if (point == 5800)  result = 48;
    else if (point == 5900)  result = 49;
    else if (point == 6000)  result = 50;
    else if (point == 6100)  result = 51;
    else if (point == 6200)  result = 52;
    else if (point == 6300)  result = 53;
    else if (point == 6400)  result = 54;
    else if (point == 6500)  result = 55;
    else if (point == 6600)  result = 56;
    else if (point == 6700)  result = 58;
    else if (point == 6800)  result = 59;
    else if (point == 6900)  result = 60;
    else if (point == 7000)  result = 61;
    else if (point == 7100)  result = 62;
    else if (point == 7200)  result = 63;
    else if (point == 7300)  result = 64;
    else if (point == 7400)  result = 66;
    else if (point >= 7500)  result = 67;

    return result;
}

