// -------------------------------------------------------------------------
//
// 2011/03/30 Sukwoo Kim  ( 1) 일본리뉴얼. 메소드추가
//---------------------------------------------------------------------------

//Added by Kitae Park, 03/15/2010, Category Page, CASE# 013-3459
function goCategoryList_Row(Category, RowNum, CurrentPage, AllYN, price, size, order)
{
   if(RowNum != "" && AllYN != "Y" && Category.toLowerCase().indexOf("tbt") == -1)
   {
       if(parseInt(RowNum) > 25)
       {
           var temp = (RowNum % 25);
           if(temp == 0)
           {
               temp = 25;
           }
           RowNum = temp;
       }
   }
   
   if(RowNum == "")
   {
	   goCategoryList(Category);
   }
   else
   {
      if (Category.toLowerCase() == "mdpick")
         location.href = "/Product/MDPick.aspx";
      else if (Category.toLowerCase() == "newarrivals")
         location.href = "/Product/NewArrivals.aspx";
      //else if (Category.toLowerCase() == "sale")
      //   location.href = "/Product/Sale.aspx";
      else if ((Category.toLowerCase() == "shopbytrend") || (Category.toLowerCase().indexOf("sbtrend") != -1))
         location.href = "/ShopbyTrend/Default.aspx";
      else if (Category.toLowerCase() == "shopbyoutfit")
         location.href = "/ShopbyOutfit/Default.aspx";
      else if (Category.toLowerCase() == "fab_finds")
         location.href = "/Product/FabulousFinds.aspx";
      else if (Category.toLowerCase() == "promo_white_wear" || Category.toLowerCase() == "promo_white_acc")
         location.href = "/whiteday/";      
      else
      {
         if (Category.toLowerCase().indexOf("81") != -1)
         {   
            if(Category.toLowerCase().indexOf("81m") != -1)
               location.href = "/Heritage1981/Men/Products.aspx?Category=" + Category + "&RowNum=" + RowNum + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order + "#RowNumber" + RowNum;
            else         
               location.href = "/Heritage1981/Products.aspx?Category=" + Category + "&RowNum=" + RowNum + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order + "#RowNumber" + RowNum;
         }         
         else if (Category.toLowerCase().indexOf("tbt") != -1)
            location.href = "/Twelve/Products.aspx?Category=" + Category + "&RowNum=" + RowNum + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order + "#RowNumber" + RowNum;
         else if (Category.toLowerCase().indexOf("love21") != -1)
            location.href = "/Love21/Products.aspx?Category=" + Category + "&RowNum=" + RowNum + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order + "#RowNumber" + RowNum;
         else if ((Category.toLowerCase().indexOf("21men") != -1) || (Category.toLowerCase().indexOf("menpromo") != -1))
            location.href = "/21Men/Products.aspx?Category=" + Category + "&RowNum=" + RowNum + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order + "#RowNumber" + RowNum;
         // Added by 04/27/2010, Kitae Park, 014-0062 HTG81 KIDS 런칭
         else if (Category.toLowerCase().indexOf("boys") != -1 || Category.toLowerCase().indexOf("girls") != -1 || Category.toLowerCase().indexOf("kids") != -1)
            location.href = "/Htg81/Products.aspx?Category=" + Category + "&RowNum=" + RowNum + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order + "#RowNumber" + RowNum;
         else
         {
            location.href = "/Forever21/Products.aspx?Category=" + Category + "&RowNum=" + RowNum + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order + "#RowNumber" + RowNum;
         }
      }
   }
}

//Added by Kitae Park, 03/15/2010, Category Page, CASE# 013-3459
function goProductInfo_Row(ProductId, Category, RowNum, ColorCode, CurrentPage, AllYN, price, size, order)
{
   if(CurrentPage == "" || CurrentPage == undefined)
   {
      CurrentPage = "1";
   }
   
   if(price == undefined)
      price = "";
   if(size == undefined)
      size = "";
   if(order == undefined)
      order = "";
   
   if (Category.toLowerCase().indexOf("81") != -1)
   {
      if(Category.toLowerCase().indexOf("81m") != -1)
         location.href = "/Heritage1981/Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order;
      else   
         location.href = "/Heritage1981/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order;
   }   
   else if (Category.toLowerCase().indexOf("tbt") != -1)
      location.href = "/Twelve/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order;
   else if (Category.toLowerCase().indexOf("love21") != -1)
      location.href = "/Love21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order;
   else if ((Category.toLowerCase().indexOf("21men") != -1) || (Category.toLowerCase().indexOf("menpromo") != -1))
      location.href = "/21Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order;
   // Added by 04/27/2010, Kitae Park, 014-0062 HTG81 KIDS 런칭
   else if (Category.toLowerCase().indexOf("boys") != -1 || Category.toLowerCase().indexOf("girls") != -1 || Category.toLowerCase().indexOf("kids") != -1)
      location.href = "/Htg81/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order;
   else
      location.href = "/Forever21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode + "&CurrentPage=" + CurrentPage + "&AllYN=" + AllYN + "&paramprice=" + price + "&paramsize=" + size + "&paramorder=" + order;
}

