var xmlhttp = null;

function getDesiredDateList(product_id, participant_id)
{
    xmlhttp=GetXmlHttpObject();
    if (xmlhttp == null)
	{
	    alert ("Browser does not support HTTP Request");
	    return;
	}
    //var url="../php/kit/FTR_DesiredDate.php";
    var url="FTR_DesiredDate.php";
    url=url+"?product_id="+product_id;
    url=url+"&participant_id="+participant_id;
    url=url+"&sid="+Math.random();
    //xmlhttp.onreadystatechange = stateChanged_desired_date;
    var element_name = "ftr_desired_date_" + participant_id;
    xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState==4)
	{
	    document.getElementById(element_name).innerHTML=xmlhttp.responseText;
	}
    }
    xmlhttp.open("GET", url, true);
    xmlhttp.send(null);

}

function stateChanged_desired_date()
{
    if (xmlhttp.readyState==4)
	{
	    document.getElementById("ftr_desired_date_1").innerHTML=xmlhttp.responseText;
	}
}


function GetXmlHttpObject()
{
    if (window.XMLHttpRequest)
	{
	    // code for IE7+, Firefox, Chrome, Opera, Safari
	    return new XMLHttpRequest();
	}
    if (window.ActiveXObject)
	{
	    // code for IE6, IE5
	    return new ActiveXObject("Microsoft.XMLHTTP");
	}
    return null;
}

