// JavaScript Document
jQuery.noConflict();
function SetIntervalClass()
{
   this.timerId = null;
   this.call = function(func, speed)
   {
      this.timerId = window.setInterval(function()
      {
         jQuery.each(func, function(i, n)
         {
            var objStr = "";
            jQuery.each(n, function(j, m)
            {
               if(j === 0)
               {
                  objStr += "n[" + j + "]"
               }
               else
               {
                  objStr += ",n[" + j + "]"
               }
            }
            );
            eval(i + "(" + objStr + ");")
         }
         )
      }
      , speed)
   }
   ;
   this.stopCall = function()
   {
      if(this.timerId !== null)
      {
         var timeId = this.timerId;
         window.clearInterval(timeId)
      }
      this.setempty()
   }
   ;
   this.setempty = function()
   {
      this.timerId = null
   }
}
var data_lazy_load =
{
   lazy_load : function(b, g, a, f)
   {
      var d = "textarea.lazy-data", c = "find", e = b[c](d);
      if(e.length === 1)
      {
         jQuery(e.text())[g](a);
         e.remove();
         if(typeof f === "function")
         {
            f()
         }
      }
   }
}
;
var show =
{
   show_list_height : 89, show_list_speed : 200, show_list_roll_speed : 500, show_list_range : [0, 0, 0, 0], show_list_position : 0, show_block_position : 0, show_list_auto_speed : 21300, show_star_range :
   {
      s : [170, 224], b : [190, 250], p : [0, 26]
   }
   , show_star_position : - 8, show_star_width : 178, show_star_speed : 250, show_star_movelist : [], dbclick : 0, dom_list : null, dom_list_dl : null, dom_list_back : null, dom_list_now : null, dom_star : null, dom_star_ul_li : null, dom_goods : null, setShowList : function()
   {
      this.dom_list_dl = this.dom_list.find("dl");
      if(this.dom_list.find("textarea.lazy-data").length === 0)
      {
         this.show_list_range[1] = (Math.ceil(this.dom_list_dl.length / 3) - 1) * this.show_list_height * 3;
         this.show_list_range[2] = this.dom_list_dl.length * this.show_list_height;
         this.show_list_range[3] = this.show_list_range[1] + this.show_list_range[2];
         this.dom_list_dl.clone().insertBefore(this.dom_list_now); this.dom_list_dl = this.dom_list.find("dl")
      }
      if(this.dom_list_dl.length > 0)
      {
         this.dom_list_dl.each(function(a)
         {
            if(jQuery(this).next("div.back").length === 0)
            {
               jQuery(this).after("<div class='star-all back' style='top:"+(a*show.show_list_height)+"px;'></div>")
            }
         }
         );
         this.dom_list_back = this.dom_list.find(".back");
         this.dom_list_dl.hover(function()
         {
            show.dom_list_back.removeClass("active");
            jQuery(this).next(".back").addClass("active")
         }
         , function()
         {
            show.dom_list_back.removeClass("active")
         }
         ).click(function()
         {
            show.show_block_position = jQuery(this).position().top;
            show.list_block_fly(show.show_block_position, jQuery(this).attr("title"), show.show_list_speed)
         }
         )
      }
   }
   , list_block_fly : function(a, c, b)
   {
      data_lazy_load.lazy_load(this.dom_star, "appendTo", this.dom_star, function()
      {
         show.setshowStar()
      }
      );
      data_lazy_load.lazy_load(this.dom_goods, "appendTo", this.dom_goods, function()
      {
         show.showGoods()
      }
      );
      this.dom_list_now.animate(
      {
         top : (a) + "px"
      }
      , b, function()
      {
         show.link_star(c)
      }
      )
   }
   , list_fly_code : function(f)
   {
      data_lazy_load.lazy_load(this.dom_list, "insertBefore", this.dom_list_now, function()
      {
         show.setShowList()
      }
      );
      if(f == "up")
      {
         var e = 0, d = 2, g = - 1
      }
      else
      {
         var e = 3, d = 1, g = 1
      }
      if(this.dbclick === 0)
      {
         this.dbclick = 1;
         if(this.show_list_position == this.show_list_range[e])
         {
            this.show_list_position = this.show_list_range[d];
            this.dom_list.css("top", "-" + this.show_list_position + "px");
            this.show_block_position = this.show_block_position + this.show_list_range[2] * ( - g);
            this.dom_list_now.css("top", this.show_block_position + "px")
         }
         this.show_list_position = this.show_list_position + this.show_list_height * 3 * g;
         this.show_block_position = this.show_block_position + this.show_list_height * 3 * g;
         this.list_block_fly(this.show_block_position, this.dom_list_dl.eq(this.show_block_position / this.show_list_height).attr("title"), show.show_list_roll_speed);
         this.dom_list.animate(
         {
            top : "-" + show.show_list_position + "px"
         }
         , show.show_list_roll_speed, function()
         {
            show.dbclick = 0
         }
         )
      }
   }
   , list_auto_fly : function()
   {
      var a = new SetIntervalClass();
      a.call(
      {
         "show.list_fly_code" : ["down"]
      }
      , show.show_list_auto_speed)
   }
   , setshowStar : function()
   {
      this.dom_star_ul_li = this.dom_star.find("ul li");
      this.dom_star_ul_li.each(function(a)
      {
         if(jQuery(this).find("div.shade").length === 0)
         {
            jQuery(this).append("<div class='shade'></div>")
         }
      }
      ).find(".shade").css("opacity", "0.6").click(function()
      {
         if(show.dbclick === 0)
         {
            var a = jQuery(this).parent("li").position().left - show.dom_star.find("div.active ul li.active").position().left;
            if(a !== 0)
            {
               if(a > 0)
               {
                  show.ready_fly(this, "left")
               }
               else
               {
                  if(a < 0)
                  {
                     show.ready_fly(this, "right")
                  }
               }
            }
         }
      }
      );
      this.dom_star_ul_li.filter(".active").find(".shade").css("opacity", "0")
   }
   , ready_fly : function(b, a)
   {
      data_lazy_load.lazy_load(this.dom_goods, "appendTo", this.dom_goods, function()
      {
         show.showGoods()
      }
      );
      if(a === "left")
      {
         if(this.dom_star.find("div.active ul li.active").next("li").next("li").length === 0)
         {
            this.show_star_movelist.push(this.dom_star.find("div.active ul li:first"));
            this.dom_star.find("div.active ul li:first").clone(true).insertAfter(".star-show .con .show-star .list .list-con div.active ul li:last")
         }
         this.show_star_position = this.show_star_position - this.show_star_width
      }
      else
      {
         if(a === "right")
         {
            if(this.dom_star.find("div.active ul li.active").prev("li").prev("li").length === 0)
            {
               this.show_star_movelist.push(this.dom_star.find("div.active ul li:last"));
               this.dom_star.find("div.active ul li:last").clone(true).prependTo(".star-show .con .show-star .list .list-con div.active ul");
               this.show_star_position = this.show_star_position - this.show_star_width;
               this.dom_star.css("left", this.show_star_position + "px")
            }
            this.show_star_position = this.show_star_position + this.show_star_width
         }
      }
      this.dbclick = 1;
      this.showStar_fly(b, a)
   }
   , showStar_fly : function(b, a)
   {
      this.dom_star.animate(
      {
         left : show.show_star_position + "px"
      }
      , show.show_star_speed, function()
      {
         if(show.show_star_movelist[0] !== undefined)
         {
            show.show_star_movelist[0].remove();
            show.show_star_movelist.shift();
            if(a === "left")
            {
               show.show_star_position = show.show_star_position + show.show_star_width;
               jQuery(this).css("left", show.show_star_position + "px")
            }
         }
         show.dbclick = 0
      }
      );
      this.dom_star.find("div.active ul li.active .shade").css("display", "block").animate(
      {
         opacity : 0.6
      }
      , show.show_star_speed);
      jQuery(b).animate(
      {
         opacity : 0
      }
      , show.show_star_speed, function()
      {
         jQuery(this).css("display", "none")
      }
      );
      this.dom_star.find("div.active ul li.active").animate(
      {
         height : show.show_star_range.s[1] + "px", width : show.show_star_range.s[0] + "px", top : show.show_star_range.p[1] + "px"
      }
      , show.show_star_speed, function()
      {
         jQuery(this).removeClass("active")
      }
      );
      jQuery(b).parent("li").animate(
      {
         height : show.show_star_range.b[1] + "px", width : show.show_star_range.b[0] + "px", top : show.show_star_range.p[0] + "px"
      }
      , show.show_star_speed, function()
      {
         jQuery(this).addClass("active");
         show.link_goods(jQuery(this).attr("title"))
      }
      )
   }
   , showGoods : function()
   {
      this.dom_goods.find("ul").each(function(a)
      {
         if(jQuery(this).find("li.back").length === 0)
         {
            jQuery(this).append("<li class='back star-all'></li>")
         }
      }
      ).mouseover(function()
      {
         show.dom_goods.find("div.active ul").removeClass("active");
         jQuery(this).addClass("active")
      }
      )
   }
   , link_star : function(a)
   {
      this.dom_star.find("div.active").removeClass("active").find("li").removeClass("active").attr("style", " ").find("img").attr("style", " ").end().find("div.shade").attr("style", " ").css("opacity", "0.6").end().each(function(b)
      {
         if(b === 1)
         {
            jQuery(this).addClass("active").find("div.shade").css("opacity", "0");
            return false
         }
      }
      );
      this.dom_star.find("div.list-kind[title='"+a+"']").addClass("active");
      this.dom_star.css("left", "-8px");
      this.show_star_position = - 8;
      this.link_goods(this.dom_star.find("div.active ul li.active").attr("title"))
   }
   , link_goods : function(a)
   {
      this.dom_goods.find("div.active").removeClass("active").find("ul").removeClass("active").each(function(b)
      {
         if(b === 0)
         {
            jQuery(this).addClass("active");
            return false
         }
      }
      );
      this.dom_goods.find("div.list-kind[title='"+a+"']").addClass("active")
   }
   , begin : function()
   {
      this.dom_list = jQuery(".star-show .con .show-list .list .list-con");
      this.dom_list_now = this.dom_list.find("div.now");
      this.dom_star = jQuery(".star-show .con .show-star .list .list-con");
      this.dom_goods = jQuery(".star-show .con .show-goods .list");
      this.setShowList();
      jQuery(".star-show .con .show-list .list-up").hover(function()
      {
         jQuery(this).css("top", "-1px")
      }
      , function()
      {
         jQuery(this).css("top", "0px")
      }
      ).click(function()
      {
         show.list_fly_code("up")
      }
      );
      jQuery(".star-show .con .show-list .list-down").hover(function()
      {
         jQuery(this).css("top", "1px")
      }
      , function()
      {
         jQuery(this).css("top", "0px")
      }
      ).click(function()
      {
         show.list_fly_code("down")
      }
      );
      this.setshowStar();
      jQuery(".star-show .con .show-star .list-left").click(function()
      {
         if(show.dbclick === 0)
         {
            show.ready_fly(show.dom_star.find("div.active ul li.active").prev("li").find(".shade"), "right")
         }
      }
      );
      jQuery(".star-show .con .show-star .list-right").click(function()
      {
         if(show.dbclick === 0)
         {
            show.ready_fly(show.dom_star.find("div.active ul li.active").next("li").find(".shade"), "left")
         }
      }
      );
      this.showGoods();
      this.list_auto_fly()
   }
}
;
var cd =
{
   li_num : 0, list_con_position : 0, cd_speed : 200, list_speed : 500, list_width : 786, auto_speed : 19300, dbclick : 0, dom_title_ul : null, dom_title_ul_li : null, dom_list : null, cd_out : function(b)
   {
      var a = jQuery(b).parents("ul");
      if(a.find(".cd").length === 0)
      {
         a.append("<div class='cd img-all'></div>")
      }
      a.find(".cd").animate(
      {
         left : "130px"
      }
      , this.cd_speed)
   }
   , cd_in : function(b)
   {
      var a = jQuery(b).parents("ul");
      a.find(".cd").animate(
      {
         left : "115px"
      }
      , this.cd_speed)
   }
   , setli : function()
   {
      var a = this.dom_list.find("textarea.lazy-data").length === 0 ? this.dom_list.find("ul").length : this.dom_list.find("textarea.lazy-data").attr("list-len");
      this.li_num = Math.ceil(a / 6);
      for(var b = 0; b < this.li_num; b ++ )
      {
         if(b === 0)
         {
            this.dom_title_ul.append("<li class='active' value='0'>&bull;</li>")
         }
         else
         {
            this.dom_title_ul.append("<li value='"+b+"'>&bull;</li>")
         }
      }
      this.dom_title_ul_li = this.dom_title_ul.find("li");
      this.dom_title_ul_li.click(function()
      {
         if(cd.dbclick === 0)
         {
            cd.dom_title_ul_li.removeClass("active");
            jQuery(this).addClass("active");
            cd.list_con_position = jQuery(this).attr("value") * cd.list_width;
            cd.fly_code(cd.list_con_position)
         }
      }
      )
   }
   , setcd : function()
   {
      this.dom_list.find("ul li.img").hover(function()
      {
         cd.cd_out(this)
      }
      , function()
      {
         cd.cd_in(this)
      }
      )
   }
   , fly_code : function(a)
   {
      if(this.dbclick === 0)
      {
         data_lazy_load.lazy_load(this.dom_list, "insertBefore", this.dom_list.find("div.clear"), function()
         {
            cd.setcd()
         }
         );
         this.dbclick = 1;
         this.dom_list.animate(
         {
            left : "-" + a + "px"
         }
         , cd.list_speed, function()
         {
            cd.dbclick = 0
         }
         )
      }
   }
   , list_fly : function()
   {
      if(this.list_con_position == this.list_width * (this.li_num - 1))
      {
         this.list_con_position = 0
      }
      else
      {
         this.list_con_position += this.list_width
      }
      this.dom_title_ul_li.removeClass("active");
      this.dom_title_ul_li.filter("[value=" + this.list_con_position / this.list_width + "]").addClass("active");
      this.fly_code(this.list_con_position)
   }
   , auto_fly : function()
   {
      var a = new SetIntervalClass();
      a.call(
      {
         "cd.list_fly" : []
      }
      , cd.auto_speed)
   }
   , begin : function()
   {
      this.dom_title_ul = jQuery(".star-cd .con .title ul");
      this.dom_list = jQuery(".star-cd .con .starlist .list .list_con");
      this.setli();
      this.setcd();
      this.auto_fly()
   }
}
;
var wall =
{
   page_num : 0, fly_speed : 250, dbclick : 0, element_list : ["new-left", "show-left", "act-left", "active-left", "active", "active-right", "act-right", "show-right", "new-right"], element_index : ["new-left", "new-right", "show-left", "show-right", "act-left", "act-right", "active-left", "active-right", "active"], end_li : [], fly_argument : [0, null], auto_speed : 17300, wall_element :
   {
      "new-left" :
      {
         w_opacity : 1, w_index : 20, w_position : [0, 45], w_size : [124, 155], w_class : "new-left"
      }
      , "show-left" :
      {
         w_opacity : 0.8, w_index : 30, w_position : [9, 37], w_size : [144, 180], w_class : "show-left"
      }
      , "act-left" :
      {
         w_opacity : 0.6, w_index : 40, w_position : [14, 128], w_size : [144, 180], w_class : "act-left"
      }
      , "active-left" :
      {
         w_opacity : 0, w_index : 50, w_position : [4, 219], w_size : [160, 200], w_class : "active-left"
      }
      , active :
      {
         w_opacity : 0, w_index : 60, w_position : [4, 391], w_size : [160, 200], w_class : "active"
      }
      , "active-right" :
      {
         w_opacity : 0, w_index : 50, w_position : [4, 563], w_size : [160, 200], w_class : "active-right"
      }
      , "act-right" :
      {
         w_opacity : 0.6, w_index : 40, w_position : [14, 670], w_size : [144, 180], w_class : "act-right"
      }
      , "show-right" :
      {
         w_opacity : 0.8, w_index : 30, w_position : [9, 761], w_size : [144, 180], w_class : "show-right"
      }
      , "new-right" :
      {
         w_opacity : 1, w_index : 20, w_position : [0, 773], w_size : [124, 155], w_class : "new-right"
      }
   }
   , dom_title_ul_li : null, dom_list_ul : null, setPage : function()
   {
      this.dom_title_ul_li.hover(function()
      {
         jQuery(this).css("color", "#C8282B")
      }
      , function()
      {
         jQuery(this).css("color", "#555")
      }
      ).click(function()
      {
         wall.list_fly(3, jQuery(this).attr("class"))
      }
      )
   }
   , setStarWall : function()
   {
      this.dom_list_ul.find("li.star-img").each(function(a, b)
      {
         if(jQuery(b).find("div.shade").length === 0)
         {
            jQuery(b).append("<div class='shade'></div>")
         }
         var d, e = jQuery(b).attr("class") == "star-img" ? jQuery(b).attr("class") : jQuery(b).attr("class").split(" ")[1].split("-")[0];
         switch(e)
         {
            case"new" :
               d = 1;
               break;
            case"show" :
               d = 0.8;
               break;
            case"act" :
               d = 0.6;
               break;
            case"active" :
               d = 0;
               break;
            default :
               d = 1;
               break
         }
         jQuery(b).find("img").hover(function()
         {
            jQuery(this).parents("li").css("border", "1px solid #f60")
         }
         , function()
         {
            jQuery(this).parents("li").css("border", "1px solid #592A0E")
         }
         );
         jQuery(b).find(".shade").css("opacity", d).click(function()
         {
            var f = wall.reTowards(jQuery(this).parent("li").attr("class").split(" ")[1].split("-")[1]);
            var c = Math.abs(wall.dom_list_ul.find("li.star-img").index(jQuery(this).parent("li")[0]) - wall.dom_list_ul.find("li.star-img").index(wall.dom_list_ul.find("li.active")[0]));
            wall.list_fly(c, f)
         }
         )
      }
      )
   }
   , list_fly : function(b, a)
   {
      if(this.dbclick === 0)
      {
         this.dbclick = 1;
         data_lazy_load.lazy_load(this.dom_list_ul, "insertBefore", this.dom_list_ul.find("li.up-left"), function()
         {
            wall.setStarWall()
         }
         );
         this.fly_continue(b, a)
      }
   }
   , reTowards : function(a)
   {
      if(a == "left")
      {
         return"right"
      }
      else
      {
         return"left"
      }
   }
   , getTarget : function(b, c)
   {
      var a = c == "left" ? "prev" : "next";
      if(b[a]("li.star-img").length > 0)
      {
         return this.wall_element[b[a]("li.star-img").attr("class").split(" ")[1]]
      }
      else
      {
         return null
      }
   }
   , fly_continue : function()
   {
      if(arguments.length == 2)
      {
         this.fly_argument[0] = arguments[0];
         this.fly_argument[1] = arguments[1];
         this.fly_control(arguments[1])
      }
      else
      {
         this.dom_list_ul.find("li.clone").remove();
         this.dom_list_ul.find("li.none").attr("class", "star-img").attr("style", "");
         this.dom_list_ul.find("li.new").attr("class", "star-img new-" + wall.reTowards(wall.fly_argument[1])).attr("style", "left:" + wall.wall_element["new-" + wall.reTowards(wall.fly_argument[1])].w_position[1] + "px;");
         jQuery.each(wall.element_index, function(b, a)
         {
            wall.dom_list_ul.find("li." + a).css("z-index", "")
         }
         );
         this.end_li = [];
         this.fly_argument[0] -= 1;
         if(this.fly_argument[0] > 0)
         {
            this.fly_control(this.fly_argument[1])
         }
         else
         {
            this.dbclick = 0
         }
      }
   }
   , fly_control : function(a)
   {
      jQuery.each(wall.element_list, function(e, d)
      {
         var j = wall.reTowards(a);
         var c = wall.dom_list_ul.find("li." + d);
         if(d == "new-" + j)
         {
            var b = a == "left" ? "next" : "prev";
            var g = a == "left" ? 0 : wall.dom_list_ul.find("li.star-img").length - 1;
            var f = a == "left" ? 0 : wall.dom_list_ul.find("li.star-img").length;
            var h = a == "left" ? "insertAfter" : "insertBefore"; if(c[b]("li.star-img").length > 0)
            {
               c[b]("li.star-img").addClass("new " + j)
            }
            else
            {
               wall.dom_list_ul.find("li.star-img").eq(g).clone(true)[h](c[0]).attr("class", "star-img new " + j);
               wall.dom_list_ul.find("li.star-img").eq(f).addClass("clone")
            }
         }
         if(d == "new-" + a)
         {
            c.addClass("none");
            return true
         }
         wall.fly_code(c, wall.getTarget(c, a), wall.wall_element[d].w_index);
         return true
      }
      )
   }
   , the_end : function(a)
   {
      if(this.end_li.push(a) == 8)
      {
         this.fly_continue()
      }
   }
   , fly_code : function(b, c, a)
   {
      if(c)
      {
         var e = 0;
         b.animate(
         {
            width : c.w_size[0] + "px", height : c.w_size[1] + "px", top : c.w_position[0] + "px", left : c.w_position[1] + "px"
         }
         , wall.fly_speed, function()
         {
            jQuery(this).css("z-index", a).attr("class", "star-img " + c.w_class);
            d()
         }
         );
         b.find(".shade").css("display", "block").animate(
         {
            opacity : c.w_opacity
         }
         , wall.fly_speed, function()
         {
            jQuery(this).css("display", "");
            d()
         }
         );
         var d = function()
         {
            e ++ ;
            if(e == 2)
            {
               wall.the_end(c.w_class)
            }
         }
      }
   }
   , autoFly : function()
   {
      var a = new SetIntervalClass();
      a.call(
      {
         "wall.list_fly" : [1, "left"]
      }
      , wall.auto_speed)
   }
   , begin : function()
   {
      this.dom_title_ul_li = jQuery(".star-wall .con .title ul li");
      this.dom_list_ul = jQuery(".star-wall .con .starlist ul");
      this.dom_list_ul.append("<li class='back up-left'></li><li class='back up-right'></li><li class='back down-left'></li><li class='back down-right'></li>");
      this.setStarWall();
      this.setPage();
      this.autoFly()
   }
}
;
var ticket =
{
   dom_list_ul : null, dom_tab : null, tab_tag_hover : function(b, a)
   {
      ticket.dom_tab.find("ul.t-tags li").removeClass("active");
      jQuery(b).addClass("active");
      ticket.dom_tab.find("div.t-list").removeClass("active");
      a.addClass("active")
   }
   , tab_list_hover : function()
   {
      ticket.dom_tab.find(".t-list ul").hover(function()
      {
         jQuery(this).addClass("active")
      }
      , function()
      {
         jQuery(this).removeClass("active")
      }
      )
   }
   , begin : function()
   {
      this.dom_list_ul = jQuery(".star-ticket .con .ticketcon .ticket-list ul");
      this.dom_tab = jQuery(".star-ticket .con .ticketcon .ticket-tab");
      this.dom_list_ul.append('<li class="t-back"></li>');
      this.dom_list_ul.find("li.t-back").css("opacity", "0.7");
      this.dom_list_ul.find("li.t-name").css("opacity", "0.7");
      this.dom_list_ul.hover(function()
      {
         jQuery(this).addClass("active");
         if(jQuery(this).find("li.t-name").text().length > 10)
         {
            jQuery(this).find("li.t-name")[0].innerHTML = "<marquee scrolldelay='40' scrollamount='1' direction='left'>" + jQuery(this).find("li.t-name").attr("title") + "</marquee>"
         }
      }
      , function()
      {
         jQuery(this).removeClass("active");
         if(jQuery(this).find("li.t-name marquee").length > 0)
         {
            jQuery(this).find("li.t-name").html(jQuery(this).find("li.t-name").attr("title"))
         }
      }
      );
      this.dom_tab.find("ul.t-tags li").mouseover(function()
      {
         var a = ticket.dom_tab.find("div.t-list[name=" + jQuery.trim(jQuery(this).text()) + "]");
         if(a.length > 0)
         {
            ticket.tab_tag_hover(this, a)
         }
         else
         {
            data_lazy_load.lazy_load(ticket.dom_tab, "appendTo", ticket.dom_tab, ticket.tab_list_hover)
         }
      }
      );
      this.tab_list_hover()
   }
}
;
jQuery(function(a)
{
   show.begin();
   ticket.begin();
   cd.begin();
   wall.begin();
   a(".star-store .con .starlist ul").hover(function()
   {
      a(this).addClass("active")
   }
   , function()
   {
      a(this).removeClass("active")
   }
   )
}
);