function goCategoryList(Category, PromoType)
{
   //if(Category.toLowerCase() == "sale")
   //{
   //   location.href = "/promotion/SaleAcc.aspx";
   //}
   
   if(PromoType == "")
   {
	  // Category : Product Category(ex:f21_top,81_top,tbt_top...)
      if (Category.toLowerCase() == "mdpick")
         location.href = "/Product/MDPick.aspx";
      else if (Category.toLowerCase() == "newarrivals")
         location.href = "/Product/NewArrivals.aspx";
      //else if (Category.toLowerCase() == "sale")
      //   location.href = "/Product/Sale.aspx";
      else if ((Category.toLowerCase() == "shopbytrend") || (Category.toLowerCase().indexOf("sbtrend") != -1))
         location.href = "/ShopbyTrend/Default.aspx";
      else if (Category.toLowerCase() == "shopbyoutfit")
         location.href = "/ShopbyOutfit/Default.aspx";
      else if (Category.toLowerCase() == "fab_finds")
         location.href = "/Product/FabulousFinds.aspx";
      // Added by 05/07/2010, Kitae Park, Case#014-1970 swimwear의 상품만 보이는 페이지 생성
      else if (Category.toLowerCase() == "f21_swimwear")
         location.href = "/swimwear/";
      // Added by 03/03/2010, Kitae Park, White day page 
      else if (Category.toLowerCase() == "promo_white_wear" || Category.toLowerCase() == "promo_white_acc")
         location.href = "/whiteday/";
      // Added by 05/04/2010, Kitae Park, 014-1519_JP_어버이날 프로모션 categoryPath
      else if (Category.toLowerCase() == "promo_couturemom_apparel" || Category.toLowerCase() == "promo_couturemom_shoes" || Category.toLowerCase() == "promo_couturemom_acc")
         location.href = "/promotion/couturemom.aspx";
      // Added, 05/07/2010, Kitae Park, Suit yourself
      else if (Category.toLowerCase() == "promo_suityourself")
         location.href = "/Forever21/Products.aspx?Category=" + Category;
      else if (Category.toLowerCase().indexOf("promo_jeans") != -1)
         location.href = "/Forever21/Products.aspx?Category=" + Category;      
      // Added, 04/21/2010, Kitae Park, Promo categoryPath
      else if (Category.toLowerCase().indexOf("promo") != -1)
         location.href = "/promotion/products.aspx?category=" + Category;
      else
      {
         // Added by Kitae Park, 11/30/2009, Heritage1981/Men/
         if (Category.toLowerCase().indexOf("81") != -1)
         {   
            if(Category.toLowerCase().indexOf("81m") != -1)
               location.href = "/Heritage1981/Men/Products.aspx?Category=" + Category;
            else         
               location.href = "/Heritage1981/Products.aspx?Category=" + Category;
         }         
         else if (Category.toLowerCase().indexOf("tbt") != -1)
            location.href = "/Twelve/Products.aspx?Category=" + Category;
         else if (Category.toLowerCase().indexOf("love21") != -1)
            location.href = "/Love21/Products.aspx?Category=" + Category;
         // Added by 03/15/2010, Kitae Park, 013-5078[21MEN]
         else if ((Category.toLowerCase().indexOf("21men") != -1) || (Category.toLowerCase().indexOf("menpromo") != -1))
            location.href = "/21Men/Products.aspx?Category=" + Category;
         // Added by 04/27/2010, Kitae Park, 014-0062 HTG81 KIDS 런칭
         else if (Category.toLowerCase().indexOf("boys") != -1 || Category.toLowerCase().indexOf("girls") != -1 || Category.toLowerCase().indexOf("kids") != -1)
            location.href = "/Htg81/Products.aspx?Category=" + Category; 
         else
            location.href = "/Forever21/Products.aspx?Category=" + Category + "&RowNum=1&CurrentPage=1&AllYN=N";
      }
   }
   else
   {
      if (Category.toLowerCase().indexOf('promo_fathersgiftguide') != -1 || Category.toLowerCase().indexOf('promo_graphictee') != -1)
         location.href = "/21men/productlist.aspx?promotype="+PromoType+"&category=" + Category;
      else if (Category.toLowerCase().indexOf("promo_hlayeritup") != -1)
         location.href = "/heritage1981/productlist.aspx?promotype="+PromoType+"&category=" + Category;    
      else if(Category.toLowerCase().indexOf('promo_brian') != -1)
         location.href = "/promotion/products.aspx?promotype="+PromoType+"&category=" + Category;
      else if(Category.toLowerCase().indexOf('menpromo') != -1)
         location.href = "/21men/productlist.aspx?promotype="+PromoType+"&category=" + Category;
      else if(Category.toLowerCase().indexOf('kidspromo') != -1)
         location.href = "/htg81/productlist.aspx?promotype="+PromoType+"&category=" + Category;
      else if(Category.toLowerCase().indexOf('hH81promo') != -1)
         location.href = "/htg81/productlist.aspx?promotype="+PromoType+"&category=" + Category;
      else if (Category.toLowerCase().indexOf('promo') != -1)
         location.href = "/promotion/productlist.aspx?promotype="+PromoType+"&category=" + Category;
   }
  
}

