function C_slider(frame,list,Lframe,Llist,forwardEle,backEle,scrollType,LscrollType,acitonType,autoInterval){
	this.frame = frame;
	this.list = list;
	this.Lframe = Lframe;
	this.Llist = Llist;
	this.forwardEle = forwardEle;
	this.backEle = backEle;
	this.scrollType = scrollType;
	this.LscrollType = LscrollType;
	this.acitonType = acitonType;
	this.autoInterval = autoInterval;
	
	this.slideLength = $("#"+this.Llist+" > li").length;//总的slider数量
	this.currentSlide = 0;
	this.FrameHeight = $("#"+this.frame).height();
	this.FrameWidth = $("#"+this.frame).width();
	this.lFrameHeight = $("#"+this.Lframe).height();
	this.lFrameWidth = $("#"+this.Lframe).width();
	this.lListHeight = $("#"+this.Llist+" >li").eq(0).outerHeight(true);
	this.lListWidth = $("#"+this.Llist+" >li").eq(0).outerWidth(true);
	
	var self = this;
	
	for(var i = 0; i<this.slideLength; i++) {
		$("#"+this.Llist+" > li").eq(i).data("index",i);
		$("#"+this.Llist+" > li").eq(i).bind(this.acitonType,function(){
			self.go($(this).data("index"));
		});
	};
	
	//给"上一个"、"下一个"按钮添加动作
	$("#"+this.forwardEle).bind('click',function(){
		self.forward();
		return false;
	});
	$("#"+this.backEle).bind('click',function(){
		self.back();
		return false;
	});
	
	//定论鼠标划过时，自动轮换的处理
	$("#"+this.frame+",#"+this.Lframe+",#"+this.forwardEle+",#"+this.backEle).bind('mouseover',function(){
		clearTimeout(self.autoExt);
	});
	
	$("#"+this.frame+",#"+this.Lframe+",#"+this.forwardEle+",#"+this.backEle).bind('mouseout',function(){
		clearTimeout(self.autoExt);
		self.autoExt = setTimeout(function(){
			self.extInterval();
		},self.autoInterval);
	});	
	
	
	//开始自动轮换
	this.autoExt = setTimeout(function(){
		self.extInterval();
	},this.autoInterval);
}
//执行运动
C_slider.prototype.go = function(index){
	this.currentSlide = index;
	if (this.scrollType == "left"){
		$("#"+this.list).animate({
			marginLeft: (-index*this.FrameWidth)+"px"
		}, {duration:600,queue:false}); 		
	} else if (this.scrollType == "top"){
		$("#"+this.list).animate({
			marginTop: (-index*this.FrameHeight)+"px"
		}, {duration:600,queue:false}); 		
	}
	
	$("#"+this.Llist+" > li").removeClass("cur");
	$("#"+this.Llist+" > li").eq(index).addClass("cur");
		
	//对于缩略图的滚动处理
	if(this.LscrollType == "left"){
		if(this.slideLength*this.lListWidth > this.lFrameWidth){
			var spaceWidth = (this.lFrameWidth - this.lListWidth)/2;
			var hiddenSpace = this.lListWidth*this.currentSlide - spaceWidth;
			
			if (hiddenSpace > 0){
				if(hiddenSpace+this.lFrameWidth <= this.slideLength*this.lListWidth){
					$("#"+this.Llist).animate({
						marginLeft: -hiddenSpace+"px"
					}, {duration:600,queue:false}); 
				} else {
					var endHidden = this.slideLength*this.lListWidth - this.lFrameWidth;
					$("#"+this.Llist).animate({
						marginLeft: -endHidden+"px"
					}, {duration:600,queue:false}); 
				}
			} else {
				$("#"+this.Llist).animate({
					marginLeft: "0px"
				}, {duration:600,queue:false}); 
			}
		}
		
	} else if (this.LscrollType == "top"){
		if(this.slideLength*this.lListHeight > this.lFrameHeight){
			var spaceHeight = (this.lFrameHeight - this.lListHeight)/2;
			var hiddenSpace = this.lListHeight*this.currentSlide - spaceHeight;
			
			if (hiddenSpace > 0){
				if(hiddenSpace+this.lFrameHeight <= this.slideLength*this.lListHeight){
					$("#"+this.Llist).animate({
						marginTop: -hiddenSpace+"px"
					}, {duration:600,queue:false}); 
				} else {
					var endHidden = this.slideLength*this.lListHeight - this.lFrameHeight;
					$("#"+this.Llist).animate({
						marginTop: -endHidden+"px"
					}, {duration:600,queue:false}); 
				}
			} else {
				$("#"+this.Llist).animate({
					marginTop: "0px"
				}, {duration:600,queue:false}); 
			}
		}
		
	}
	
}
//前进
C_slider.prototype.forward = function(){
	if(this.currentSlide<this.slideLength-1){
		this.currentSlide += 1;
		this.go(this.currentSlide);
	}else {
		this.currentSlide = 0;
		this.go(0);
	}
}
//后退
C_slider.prototype.back = function(){
	if(this.currentSlide>0){
		this.currentSlide -= 1;
		this.go(this.currentSlide);
	}else {
		this.currentSlide = this.slideLength-1;
		this.go(this.slideLength-1);
	}
}
//自动执行
C_slider.prototype.extInterval = function(){
	if(this.currentSlide<this.slideLength-1){
		this.currentSlide += 1;
		this.go(this.currentSlide);
	}else {
		this.currentSlide = 0;
		this.go(0);
	}
	
	var self = this;
	this.autoExt = setTimeout(function(){
		self.extInterval();
	},this.autoInterval);
}
/*浏览器判断*/
var isie6=(navigator.userAgent.toLowerCase().indexOf('msie 6')!=-1);
if(navigator.userAgent.toLowerCase().indexOf('msie 7')!=-1){
	isie6 = false;
	var isie7 = true;
}
var isie8=(navigator.userAgent.toLowerCase().indexOf('msie 8')!=-1);
var isfirefox=(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);
var isSafari =(navigator.userAgent.toLowerCase().indexOf("safari")!=-1);
if(navigator.userAgent.toLowerCase().indexOf('chrome')!=-1){
	isSafari=false;
	var ischrome=true;
}
var isopera=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);

