		var news_type="";
		$(document).ready(function(){
			$("#ad").load("template/index_ad.aspx");
			$("#newstype").load("template/index_news_type.aspx");
			
			
			$("#research").load("template/index_research.aspx?type=0");
			$("#investday").load("template/index_investday.aspx?type=1");
			$("#fundcategory").load("template/index_fund_category.aspx");
			$("#banner").load("template/index_banner.aspx?type=1");
		
		
		});
		fundCategoryPage=1;

		function fundCategoryMenu(page){
			$("#fundcategory").load("template/index_fund_category.aspx?nowpage="+page);
		}
		
	function loadData2(objid,dest){
		clearInterval(scrollintervalid);
		$.ajax({
		  url: dest,
		  cache: false,
		  beforeSend:function(){
		  	$("#"+objid).block({message:'<img src="/images/ajax-loader.gif">',
						    css: {  color: '#fff',border:'none'},
						    overlayCSS:{ backgroundColor: '#ffffff', opacity:'0.6' }
			});
		  },
		  success: function(response){
		    $("#"+objid).html(response);
			setTimeout($("#"+objid).unblock(),500);
			startScroll();
		  }
		});
	}
	
	
		
		
		function changeResearchType(col,type){
			var ii;
			var obj;
			for(ii=0;ii<=2;ii++){
				obj=document.getElementById("researchtab"+ii);
				if(ii==col){
					obj.className="researchtab";
				}else{
					obj.className="researchtab2";
				}            
			}
		   loadData("research","/template/index_research.aspx?type="+type);
			//$("#news").load("/template/index_news.aspx?type="+type);
		}
		
		
		
		var fundcategorynum=0;
		function changeFundCategory(col,type){
		
			var ii;
			var obj;
			for(ii=1;ii<=fundcategorynum;ii++){
				obj=document.getElementById("fundcategorytab"+ii);
				if(ii==col){
					obj.className="fundcategorytab";
				}else{
					obj.className="fundcategorytab2";
				}            
			}
		   loadData2("fundtable","/template/index_fund.aspx?category="+type);
			//$("#news").load("/template/index_news.aspx?type="+type);
		}
		
var newsflag2=false;
var newscontainer2;
var newscontent2;
var	containerheight2;
var contentheight2;
var downlimit2;
var uplimit2;
var newsInterval;
function initnews(){
	newscontainer2=document.getElementById("Container2");
	newscontent2=document.getElementById("Content2");
	containerheight2=newscontainer2.offsetWidth;
	contentheight2=newscontent2.scrollWidth;
	downlimit2=containerheight2-contentheight2;
	newscontent2.style.left="0px";
	uplimit2=0;
	newsflag2=true;
}

function goLeft(){
	clearNewsInterval();
	if(!newsflag2) initnews();
	newsInterval=setInterval(goLeft_,1);
}

function goLeft_(){
	var left2=parseInt(newscontent2.style.left);
	if(left2>downlimit2){
		if(left2-downlimit2<5){
			newscontent2.style.left=(left2-(left2-downlimit2))+"px";
		}else{
			newscontent2.style.left=(left2-5)+"px";
		}
	}else{
		clearInterval(newsInterval);
	}
}

function goRight(){
	clearNewsInterval();
	if(!newsflag2) initnews();	
	newsInterval=setInterval(goRight_,1);
}

function goRight_(){
	var left2=parseInt(newscontent2.style.left);
	//alert("goup left:"+left2+" uplimit"+uplimit2);
	if(left2<uplimit2){
		if(uplimit2-left2<5){
			newscontent2.style.left=(left2+(uplimit2-left2))+"px";
		}else{
			newscontent2.style.left=(left2+5)+"px";
		}
	}else{
		clearInterval(newsInterval);
	}
}

function clearNewsInterval(){
		clearInterval(newsInterval);
}


var Gflag=false;
var Gcontainer;
var Gcontent;
var	containerheight;
var contentheight;
var Gdownlimit;
var GGuplimit;
var GInterval;
function initG(){
	Gcontainer=document.getElementById("fundContainer");
	Gcontent=document.getElementById("fundtable");
	containerheight=Gcontainer.offsetHeight;
	contentheight=Gcontent.scrollHeight;
	Gdownlimit=containerheight-contentheight;
	Guplimit=0;
	Gflag=true;
}
function GgoDown(){
	if(!Gflag) initG();
	GInterval=setInterval(GgoDown_,1);

}

function GgoDown_(){
	var top=parseInt(Gcontent.style.top);
	if(top>Gdownlimit){
		Gcontent.style.top=(top-1)+"px";
	}else{
		clearInterval(GInterval);
	}
}

function GgoUp(){
	if(!Gflag) initG();	
	GInterval=setInterval(GgoUp_,1);
}

function GgoUp_(){
	var top=parseInt(Gcontent.style.top);
	if(top<Guplimit){
		Gcontent.style.top=(top+1)+"px";
	}else{
		clearInterval(GInterval);
	}
}

function GclearGInterval(){
		clearInterval(GInterval);
}
	var scrollintervalid="";
	var SCY=0;
	var updown="up";
	function startScroll(){
		SCR=1;
		SDIV = document.getElementById("fundtable");
		if (SDIV) {
			SDIV.onmouseover = SCROFF;
			SDIV.onmouseout = SCRON;
			setTimeout("InitScr()", 1000);
		}
	}
	
    function InitScr() {
     	SCRH=SDIV.offsetHeight;
     	SCH=SDIV.parentNode.offsetHeight;
     	MODD=SCH/5;
		clearInterval(scrollintervalid);	
		
		if(SDIV.offsetHeight>280){
			SDIV.innerHTML = SDIV.innerHTML + SDIV.innerHTML;
			//½Õ¾ã³t«×
			scrollintervalid=setInterval("SSDIV()",80);
		}else{
			SDIV.style.top="0px";
		}
    }
	
    function SCROFF() {
     	SCR=0;
    }
	
    function SCRON() {
     	SCR=1;
    }
	
	function CHANGESCY(s){
		updown=s;
	}
	
    function SSDIV() {
     	if (SCR) {
     		if(updown=="up") SCY-=1;
			else if(updown=="down") SCY+=1;
     		SDIV.style.top=SCY+'px';
     		if (SCRH+SCY<=0) SCY+=SCRH;
			else if(SCY>0) SCY=-SCRH/2;
     	}
    }
	function check(){
		alert(SCY);
		alert(SCRH);
	}
	
	$(document).ready(function(){
		startScroll();	
	});