function goPromoCategoryList(Category, PromoType)
{
   if(PromoType !="")
   {
      if (Category.toLowerCase().indexOf('promo') != -1)
         location.href = "/promotion/productlist.aspx?promotype="+PromoType+"&category=" + Category;
   }
   else
   {
      if (Category.toLowerCase().indexOf("promo") != -1)
         location.href = "/promotion/products.aspx?category=" + Category;
   }
}

function goProductDetail(ProductId, Category)
{
   // Added by Kitae Park, 11/30/2009, Heritage1981/Men/
   if (Category.toLowerCase().indexOf("81") != -1)
   {
      if(Category.toLowerCase().indexOf("81m") != -1)
         location.href = "/Heritage1981/Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
      else
         location.href = "/Heritage1981/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
   }  
   else if (Category.toLowerCase().indexOf("tbt") != -1)
      location.href = "/Twelve/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
   else if (Category.toLowerCase().indexOf("love21") != -1)
      location.href = "/Love21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
   // Added by 03/15/2010, Kitae Park, 013-5078[21MEN]
   else if ((Category.toLowerCase().indexOf("21men") != -1) || (Category.toLowerCase().indexOf("menpromo") != -1))
      location.href = "/21Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
   // Added by 04/27/2010, Kitae Park, 014-0062 HTG81 KIDS 런칭
   else if (Category.toLowerCase().indexOf("boys") != -1 || Category.toLowerCase().indexOf("girls") != -1 || Category.toLowerCase().indexOf("kids") != -1)
      location.href = "/Htg81/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
   // Added by 04/16/2010, Kitae Park, Goodbag
   else if (Category.toLowerCase().indexOf("f21_goodbag") != -1)
      location.href = "/event/1st.aspx";
   // Added by 12/30/2010, Sukwoo Kim, LuckyBag
   else if (Category.toLowerCase().indexOf("f21_luckybag") != -1)
      location.href = "/event/luckybag.aspx";
   else
      location.href = "/Forever21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
}

function goFProductDetail(ProductId, Category) {
    if (Category.toLowerCase().indexOf("81") != -1) {
        if (Category.toLowerCase().indexOf("81m") != -1)
            parent.location.href = "/Heritage1981/Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
        else
            parent.location.href = "/Heritage1981/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
    }
    else if (Category.toLowerCase().indexOf("tbt") != -1)
        parent.location.href = "/Twelve/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
    else if (Category.toLowerCase().indexOf("love21") != -1)
        parent.location.href = "/Love21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
    else if ((Category.toLowerCase().indexOf("21men") != -1) || (Category.toLowerCase().indexOf("menpromo") != -1))
        parent.location.href = "/21Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
    else if (Category.toLowerCase().indexOf("boys") != -1 || Category.toLowerCase().indexOf("girls") != -1 || Category.toLowerCase().indexOf("kids") != -1)
        parent.location.href = "/Htg81/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
    else if (Category.toLowerCase().indexOf("f21_goodbag") != -1)
        parent.location.href = "/event/1st.aspx";
    else if (Category.toLowerCase().indexOf("f21_luckybag") != -1)
        parent.location.href = "/event/luckybag.aspx";
    else
        parent.location.href = "/Forever21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId;
}

// Added by 05/20/2010, Kitae Park, Case#014-2824 goPromoProductDetail
// Added by 10/14/2010, Sukwoo Kim, 카테고리명에 따리 올바르게 좌측메뉴가 표시되게 수정
function goPromoProductDetail(ProductId, Category, Promotype)
{
   if(Category.toLowerCase().indexOf("promo_hlayeritup") != -1 || Category.toLowerCase().indexOf("h81promo") != -1)
      location.href = "/Heritage1981/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&type="+Promotype;
   else if(Category.toLowerCase().indexOf("21men") != -1 || Category.toLowerCase().indexOf("menpromo") != -1)
      location.href = "/21Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&type="+Promotype;
   else if(Category.toLowerCase().indexOf("love21") != -1)
      location.href = "/Love21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&type="+Promotype;
   else if(Category.toLowerCase().indexOf("boys") != -1 || Category.toLowerCase().indexOf("girls") != -1 || Category.toLowerCase().indexOf("kids") != -1)
      location.href = "/htg81/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&type="+Promotype;
   else
      location.href = "/Forever21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&type="+Promotype;
}

