var READY_STATE_UNINITIALIZED = 0;
var READY_STATE_LOADING = 1;
var READY_STATE_LOADED = 2;
var READY_STATE_INTERACTIVE = 3;
var READY_STATE_COMPLETE = 4;
var focus_width=197
var focus_height=140
var text_height=20
var swf_height = focus_height+text_height
function popmsg(pics,links,texts){
	
	var winstr="<object ID=\"focus_flash\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width="+ focus_width +" height="+ swf_height +">";
	winstr+="<param name=\"allowScriptAccess\" value=\"sameDomain\"><param name=\"movie\" value=\"pixviewer.swf\"><param name=\"quality\" value=\"high\"><param name=\"bgcolor\" value=\"#E7E7E7\">";
	winstr+="<param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"opaque\">";
	winstr+="<param name=\"FlashVars\" value=\"pics="+pics+"&links="+links+"&texts="+texts+"&borderwidth="+focus_width+"&borderheight="+focus_height+"&textheight="+text_height+"\">";
	winstr+="<embed ID=\"focus_flash\" src=\"pixviewer.swf\" wmode=\"opaque\" FlashVars=\"pics="+pics+"&links="+links+"&texts="+texts+"&borderwidth="+focus_width+"&borderheight="+focus_height+"&textheight="+text_height+" menu=\"false\" bgcolor=\"#E7E7E7\" quality=\"high\" width="+ focus_width +" height="+ focus_height +" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"/>";
	winstr+="</object>";
	document.body.innerHTML = winstr;

}

function getXMLHTTPRequest() {
	var xRequest = null;
	if(window.XMLHttpRequest)
		xRequest = new XMLHttpRequest();
	else if(typeof ActiveXObject!="undefined")
		xRequest = new ActiveXObject("Microsoft.XMLHTTP");
	return xRequest;
}

function sendRequest(URL, params, HttpMethod) {
	
	if(!HttpMethod)
		HttpMethod = "POST";
		
	req = getXMLHTTPRequest();
	var str_params = params
	if(req) {
		req.onreadystatechange=onReadyStateChange;
		req.open(HttpMethod, URL, true);
		req.setRequestHeader("content-type", "application/x-www-form-urlencoded");
		req.send(str_params);
	}
}


function onReadyStateChange() {
	var ready = req.readyState;
	var data = null;
	var xmlDoc = null;
	
	if(ready==4) {
		xmlDoc = req.responseXML;
 	//alert(req.responseText);
	}
	
	if(xmlDoc) {
		
		var p = new Array(3); 
 		var l = new Array(3); 
 		var t = new Array(3); 
		var picnews_list_ele = xmlDoc.getElementsByTagName("picnews_list");
		
		if(picnews_list_ele[0]) {
			var orders = picnews_list_ele[0].getElementsByTagName("picnews_order");
			
			for(var i=0; i<orders.length; i++) {
				var id = orders[i].getAttribute("id");
				var title = orders[i].getAttribute("title");
				var pic = orders[i].getAttribute("pic");
				var type = orders[i].getAttribute("type");
				p[i]='/zjlotto/upload/'+pic+''
 				l[i]='/zjlotto/mtc/news/ToNewsDetail.do?id='+id
				t[i]=''+title+'' 
				
				}
				
 				var pics=p[0]+'|'+p[1]+'|'+p[2];
				var links=l[0]+'|'+l[1]+'|'+l[2];
				var texts=t[0]+'|'+t[1]+'|'+t[2];
				popmsg(pics,links,texts);
 
			}
		
		}

}
	



