// create flash html

function createMovieHTML(id, movie, w, h)
{
	document.writeln(getMovieHTML(id, movie, w, h));
}

function getMovieHTML(id, movie, w, h)
{
	var obj = '';
	obj = '<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="' + w + '" HEIGHT="' + h + '"' + '\r\n ' + 
		'CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">' + '\r\n ' + 
		'<PARAM name="SRC" VALUE="' + movie + '">' + '\r\n ' + 
		'<PARAM name="AUTOPLAY" VALUE="true">' + '\r\n ' + 
		'<PARAM name="CONTROLLER" VALUE="false">' + '\r\n ' + 
		'<EMBED SRC="' + movie + '" WIDTH="' + w + '" HEIGHT="' + h + '" AUTOPLAY="true" CONTROLLER="false" PLUGINSPAGE="http://www.apple.com/quicktime/download/">' + '\r\n ' + 
		'</EMBED>' + '\r\n ' + 
		'</OBJECT>' + '\r\n '
	return obj;
}

var req;

function loadXMLDoc(url) {
	req = false;alert('load');
	// branch for native XMLHttpRequest object
	if(window.XMLHttpRequest && !(window.ActiveXObject)) {
		try {
			req = new XMLHttpRequest();alert('YES');
		} catch(e) {
			req = false;alert('NO');
		}
    // branch for IE/Windows ActiveX version
  } else if(window.ActiveXObject) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP"); alert('YES');
		} catch(e) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");alert('YES');
			} catch(e) {
				req = false;alert('NO');
			}
		}
  }
	if(req) {
		//req.onreadystatechange = processReqChange;
		req.open("GET", url, false);
		alert('SEND');
		req.send("");
		
		alert(req.responseText);
	}
}

function processReqChange() {
	// only if req shows "loaded"
	alert('CHANGE');
	
	if (req.readyState == 4) {
		// only if "OK"
		if (req.status == 200) {
			// process here
			alert('OK');
			alert(req.responseText);
		} else {
			alert("There was a problem retrieving the XML data:\n" +
				req.statusText);
		}
	}
}