// Added by Kitae Park, 02/16/2010, 상세페이지로 가기_Quick View
function goDetail(ProductId, Category, ColorCode)
{
   if (Category.toLowerCase().indexOf("81") != -1)
   {
      if(Category.toLowerCase().indexOf("81m") != -1)
         parent.location.href = "/Heritage1981/Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&ColorCode=" + ColorCode;
      else
         parent.location.href = "/Heritage1981/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&ColorCode=" + ColorCode;
   }  
   else if (Category.toLowerCase().indexOf("tbt") != -1)
      parent.location.href = "/Twelve/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&ColorCode=" + ColorCode;
   else if (Category.toLowerCase().indexOf("love21") != -1)
      parent.location.href = "/Love21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&ColorCode=" + ColorCode;
   // Added by 03/15/2010, Kitae Park, 013-5078[21MEN]
   else if ((Category.toLowerCase().indexOf("21men") != -1) || (Category.toLowerCase().indexOf("menpromo") != -1))
      parent.location.href = "/21Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&ColorCode=" + ColorCode;
   // Added by 04/27/2010, Kitae Park, 014-0062 HTG81 KIDS 런칭
   else if (Category.toLowerCase().indexOf("boys") != -1 || Category.toLowerCase().indexOf("girls") != -1 || Category.toLowerCase().indexOf("kids") != -1)
      parent.location.href = "/Htg81/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&ColorCode=" + ColorCode;
   else
      parent.location.href = "/Forever21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&ColorCode=" + ColorCode;
}

function goProductInfo(ProductId, Category, RowNum)
{
   // Added by Kitae Park, 11/30/2009, Heritage1981/Men/
   if (Category.toLowerCase().indexOf("81") != -1)
   {
      if(Category.toLowerCase().indexOf("81m") != -1)
         location.href = "/Heritage1981/Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum;
      else   
         location.href = "/Heritage1981/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum;
   }   
   else if (Category.toLowerCase().indexOf("tbt") != -1)
      location.href = "/Twelve/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum;
   // Added by Kitae Park, 07/30/2009, [Love21 New page]
   else if (Category.toLowerCase().indexOf("love21") != -1)
      location.href = "/Love21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum;
   // Added by 03/15/2010, Kitae Park, 013-5078[21MEN]
   else if ((Category.toLowerCase().indexOf("21men") != -1) || (Category.toLowerCase().indexOf("menpromo") != -1))
      location.href = "/21Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum;
   // Added by 04/27/2010, Kitae Park, 014-0062 HTG81 KIDS 런칭
   else if (Category.toLowerCase().indexOf("boys") != -1 || Category.toLowerCase().indexOf("girls") != -1 || Category.toLowerCase().indexOf("kids") != -1)
      location.href = "/Htg81/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum;
   else
      location.href = "/Forever21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum;
}
// Added by Kitae Park, 09/23/2009, [Item Search]
function goProductInfo(ProductId, Category, RowNum, ColorCode)
{
    // Added by Kitae Park, 11/30/2009, Heritage1981/Men/
    if (Category.toLowerCase().indexOf("81") != -1)
    {
      if(Category.toLowerCase().indexOf("81m") != -1)
         location.href = "/Heritage1981/Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode;
      else
         location.href = "/Heritage1981/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode;
    }
   else if (Category.toLowerCase().indexOf("tbt") != -1)
   {
      if ((Category.toLowerCase() == "tbt_whatsnew"))
         location.href = "/Twelve/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&ColorCode=" + ColorCode;
      else
         location.href = "/Twelve/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode;
   }
   // Added by Kitae Park, 08/13/2009, [Love21 Page]
   else if (Category.toLowerCase().indexOf("love21") != -1)
   {      
      location.href = "/Love21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode;
   }
   // Added by 03/15/2010, Kitae Park, 013-5078[21MEN]
   else if ((Category.toLowerCase().indexOf("21men") != -1) || (Category.toLowerCase().indexOf("menpromo") != -1))
   {      
      location.href = "/21Men/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode;
   }
   // Added by 04/27/2010, Kitae Park, 014-0062 HTG81 KIDS 런칭
   else if (Category.toLowerCase().indexOf("boys") != -1 || Category.toLowerCase().indexOf("girls") != -1 || Category.toLowerCase().indexOf("kids") != -1)
   {      
      location.href = "/Htg81/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode;
   }
   else
      location.href = "/Forever21/ProductView.aspx?Category=" + Category + "&ProductId=" + ProductId + "&RowNum=" + RowNum + "&ColorCode=" + ColorCode;
}

