
function createXMLHttpRequest(){      
	xmlHttp=false;
	if(window.XMLHttpRequest){       //Mozilla
		xmlHttp=new XMLHttpRequest();
		if(xmlHttp.overrideMimeType){   //mime
			xmlHttp.overrideMimeType('text/xml');
		}
	}
	else if(window.ActiveXObject){		//IE
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
			}catch(e){}
		}
	}
	if(!xmlHttp){	// can't create
		window.alert("Sorry , Can't create XMLHttpRequest object.");
		return false;		
	}
}

function swfData(msg){
	var url="indexSwf.jsp?time="+new Date().getTime();
	createXMLHttpRequest();
	xmlHttp.open("GET",url,true);
	xmlHttp.onreadystatechange=parseData;
	xmlHttp.send(null);	
}

function parseData(){
	 if(xmlHttp.readyState==4){
		 if(xmlHttp.status==200){
			 var xmlDoc = xmlHttp.responseXML ;
			 var nodes = xmlDoc.getElementsByTagName("article") ;
			 
			 var pics = [
		     		"http://file.hncst.net/uploadfile/"+nodes[0].getAttribute("picUrl") ,
		     		"http://file.hncst.net/uploadfile/"+nodes[1].getAttribute("picUrl") ,
		     		"http://file.hncst.net/uploadfile/"+nodes[2].getAttribute("picUrl") ,
		     		"http://file.hncst.net/uploadfile/"+nodes[3].getAttribute("picUrl") ,
		     		"http://file.hncst.net/uploadfile/"+nodes[4].getAttribute("picUrl") 
		     		//http://file.hnspi.edu.cn/hnspi_upload/201153114823207.jpg
		     	].join("|");
		     	var links = [
		     		"infodetail.jsp?id="+nodes[0].getAttribute("artId") ,
		     		"infodetail.jsp?id="+nodes[1].getAttribute("artId") ,
		     		"infodetail.jsp?id="+nodes[2].getAttribute("artId") ,
		     		"infodetail.jsp?id="+nodes[3].getAttribute("artId") ,
		     		"infodetail.jsp?id="+nodes[4].getAttribute("artId") 
		     	].join("|");
		     	var texts = [
		     		nodes[0].firstChild.nodeValue ,
		     		nodes[1].firstChild.nodeValue ,
		     		nodes[2].firstChild.nodeValue ,
		     		nodes[3].firstChild.nodeValue ,
		     		nodes[4].firstChild.nodeValue 
		     		//"青山绿水"
		     	].join("|");
		     	var focus_width = 265;
		     	var focus_height = 220;
		     	var text_height = 30;
		     	var swf_height = focus_height + text_height;
		     	
		     	var temp = new SWFObject("pixviewer.swf", "ms1", "260", "235", "8");
		     	temp.addParam("FlashVars" ,"pics="+pics+"&links="+links+"&texts="+texts+"&borderwidth="+focus_width+"&borderheight="+focus_height+"&textheight="+text_height ); 
		     	temp.write("tupian1");
		 }
	 }	 
}