(function($) {
  $.fn.extend({
    tabs: function(options) {
      return $(this).each(function() {
        var defaults = {
          currentClass: "cur",
          trigger: "mouseover",
          callBack: null,
          auto: false,
          detay: 3000,
          index: 0
        }
        var params = $.extend(defaults, options);
        var $this = $(this);
        var items = $('.tab_menu', $this),
        i = 0,
        l = items.size() - 1;
        var autoTimer, curro = 0;

        items.each(function() {
          $(this).data('lvl', i);
          if (i == params.index) {
            $('.tabs', $this).eq(i).show();
            $(this).addClass(params.currentClass);
          } else {
            $('.tabs', $this).eq(i).hide();
          }
          i++;
          $(this).bind(params.trigger,
          function(e) {
            if (params.auto) {
              if (autoTimer) clearInterval(autoTimer);
            }
            move($(this).data("lvl"));
            if (e.stopPropagation) {
              e.stopPropagation(); // for Mozilla and Opera 
            } else if (window.event) {
              window.event.cancelBubble = true; // for IE 
            }
          });
        });

        function move(i) {
          items.eq(params.index).removeClass(params.currentClass);
          $('.tabs', $this).eq(params.index).hide();
          items.eq(i).addClass(params.currentClass);
          $('.tabs', $this).eq(i).show();
          params.index = i;
        }

        function auto() {
          if (params.auto) {
            autoTimer = setInterval(function() {
              curro = (params.index >= l) ? 0 : (params.index + 1);
              move(curro);
            },
            params.detay);
          } else {
            if (autoTimer) clearInterval(autoTimer);
          }
        }
        auto();
      });
    }
  });
})(jQuery);
/*焦点图*/
function featuredcontentslider_init(a) {
  featuredcontentslider.init(a)
}
var featuredcontentslider = {
  settingcaches: {},
  init: function(a) {
    if (this.$(a.id) == null) {
      return
    }
    this.settingcaches[a.id] = a;
    a.contentdivs = [];
    a.toclinks = [];
    a.topzindex = 0;
    a.currentpage = a.playtab || 1;
    a.prevpage = a.currentpage;
    a.etype = "on" + (a.revealtype || "click");
    a.onChange = a.onChange ||
    function() {};
    a.curopacity = 0;
    a.overflow = a.overflow || "hidden";
    a.delay = a.delay == undefined ? (a.revealtype == "mouseover" ? 150 : 0) : a.delay;
    a.link = a.link || false;
    a.contentclass = a.contentclass || "contentdiv";
    this.buildpaginate(a)
  },
  buildpaginate: function(p) {
    this.buildcontentdivs(p);
    var h = this.$(p.id),
    m = this.$("paginate-" + p.id),
    k = "",
    d = p.toc,
    a = p.nextprev;
    if (typeof d == "string" && d != "markup" && d != "scroll" || typeof d == "object") {
      for (var e = 1; e <= p.contentdivs.length; e++) {
        k += '<i class="iToc iToc' + e + '"><a href="#' + e + '" class="toc">' + (typeof d == "string" ? d.replace(/#increment/, e) : d[e - 1]) + "</a></i> "
      }
      k = (a[0] != "" ? '<i class="iToc iToc' + e + '"><a href="#prev" class="prev">' + a[0] + "</a></i> ": "") + k + (a[1] != "" ? '<i class="iToc iToc' + e + '"><a href="#next" class="next">' + a[1] + "</a></i>": "");
      m.innerHTML = '<i class="subLineTab"></i><span class="subPageTab">' + k + "</span>"
    }
    var g = [],
    b = m.getElementsByTagName("*");
    for (var e = 0; e < b.length; e++) {
      if (b[e].nodeType == 1 && !b[e].getAttribute("disabled")) {
        g.push(b[e])
      }
    }
    var j = 0,
    n = this;
    for (var e = 0; e < g.length; e++) {
      if (this.css(g[e], "toc", "check")) {
        if (j > p.contentdivs.length - 1) {
          g[e].style.display = "none";
          continue
        }
        if (d == "scroll") {
          if (!j) {
            var f = m.getElementsByTagName("div");
            this.masker = f[0];
            this.maskee = f[1];
            this.thumbWidth = [0]
          }
          var l = this.thumbWidth,
          c = g[e];
          c.style.styleFloat = c.style.cssFloat = "left";
          l.push(l[l.length - 1] + c.offsetWidth + this.style(c, "marginLeft", true) + this.style(c, "marginRight", true) + this.style(c, "borderLeftWidth", true) + this.style(c, "borderRightWidth", true))
        }
        g[e].setAttribute("rel", ++j);
        g[e]["onclick"] = function() {
          return p.link || false
        };
        g[e][p.etype] = function() {
          var i = this.getAttribute("rel");
          if (n.delayTimer) {
            window.clearTimeout(n.delayTimer)
          }
          n.delayTimer = window.setTimeout(function() {
            featuredcontentslider.turnpage(p, i)
          },
          p.delay);
          p.link || false
        };
        g[e]["onmouseout"] = function() {
          if (n.delayTimer) {
            window.clearTimeout(n.delayTimer)
          }
        };
        p.toclinks.push(g[e])
      } else {
        if (this.css(g[e], "prev", "check") || this.css(g[e], "next", "check")) {
          g[e].onclick = function() {
            featuredcontentslider.turnpage(p, this.className);
            return false
          }
        }
      }
    }
    this.turnpage(p, p.currentpage, true);
    if (p.autorotate[0]) {
      m[p.etype] = function() {
        return false
      };
      h.onmouseover = m.onmouseover = function() {
        featuredcontentslider.cleartimer(p, window["fcsautorun" + p.id]);
        return true
      };
      h.onmouseout = m.onmouseout = function() {
        featuredcontentslider.autorotate(p);
        return true
      };
      p.autorotate[1] = p.autorotate[1] + (1 / p.enablefade[1] * 80);
      this.autorotate(p)
    }
  },
  buildcontentdivs: function(b) {
    var c = this.$(b.id).getElementsByTagName("div");
    for (var a = 0; a < c.length; a++) {
      if (this.css(c[a], b.contentclass, "check")) {
        b.contentdivs.push(c[a]);
        c[a].style.display = "none";
        c[a].style.overflow = b.overflow
      }
    }
  },
  jumpTo: function(b, a) {
    this.turnpage(this.settingcaches[b], a)
  },
  turnpage: function(r, i, p) {
    var e = r.currentpage,
    g = r.contentdivs,
    j = g.length,
    m = (/prev/i.test(i)) ? e - 1 : (/next/i.test(i)) ? e + 1 : i | 0;
    m = (m < 1) ? j: (m > j) ? 1 : m;
    if (m == r.currentpage && typeof p == "undefined") {
      return
    }
    r.currentpage = m;
    g[r.prevpage - 1].style.display = "none";
    g[m - 1].style.zIndex = ++r.topzindex;
    this.cleartimer(r, window["fcsfade" + r.id]);
    r.cacheprevpage = r.prevpage;
    if (r.enablefade[0]) {
      r.curopacity = 0;
      this.fadeup(r)
    }
    if (r.enablefade[0] == false) {
      r.onChange(r.prevpage, r.currentpage)
    }
    g[m - 1].style.visibility = "visible";
    g[m - 1].style.display = "block";
    if (r.prevpage <= r.toclinks.length) {
      this.css(r.toclinks[r.prevpage - 1], "selected", "remove")
    }
    if (m <= r.toclinks.length) {
      this.css(r.toclinks[m - 1], "selected", "add")
    }
    r.prevpage = m;
    if (r.toc == "scroll") {
      var a = this,
      c = 0.25,
      n = 20,
      l = a.masker.clientWidth,
      h = r.contentdivs.length,
      d = r.toclinks[m - 1],
      q = this.thumbWidth[this.thumbWidth.length - 1],
      m = l / 2 - d.offsetWidth / 2 - this.thumbWidth[m - 1],
      k = a.maskee.currentStyle ? a.maskee.currentStyle.marginLeft: window.getComputedStyle(a.maskee, "").getPropertyValue("margin-left");
      k = k.substr(0, k.length - 2) | 0;
      m = m <= l - q ? l - q: m;
      m = m > 0 ? 0 : m;
      function b() {
        k += (m - k) * c;
        if (Math.round(m - k) == 0) {
          window.clearInterval(a.thumbTimer);
          return
        }
        a.maskee.style.marginLeft = Math.ceil(k) + "px"
      }
      if (a.thumbTimer) {
        window.clearInterval(a.thumbTimer)
      }
      a.thumbTimer = window.setInterval(b, n)
    }
  },
  setopacity: function(a, c) {
    var b = a.contentdivs[a.currentpage - 1];
    b.className = a.contentclass + " sliderfilter";
    b.style.cssText += ";filter:alpha(opacity=" + c * 100 + ");-moz-opacity:" + c + ";opacity:" + c;
    a.curopacity = c
  },
  fadeup: function(a) {
    if (a.curopacity <= 0.95) {
      this.setopacity(a, a.curopacity + a.enablefade[1]);
      window["fcsfade" + a.id] = setTimeout(function() {
        featuredcontentslider.fadeup(a)
      },
      25)
    } else {
      this.setopacity(a, 1);
      var b = a.contentdivs[a.currentpage - 1];
      b.className = "contentdiv";
      if (a.cacheprevpage != a.currentpage) {
        a.contentdivs[a.cacheprevpage - 1].style.display = "none"
      }
      a.onChange(a.cacheprevpage, a.currentpage)
    }
  },
  cleartimer: function(a, b) {
    if (b) {
      clearTimeout(b);
      clearInterval(b);
      if (a.cacheprevpage != a.currentpage) {
        a.contentdivs[a.cacheprevpage - 1].style.display = "none"
      }
    }
  },
  css: function(b, a, c) {
    var d = new RegExp("(^|\\s+)" + a + "($|\\s+)", "ig");
    if (c == "check") {
      return d.test(b.className)
    } else {
      if (c == "remove") {
        b.className = b.className.replace(d, "")
      } else {
        if (c == "add") {
          b.className += " " + a
        }
      }
    }
  },
  style: function(c, d, b) {
    var a;
    if (c.currentStyle) {
      a = c.currentStyle[d]
    } else {
      if (window.getComputedStyle) {
        d = d.replace(/([A-Z])/g, "-$1");
        d = d.toLowerCase();
        a = window.getComputedStyle(c, "").getPropertyValue(d)
      }
    }
    return ! b ? a: a.substr(0, a.length - 2) | 0
  },
  autorotate: function(a) {
    window["fcsautorun" + a.id] = setInterval(function() {
      featuredcontentslider.turnpage(a, "next")
    },
    a.autorotate[1])
  },
  $: function(a) {
    return document.getElementById(a)
  }
};
var pc_ = {
  $: function(objName) {
    if (document.getElementById) {
      return eval('document.getElementById("' + objName + '")')
    } else {
      return eval("document.all." + objName)
    }
  },
  isIE: navigator.appVersion.indexOf("MSIE") != -1 ? true: false,
  addEvent: function(a, c, b) {
    if (a.attachEvent) {
      a.attachEvent("on" + c, b)
    } else {
      a.addEventListener(c, b, false)
    }
  },
  delEvent: function(a, c, b) {
    if (a.detachEvent) {
      a.detachEvent("on" + c, b)
    } else {
      a.removeEventListener(c, b, false)
    }
  },
  readCookie: function(d) {
    var e = "",
    a = d + "=";
    if (document.cookie.length > 0) {
      var c = document.cookie.indexOf(a);
      if (c != -1) {
        c += a.length;
        var b = document.cookie.indexOf(";", c);
        if (b == -1) {
          b = document.cookie.length
        }
        e = unescape(document.cookie.substring(c, b))
      }
    }
    return e
  },
  writeCookie: function(d, a, f, g) {
    var e = "",
    b = "";
    if (f != null) {
      e = new Date((new Date).getTime() + f * 3600000);
      e = "; expires=" + e.toGMTString()
    }
    if (g != null) {
      b = ";domain=" + g
    }
    document.cookie = d + "=" + escape(a) + e + b
  },
  readStyle: function(b, a) {
    if (b.style[a]) {
      return b.style[a]
    } else {
      if (b.currentStyle) {
        return b.currentStyle[a]
      } else {
        if (document.defaultView && document.defaultView.getComputedStyle) {
          var c = document.defaultView.getComputedStyle(b, null);
          return c.getPropertyValue(a)
        } else {
          return null
        }
      }
    }
  }
};

/*
*top10.js
*/
function set_item_class(id)
{
    for(i=1;i<=10;i++)
    {
        if(id==i)
        {
            document.getElementById("pro_"+i+"_2").style.display="";
            document.getElementById("pro_"+i+"_1").style.display="none";
        }
        else
        {
            document.getElementById("pro_"+i+"_2").style.display="none";
            document.getElementById("pro_"+i+"_1").style.display="";
        }
    }
}
/*标签切换setTab*/
function setTab(m,n){
var tli=document.getElementById("menu"+m).getElementsByTagName("li");
var mli=document.getElementById("main"+m).getElementsByTagName("div");
for(i=0;i<tli.length;i++){
tli[i].className=i==n?"hover":"";
mli[i].style.display=i==n?"block":"none";
}
N=n;
}
/*轮换展示*/
(function($){
	$.fn.conShow = function(options){	
		var set = {
			timeout:          6000,
			listIndexId:      '#listIndex',
			listItem_boxID:   '#listItem_box',
			listItem:         '.listItem',
			oWidth:           202,
			next:             '#down', 
			prev:             '#up'
		};
		options = options || {};
		var opts = $.extend(set,options);
		var n = 0;
		var timer = null;
		var that = this;
		var len = $(this).find(opts.listItem).length;
		var listItem_box = $(opts.listItem_boxID);
		var bStop = false;
		for(var i=0;i<len; i++){
			$('<a>'+(i+1)+'</a>').appendTo($(opts.listIndexId));
		}
		
		var index = $(opts.listIndexId).find('a');
		index.eq(n).addClass('current');
		function play(){
			timer = setInterval(function(){
				n++;
				if(n==len) n=0;				
				listItem_box.stop().animate({left:-(n)*opts.oWidth});
				index.removeClass().eq(n).addClass('current');
			},opts.timeout);
		}
		play();
		function goLeft(){
			listItem_box.stop().animate({left:-(len-1)*opts.oWidth},function(){
					n = len -1;
					index.removeClass().eq(n).addClass('current');
					play();
				});
		}
		function goRight(){
			listItem_box.stop().animate({left:0},function(){
					n = 0;
					index.removeClass().eq(n).addClass('current');
					play();
				});
		}
		$(opts.next).click(function(){
			clearInterval(timer);
			n++;
			if(n==len){
				goRight()
			}else{
				listItem_box.stop().animate({left:-(n)*opts.oWidth},function(){
					index.removeClass().eq(n).addClass('current');
					play();
				});
			}
			
		});
		$(opts.prev).click(function(){
			clearInterval(timer);
			n--;
			if(n==-1){
				goLeft()
			}else{
				listItem_box.stop().animate({left:-(n)*opts.oWidth},function(){
					index.removeClass().eq(n).addClass('current');
					play();
				});
			}
		});
		index.each(function(m){
			$(this).click(function(){
				clearInterval(timer);
				index.removeClass().eq(m).addClass('current');
				listItem_box.stop().animate({left:-(m)*opts.oWidth},function(){
					n = m;
					play();
				});
			});
		});
	}
})(jQuery);