function goSearch(SearchType, SearchResult)
{
    var SearchText, SearchOption;
    if(SearchType == "R")
    {
       SearchText = document.getElementById("clSearch2");
       SearchOption = "All";
       //SearchOption = document.getElementById("clSearchOption2").value;
       if(SearchText.value == "")
       {
           alert("検索する単語を入力して下さい。");
           SearchText.focus();
           return false;
       }
       location.href="/Product/Search.aspx?SearchType="+SearchType+"&SearchText="+SearchText.value+"&SearchOption="+SearchOption+"&SearchResult="+SearchResult;
    }
    else
    {
       
       SearchText = document.getElementById("clSearch");
       SearchOption = "All";
       //SearchOption = document.getElementById("clSearchOption").value;
       if(SearchText.value == "")
       {
           alert("検索する単語を入力して下さい。");
           SearchText.focus();
           return;
       }
       location.href = "/Product/Search.aspx?SearchType=" + SearchType + "&SearchText=" + SearchText.value +"&SearchOption="+SearchOption;
    }
    return false;
}
//function goSearch()
//{
//    var SearchText, SearchOption;
//    SearchText = document.getElementById("clSearch");
//    SearchOption = document.getElementById("clSearchOption").value;
//    if(SearchText.value == "")
//    {
//        alert("検索する単語を入力して下さい。");
//        SearchText.focus();
//        return false;
//    }
//    location.href="/Product/Search.aspx?SearchText="+SearchText.value+"&SearchOption="+SearchOption;
//}

var discount = 20;
function openQuickView(ProductID, Categroy)
{
   document.getElementById("t").src="/Control/QuickView.aspx?ProductID="+ProductID+"&Category="+Categroy;
   document.getElementById("dQuickView").style.display = "block";
   document.getElementById("dQuickView").style.top = "30%";

   var sTop = document.body.scrollTop;
   var sLeft = document.documentElement.scrollLeft;

   if (sTop == 0)
      sTop = document.documentElement.scrollTop;
   //tmpTop = sTop + ((document.documentElement.scrollHeight - 350) / 3);
   tmpTop = sTop + 100;
   tmpLeft = sLeft + ((document.documentElement.scrollWidth - 660) / 2);
   document.getElementById("dQuickView").style.position = "absolute";
   document.getElementById("dQuickView").style.left = tmpLeft;
   document.getElementById("dQuickView").style.top = tmpTop
   document.getElementById('t').style.height = 711;
   document.getElementById('t').style.width = 700;
}
// Added by Kitae Park, 09/23/2009, [Item Search]
// Added, 7/12/2010, Kitae Park, Case#014-8433 Quick View 기능 개선
//function openQuickView(ProductID, Categroy, imgCount)
//{
//   var browsertype = browserType();
//   document.getElementById("t").src="/Control/QuickView.aspx?ProductID="+ProductID+"&Category="+Categroy+"&imgCount="+imgCount;
//   document.getElementById("dQuickView").style.display = "block";
//   document.getElementById("dQuickView").style.top = "30%";

//   var sTop = document.body.scrollTop;
//   var sLeft = document.documentElement.scrollLeft;

//   if (sTop == 0)
//      sTop = document.documentElement.scrollTop;
//   if(browsertype == "1")
//	{
//	   tmpTop = sTop + ((document.documentElement.scrollHeight - 350) / 3);
//	   tmpLeft = sLeft + ((document.documentElement.scrollWidth - 660) / 2);
//   }
//   else
//   {
//	   tmpTop = sTop + 250;// + ((document.documentElement.scrollHeight - 350) / 3);
//	   tmpLeft = sLeft + ((document.documentElement.scrollWidth - 660) / 2);
//   }
//   
//   document.getElementById("dQuickView").style.position = "absolute";
//   document.getElementById("dQuickView").style.left = tmpLeft;
//   document.getElementById("dQuickView").style.top = tmpTop
//   if(imgCount < 6)
//      document.getElementById("t").style.height=640;
//   else
//      document.getElementById("t").style.height=720;    // 01/14/2011 by SeokWoo Kim 칼라가 많은경우는 카트에넣기버튼이 짤려버리므로 사이즈를 크게 변경해준다.
//   
//   document.getElementById("t").style.width=700;
//}

// ( 1)
function openQuickView(ProductID, Categroy, ColorCode, url)
{
	document.getElementById('t').src='/Control/QuickView.aspx?ProductID='+ProductID+'&Category='+Categroy+'&ColorCode='+ColorCode+'&rtnURL='+url;
	document.getElementById('dQuickView').style.display = 'block';
	document.getElementById('dQuickView').style.top = '30%';

	var sTop = document.body.scrollTop;
	var sLeft = document.documentElement.scrollLeft;

	if(sTop == 0) sTop = document.documentElement.scrollTop;

	tmpTop = sTop + 100; //((document.documentElement.scrollHeight - 350) / 3);
	tmpLeft = sLeft + ((document.documentElement.scrollWidth - 660) / 2);

	document.getElementById('dQuickView').style.position = 'absolute';
	document.getElementById('dQuickView').style.left = tmpLeft;
	document.getElementById('dQuickView').style.top = tmpTop
	document.getElementById('t').style.height = 711;
	document.getElementById('t').style.width = 700;
}

