var $LMARQUEE,$HTMLMARQUEE="";
NEWSHOME = function(){}
NEWSHOME.prototype.getNews=function(type){
	var fncSuc = XHR.Delegate(this,this.listSuc);
	var param = {act:"listNewsType",page:1,n:5,type:type};
	new XHR("post",fncSuc).send($PN+"/Proc",param);
	this.type = type;
}
NEWSHOME.prototype.listSuc=function(r){
	if(this.type==0){
		this.listEventSuc(r);
	}else{
	//	this.listNewsSuc(r);		
	}
}

NEWSHOME.prototype.listEventSuc=function(r){
	var xml = new XML(r);
	var id = "";
	if(xml.value){
		if($HTMLMARQUEE!="") return;
		var news = xml.get("news");
		var html="";
		var lengthspace=0;
		var title = "";
		for(var i=0; i < news.length; i++){
			id = news[i].getAttribute("id");
			title +=news[i].getAttribute("title");
			html += "<span style=\"margin-right:30px;cursor:pointer\">"+
					"<img src=\"../../images/dotwhite.gif\"/> "+	
					"<a style=\"color:white;text-decoration:none\" href=\"?act=newsdetail&id="+id+"&lang="+$LANG+"\">"+news[i].getAttribute("title")+"</a></span>";
			lengthspace=lengthspace+30*(i+1);
		}
		if(html!=""){
			var l = title.length*7+lengthspace;
			$LMARQUEE = l;
			$HTMLMARQUEE= html;
			showMarquee();
			window.setTimeout('$("newslistlink").href = "?act=newslist&page=1&n=10&lang="+$LANG+"&id=-1";',800);
		}else{
			$("eventdiv").style.display="none";
		}
	}
}
function showMarquee(){
	$("marquee").innerHTML = '<marquee direction="left" onmouseover="this.stop();" onmouseout="this.start();" id="eventMarquee" scrollamount="2" scrolldelay="4" class="marqueewidth">'+
			  					'<div id="event2" style="white-space:nowrap;width:'+$LMARQUEE+'px">' +
			  					$HTMLMARQUEE+
			  					'</div>'+
			  				 '</marquee>';
	$("eventdiv").style.visibility="visible";
	$("eventMarquee").start();
}

