// JavaScript Document

var xmlHttp

function showTrade(str)
 { 
 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
 var url="responsexml.php"
 url=url+"?q="+str
 url=url+"&sid="+Math.random()
 xmlHttp.onreadystatechange=stateChanged 
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
 }

function stateChanged() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		xmlDoc=xmlHttp.responseXML;
		document.getElementById("TradeName").innerHTML=
		xmlDoc.getElementsByTagName("TradeName")[0].childNodes[0].nodeValue;
		document.getElementById("TradeTitle_01").innerHTML=
		xmlDoc.getElementsByTagName("TradeTitle_01")[0].childNodes[0].nodeValue;
		document.getElementById("TradeTitle_02").innerHTML=
		xmlDoc.getElementsByTagName("TradeTitle_02")[0].childNodes[0].nodeValue;
		document.getElementById("TradeTitle_03").innerHTML=
		xmlDoc.getElementsByTagName("TradeTitle_03")[0].childNodes[0].nodeValue;
		//document.getElementById("TradeText").innerHTML=
		//xmlDoc.getElementsByTagName("TradeText")[0].childNodes[0].nodeValue;
		document.getElementById("TradeText").innerHTML=
		xmlDoc.getElementsByTagName("TradeText")[0].childNodes[0].nodeValue;
		
		imgURL = "tradeimages/" + xmlDoc.getElementsByTagName("TradeImage")[0].childNodes[0].nodeValue;
		//document.getElementById("TradeImage").src = imgURL;
		
		videoURL = "tradevideo/" + xmlDoc.getElementsByTagName("TradeMovie")[0].childNodes[0].nodeValue;
		var WMP_str = "<object id=\"TradeMovie\" width=200 height=225 classid=CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95 ";
		WMP_str += "codebase=\"http://www.microsoft.com/ntserver/netshow/download/en/nsmp2inf.cab#Version=5,1,51,415\" ";
		WMP_str += "standby=\"Loading Microsoft Media Player components...\" type=\"application/x-oleobject\">\n";
		WMP_str += "<param name=AutoSize value=TRUE>\n";
		WMP_str += "<param name=AutoStart value=TRUE>\n";
		WMP_str += "<param name=FileName value=\"" + videoURL + "\">\n";
		WMP_str += "<param name=ControlType value=1>\n";
		WMP_str += "<param name=\"ShowStatusBar\" value=\"True\">\n";
		WMP_str += "<param name=\"VideoBorderWidth\" value=\"0\">\n";
		WMP_str += "<param name=\"VideoBorderColor\" value=\"#8D9091\">\n";
		WMP_str += "<param name=\"VideoBorder3D\" value=\"-1\">\n";
		WMP_str += "<param name=\"Volume\" value=\"-10\">\n";
		WMP_str += "<PARAM NAME=\"EnableContextMenu\" VALUE=\"-1\">\n";
		WMP_str += "<embed type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/windows/mediaplayer/download/default.asp\" ";
		WMP_str += "autostart=TRUE showcontrols=1 width=200 height=225 filename=\"" + videoURL + "\" controltype=\"1\" showstatusbar=\"1\" volume=\"-10\">";
		WMP_str += "</embed>\n</object>\n";
		document.getElementById("TradeMovieDiv").innerHTML = WMP_str;
		// xmlDoc.getElementsByTagName("TradeMovie")[0].childNodes[0].nodeValue;
	}
} 

function GetXmlHttpObject()
 { 
 var objXMLHttp=null
 if (window.XMLHttpRequest)
  {
  objXMLHttp=new XMLHttpRequest()
  }
 else if (window.ActiveXObject)
  {
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
 return objXMLHttp
 }