function CamiView(ProductID, Categroy)
{
	var browsertype = browserType();
	document.getElementById('t').src='/Control/CamiView.aspx?ProductID='+ProductID+'&Category='+Categroy;
	document.getElementById('dQuickView').style.display = 'block';
	document.getElementById('dQuickView').style.top = '30%';

	var sTop = document.body.scrollTop;
	var sLeft = document.documentElement.scrollLeft;

	if(sTop == 0) sTop = document.documentElement.scrollTop;

	if(browsertype == "1")
	{
	   tmpTop = sTop + ((document.documentElement.scrollHeight - 350) / 3);
	   tmpLeft = sLeft + ((document.documentElement.scrollWidth - 660) / 2);
      tmpTop = tmpTop + 50;
   }
   else
   {
	   tmpTop = 220;// sTop + ((document.documentElement.scrollHeight - 350) / 3);
	   tmpLeft = sLeft + ((document.documentElement.scrollWidth - 660) / 2);
      //tmpTop = tmpTop + 50;
   }
   
	document.getElementById('dQuickView').style.position = 'absolute';
	document.getElementById('dQuickView').style.left = tmpLeft;
	document.getElementById('dQuickView').style.top = tmpTop;
	document.getElementById('t').style.height=711;
	document.getElementById('t').style.width=700;
}

function closeQuickView()
{
   document.getElementById("t").src="/Control/Blank.aspx";
   document.getElementById("dQuickView").style.display = "none";
}
function fQuickView(id, v)
{
   var browsertype = browserType();
   if(browsertype == "1")
   {
      var sQuick = eval(document.getElementById(id));
      sQuick.style.visibility = v;
   }
}
function fFAQ(id, v)
{
   var sFAQ = eval(document.getElementById(id));
   sFAQ.style.visibility = v;
}
function fLoginPress(e)
{

}
function fZipCode()
{
   var X = ((document.body.clientWidth) / 2) - (417 / 2);
   var Y = ((document.body.clientHeight) / 2) - (500 / 2) + 50;
   var browsertype = browserType();
   if(browsertype == "3") 
   {
      X=0;
      Y=0;
   }
   config = "toolbar=no,directories=no,menubar=no,titlebar=no,status=no,scrollbars=yes,width=417,height=500,left=" + X + ",top=" + Y;
   window.open("/common/ZipCode.aspx", "ZipCode", config);
   return false;
}
function Mens_shoes()
{
   var X = ((document.body.clientWidth) / 2) - (662 / 2);
   var Y = ((document.body.clientHeight) / 2) - (682 / 2) + 50;
   var browsertype = browserType();
   if(browsertype == "3" || browsertype == "2") 
   {
      X=0;
      Y=0;
   }
   config = "toolbar=no,directories=no,menubar=no,titlebar=no,status=no,scrollbars=no,width=662,height=682,left=" + X + ",top=" + Y;
   window.open("/Popup/21men_shoes.htm", "ZipCode", config);
   return false;
}
function fTracking(trackingnumber)
{
   var X = ((document.body.clientWidth) / 2) - (600 / 2);
   var Y = ((document.body.clientHeight) / 2) - (250 / 2) + 50;
   config = "toolbar=no,directories=no,menubar=no,titlebar=no,status=no,scrollbars=yes,width=600,height=250,left=" + X + ",top=" + Y;
   window.open("http://www.hydex.net/ehydex/jsp/home/distribution/tracking/tracingNView.jsp?param1=338284&param2=" + trackingnumber, "配送照会", config);
}

function fnLogout()
{
   if( confirm("ログアウトしますか？"))
      location.href="/Login/Logout.aspx";
}
function fnQnAView(HiddenID)
{
   var div = eval("document.all."+HiddenID);
   if(div.style.display == "block")
      div.style.display = "none";
   else
      div.style.display = "block";
}

function fnQnAViewAll(HiddenID, num, maxnum)
{
   for(i=1; i<= maxnum; i++)
   {
      var div = eval("document.all."+HiddenID+i);
      
      if(i == num)
      {
         if(div.style.display == "block")
            div.style.display = "none";
         else
            div.style.display = "block";
      }
      else
      {
         div.style.display = "none";
      }
   }

}

function fnGetElementById(HiddenID, num, maxnum)
{

   for(i=1; i<= maxnum; i++)
   {
      var div = document.getElementById(HiddenID+i);
      
      if(i == num)
      {
         if(div.style.display == "block")
            div.style.display = "none";
         else
            div.style.display = "block";
      }
      else
      {
         div.style.display = "none";
      }      
   }
}

function show(div)
{
   if( div.style.display == 'none' )

      div.style.display = 'block';

   else

      div.style.display = 'none'; 
}


function MM_swapImgRestore() 
{ //v3.0
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
    x.src=x.oSrc;
}

