var vxmlHttp;

function setRegisterCookie(){
	var date=new Date();
	date.setTime(date.getTime()+24*3600*1000);
	document.cookie='nextURL='+document.location.href+';expire='+date.toGMTString()+';path=/;domain=.hudong.com;';
	window.location='http://www.hudong.com/user/register/userRegister.jsp';
}

function refreshGongGaoDivInfo(div_id){
	var xmlHttpGongGaoDiv = createXMLHttpRequestByObject('xmlHttpGongGaoDiv');
	xmlHttpGongGaoDiv.open("GET", '/ajaxindexbulletin.do', true);
	xmlHttpGongGaoDiv.onreadystatechange = function(){
		if (xmlHttpGongGaoDiv.readyState == 4) {
			if (xmlHttpGongGaoDiv.status == 200) {
				var ele=document.getElementById(div_id);
				if(ele!= null && xmlHttpGongGaoDiv.responseXML!=null){
					var contentStr='<h2 class="col-h2"><a href="http://group.hudong.com/home/huodonglist/huodong.html" target="_blank" class="h3 r">更多&gt;&gt;</a>互动公告</h2> ';
					var gongGaoList=xmlHttpGongGaoDiv.responseXML.getElementsByTagName("Record_PIECE_INDEX_RIGHT_HUDONGGONGGAO");
					var ulStr="";
					for(i=0;i<gongGaoList.length;i++){
						var linkUrl=gongGaoList[i].getElementsByTagName("LINK_URL")[0].firstChild.nodeValue;
						var linkText=gongGaoList[i].getElementsByTagName("LINK_TEXT")[0].firstChild.nodeValue;
						var linkTime=gongGaoList[i].getElementsByTagName("LINK_CREATED_TIME")[0].firstChild.nodeValue;
						ulStr+='<li><a href="'+linkUrl+'" target="_blank">'+linkText+'</a>'+linkTime+'</li> ';
					}
					contentStr+='<ul class="col-ul">'+ulStr+'</ul>';
					try{
						var gongGaoPic=xmlHttpGongGaoDiv.responseXML.getElementsByTagName("Record_PIECE_INDEX_RIGHT_HUDONGGONGGAO_PIC")[0];
						var picUrl=gongGaoPic.getElementsByTagName("LINK_PIC_URL")[0].firstChild.nodeValue;
						var picSrc=gongGaoPic.getElementsByTagName("LINK_PIC_SRC")[0].firstChild.nodeValue;
						var picAlt=gongGaoPic.getElementsByTagName("LINK_PIC_ALT")[0].firstChild.nodeValue;
						contentStr+='<a href="'+picUrl+'" target="_blank" class="a-c block mar-bottom-10"><img alt="'+picAlt+'"  src="'+picSrc+'"/></a>';
						ele.innerHTML=contentStr;
					}catch(e){
						ele.style.display='none';
					}
				}else{
					ele.parentNode.removeChild(ele);
				}
			}
		}
	}
	xmlHttpGongGaoDiv.send(null);
}