/**************************************************************************************************************/
// Create xmlhttp object based on browsertype
function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
	  xmlhttp.overrideMimeType("text/xml"); 
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
/**************************************************************************************************************/
// Define global variables to be used throughout
var tableBusy = false;
var tableHttp = getHTTPObject();
var step1Over = false;
var row = "";
/**************************************************************************************************************/

function GetPreview(proid)
{
//	alert(locid);	
	if (!tableBusy)
	{
		var url = "getPreview.php?proid="+proid;		
		tableHttp.open("POST", url, true);
		tableHttp.onreadystatechange = GetPreviewList;
		tableBusy = true;
		tableHttp.send(null);
	}
}

function GetPreviewList()
{
	if (tableHttp.readyState == 4)
	{
		try
		{
			var output = tableHttp.responseText;
			tableBusy = false;
			document.getElementById('demosong').innerHTML = output;
		}
		catch(e)
		{
			alert("Error: " + e) ;
		}
	}
}