function MM_findObj(n, d)
{ //v4.01
  var p,i,x;
    if(!d) d=document;
     if((p=n.indexOf("?"))>0&&parent.frames.length)
      {
         d=parent.frames[n.substring(p+1)].document;
         n=n.substring(0,p);
      }
         if(!(x=d[n])&&d.all) x=d.all[n];
          for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
            for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
               if(!x && d.getElementById) x=d.getElementById(n);
                return x;
}

function MM_swapImage() 
{ //v3.0
  var i,j=0,x,a=MM_swapImage.arguments;
   document.MM_sr=new Array;
    for(i=0;i<(a.length-2);i+=3)
      if ((x=MM_findObj(a[i]))!=null)
         {
            document.MM_sr[j++]=x;
             if(!x.oSrc) x.oSrc=x.src;
              x.src=a[i+2];
         }
}
function MoneyPay(pay)
{ 
 var idx=0; 
 arrRev = new Array(); 
 var lpay = ""; 
 pay = pay.toString(); 
 arr = pay.split(""); 
 //alert("arr" + arr); 
 //alert(arr.length); 
 for(i = arr.length; i > 0 ; i--){ 
     arrRev[idx] = arr[i-1]; 
     //alert(arrRev[idx] + "=>" + idx); 
     idx++; 
     if((idx ==3 || idx == 7 || idx == 11 || idx == 15 || idx == 19) && (i != 1)){ 
         arrRev[idx] = ","; 
         //alert(arrRev[idx] + "=>" + idx); 
         idx++; 
     } 
 } 
 //alert(arrRev.length); 
 for(i=arrRev.length; i>0; i--){ 
     lpay += arrRev[i-1]; 

 } 
 return lpay; 
}
function fnPress(e,type)
{
    var SearchText, SearchOption, SearchMode, reCheck;
    var hdsMode, hdsText, hdsOption;
   
    if(e.keyCode ==13){
        if(type == "top"){
            SearchText = document.getElementById("ctl00_SearchText");
            SearchOption = document.getElementById("ctl00_SearchOption").value;
            SearchMode = "all";
            reCheck = false;
        }else{
           SearchText = document.forms[0].SearchText;
            SearchOption = document.forms[0].SearchOption.value;
            SearchMode = document.forms[0].SearchMode.value;
//            reCheck = document.forms[0].reCheck.checked;
//            hdsMode = document.forms[0].hdsMode.value;
//            hdsText = document.forms[0].hdsText.value;
//            hdsOption = document.forms[0].hdsOption.value;
        }
        if(SearchText.value == ""){
            alert("検索する単語を入力して下さい");
            SearchText.focus();
            return false;
        }
         location.href="/Product/Search.aspx?SearchText="+SearchText.value+"&SearchOption="+SearchOption+"&SearchMode="+SearchMode;
    
        
        return false;
    }
}
function fn_findid()
{
   window.open("FindID.aspx","FindID","width=400,height=300");
   return false;
}
function fn_findpw()
{
   window.open("FindPW.aspx","FindID","width=400,height=300");
   return false;
}

function fn_PopSubscribe()
{
    window.open("/member/unsubscribe.aspx","","width=450,height=180");
}
function browserType()
{
   var appname = navigator.appName;
   var useragent = navigator.userAgent;
   var browsertype; //1:IE, 2:FF, 3:SF
   if(useragent.toLowerCase().indexOf("firefox") != -1)
      browsertype = "2";
   else if(useragent.toLowerCase().indexOf("safari") != -1)
       browsertype = "3";
   else if (useragent.toLowerCase().indexOf("chrome") != -1)
       browsertype = "4";
   else
      browsertype = "1";
   return browsertype;
}
// Form validation
var agent = navigator.userAgent;
var ie;
if(agent.toLowerCase().indexOf("firefox") != -1)
   ie = false;
else if(agent.toLowerCase().indexOf("safari") != -1)
   ie = false;
else
   ie = true;
   
function OnlyString(e)
{
     if(ie){
           if(event.keyCode >=48 && event.keyCode <=57) //0~9
                return false;
           else if(event.keyCode == 59 || event.keyCode == 47) // ;,/
                return false;
           else if(event.keyCode == 8 || event.keyCode == 45 || event.keyCode == 40 || event.keyCode == 41 || event.keyCode == 32)          //backspace,-,(,),sp
                return true;
           else
                return true;
     }else{
           if(e.which >=48 && e.which <=57) //0~9
                return false;
           else if(e.which == 59 || e.which == 47) // ;,/
                return false;
           else if(e.which == 8 || e.which == 45 || e.which == 40 || e.which == 41 || e.which == 32)       //backspace,-,(,),sp
                return true;
           else
                return true;
     }
}

