﻿// JavaScript Document
$(document).ready(function(){
	$.each($("#tag1 a"),function(i){
						$(this).mouseover(function()
						{showtag(1,i)});
						});
   $.each($("#tag2 a"),function(i){
						$(this).mouseover(function()
						{showtag(2,i)});
						});
   $.each($("#tag3 a"),function(i){
						$(this).mouseover(function()
						{showtag(3,i)});
						});
   $.each($("#tag4 a"),function(i){
						$(this).mouseover(function()
						{showtag(4,i)});
						});
  $.each($("#tag6 a"),function(i){
						$(this).mouseover(function()
						{showtag(6,i)});
						});
    $.each($("#tag7 a"),function(i){
						$(this).mouseover(function()
						{showtag(7,i)});
						});
				  })

function showtag(id,index)
{
	$("#tag"+id+" a").removeClass("sel");
	$(".tag"+id+"_c").hide();
	$("#tag"+id+" a:eq("+index+")").addClass("sel");
	$("#tag"+id+"_c"+index).show();
}


var Height = 28;
var Speed = 100;
var Step = 5;
var Time = 3000;
var scroll2;
var obj=document.getElementById("news_list");
function scrollNewsList() {
    setInterval(scrollNews, Time);
}

function scrollNews() {
   
     
   if (document.getElementById("news_list").scrollTop+document.getElementById("news_list").offsetHeight >= document.getElementById("news_list").scrollHeight) 
	{
        document.getElementById("news_list").scrollTop = 0;
    }
    else {
        Step = 1;
        scroll2=setInterval(scrollUp, Speed);  
    }
}

function scrollUp() {

    if (Step <= 7) {
       document.getElementById("news_list").scrollTop += Height / 7;
   }
   else
   
   {
	   clearInterval(scroll2);
	   Step=1;
   }
   
   Step++;
}



var Height1 = 60;
var Speed1 = 100;
var Step1 = 5;
var Time1 =4000;
var scroll3;
var obj = document.getElementById("huiyuan_scroll");
function scrollHuiYuanList() {

    setInterval(scrollHuiYuan, Time1);
    document.getElementById("huiyuan_scroll").innerHTML += document.getElementById("huiyuan_scroll").innerHTML;
}

function scrollHuiYuan() {
    if (document.getElementById("huiyuan_scroll").scrollTop + document.getElementById("huiyuan_scroll").offsetHeight >= document.getElementById("huiyuan_scroll").scrollHeight) {
          document.getElementById("huiyuan_scroll").scrollTop = 0;
        //document.getElementById("huiyuan_scroll").innerHTML += document.getElementById("huiyuan_scroll").innerHTML;
    }
    else {
        Step1 = 1;
        scroll3 = setInterval(scrollHuiYuanUp, Speed);
    }
}

function scrollHuiYuanUp() {
    if (Step1 <= 6) {
        document.getElementById("huiyuan_scroll").scrollTop += Height1 / 6;
    }
    else {
        clearInterval(scroll3);
        Step1 = 1;
    }

    Step1++;
}


function search() {
    var keyword = $.trim($("#keyword").val());
    if (keyword == "")
        alert("请输入关键词！");
    else
        document.location = "/search.aspx?k=" + encodeURI(keyword);
}

