function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 

var xmlHttp
var theid

function cancelrequest(id)
{	

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
  
theid = id ;
  
var url="cancelrequest.php"
url=url+"?ID="+id
xmlHttp.onreadystatechange=cancelstateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 



function cancelstateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 

//	change('req'+theid,);
	
	var what = 'req'+theid;
	
	//fade out
	opacity(what, 100, 0, 200);

	//hide
	//setTimeout("document.getElementById('" + what + "').style.display='none';", 400);

	//change
	setTimeout("document.getElementById('" + what + "').innerHTML='" + xmlHttp.responseText + "';",500);

	//fade in
	setTimeout("opacity('" + what + "', 0, 100, 200);",600);


 } 
}