function OnlyAlphabet(e)
{
     if(ie){
           if(event.keyCode >=65 && event.keyCode <=90) //A~Z
                return true;
           else if(event.keyCode >=97 && event.keyCode <=122) //a~z
                return true;
           else if(event.keyCode ==32 || event.keyCode == 8 || event.keyCode == 46) //space,backspace,del
                return true;
           else
                return false;
     }else{
           if(e.which >=65 && e.which <=90) //A~Z
                return true;
           else if(e.which >= 97 && e.which <= 122) //a~z
                return true;
           else if(e.which == 32 || event.which == 8 || event.which == 46)    //space,backspace,del
                return true;
           else
                return false;
     }
}

function OnlyStringNumber(e)
{
     if(ie){
           if(event.keyCode >=48 && event.keyCode <=57) //0~9
                return true;
           else if(event.keyCode == 8 || event.keyCode == 45 || event.keyCode == 40 || event.keyCode == 41 || event.keyCode == 32 ||  event.keyCode == 13)             //backspace,-,(,),sp,enter
                return true;
           else if(event.keyCode >=65 && event.keyCode <=90 || event.keyCode >=97 && event.keyCode <=122)  //a~z,A~Z
                return true;
           else
                return false;
     }else{
           if(e.which >=48 && e.which <=57) //0~9
                return true;
           else if(e.which == 8 || e.which == 45 || e.which == 40 || e.which == 41 || e.which == 32 ||  e.which == 13)       //backspace,-,(,),sp,enter
                return true;
           else if(e.which >=65 && e.which <=90 || e.which >=97 && e.which <=122)  //a~z,A~Z
                return true;
           else
                return false;
     }
}

function OnlyNumber(e)
{       
     if(ie){
           if(event.keyCode >=48 && event.keyCode <=57) //0~9
                return true;
           else if(event.keyCode == 8 || event.keyCode == 45 || event.keyCode == 40 || event.keyCode == 41 || event.keyCode == 32)          //backspace,-,(,),sp
                return true;
           else
                return false;
     }else{
           if(e.which >=48 && e.which <=57) //0~9
                return true;
           else if(e.which == 8 || e.which == 45 || e.which == 40 || e.which == 41 || e.which == 32)       //backspace,-,(,),sp
                return true;
           else
                return false;
     }
}

function getDocHeight(doc)
{
  var docHt = 0, sh, oh;
  if (doc.height)
  {
    docHt = doc.height;
  }
  else if (doc.body)
  {
    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
    if (sh && oh) docHt = Math.max(sh, oh);
  }
  
  return docHt;
}

function getDocWidth(doc)
{
  var docHt = 0, sh, oh;
  if (doc.width)
  {
    docHt = doc.width;
  }
  else if (doc.body)
  {
    if (doc.body.scrollWidth) docHt = sh = doc.body.scrollWidth;
    if (doc.body.offsetWidth) docHt = oh = doc.body.offsetWidth;
    if (sh && oh) docHt = Math.max(sh, oh);
  }
  
  return docHt;
}

function getReSize()
{
  var iframeWin = window.frames['VariantFrame'];

  var iframeEl = window.document.getElementById? window.document.getElementById('VariantFrame'): document.all? document.all['ifrm']: null;

  if ( iframeEl && iframeWin )
  {
    var docHt = getDocHeight(iframeWin.document);
    var docWidth = getDocWidth(iframeWin.document);
    if (docHt != iframeEl.style.height) iframeEl.style.height = docHt + 'px';
    if (docHt != iframeEl.style.width) iframeEl.style.width = docWidth + 'px';
  }
  else
  { // firefox
    var docHt = window.document.getElementById('VariantFrame').contentDocument.height;
    window.document.getElementById('VariantFrame').style.height = docHt + 'px';
  }
}

function fnViewVariant(productid)
{
    //alert(productid);
    //theBody = document.getElementsByTagName('BODY')[0];
    theBody = document.getElementById('td_'+productid);
    popVariant = document.createElement('div');
    popVariant.id = 'popVariant';
    popVariant.position = 'relative';
    popInnerBody = document.createElement('div');
    popInnerBody.id = 'popInnerBody';
    popInnerBody.position = 'absolute';
    
    popInnerBody.innerHTML = '<iframe id="VariantFrame" style="height:10px;width=10px" onload="javascript:getReSize()" frameborder="0" scrolling="no" src="/Control/ProductVariant.aspx?productid=' + productid + '" />';
    
    popVariant.appendChild(popInnerBody);
    theBody.appendChild(popVariant);
    
    gVariantFrame = document.getElementById('VariantFrame');
    gFrameInnerBody = gVariantFrame.contentWindow;//.document.documentElement;
    //alert(gFrameInnerBody.location);
    //var innerWidth = gFrameInnerBody.scrollHeight;
    //alert(innerWidth);
    gpopInnerBody = document.getElementById('popInnerBody');
    
    gpopInnerBody.style.position = 'absolute';
}

function fnHideVariant(productid)
{
    theBody = document.getElementById('td_' + productid);
    popVariant = document.getElementById('popVariant');
    
    if(popVariant != null)
        theBody.removeChild(popVariant);
}