 var i =0;
function xmlHttpRequest(){
  var xmlhttp =  new Array();
  var Complete = false;

  try { //try for IE 6 above 
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
	  }
  catch (e){ 
			  try {  //try tor the IE Version less than 6
				   xmlhttp  = new ActiveXObject("Microsoft.XMLHTTP");   
				  }
		 catch (e){
			  try {  //try for non MS browsers( i.e. firefox,opera)
				   xmlhttp  = new XMLHttpRequest(); 
				  }
		 catch (e){ 
				   xmlhttp  = false; 
				   }
			 }
 }
  if (!xmlhttp) return null;
  
  this.connect = function(URL,  Method, Vars, CallBack,Loading){		  

    if (!xmlhttp) return false;
    Complete = false;
    Method = Method.toUpperCase();

		try {
		  if(Method == "GET"){
			 xmlhttp.open(Method, URL+"?"+Vars, true);
			 Vars = "";
			} else {
			 xmlhttp.open(Method, URL, true);
			 xmlhttp.setRequestHeader("Method", "GET"+URL+" HTTP/1.1");
			 xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			}
			
      xmlhttp.onreadystatechange = function(){  
				if(xmlhttp.readyState == 1 && !Complete){	  
				    Loading();
				} else if(xmlhttp.readyState == 4 && !Complete){
				   Complete = true;				  
				   CallBack(xmlhttp);
				}
		}
		
      xmlhttp.send(Vars);
	  
    }
    catch(z) { return false; }
    return true;
  };
 return this;
}
var loadingDiv;
function Display(url,param,param1){
	loadingDiv = 'content'+param1;
	var newAjaxConn = new Array();
	    newAjaxConn[i] = new xmlHttpRequest();
	var http_vars="option="+param+"&id="+param1;
	newAjaxConn[i].connect(url,"POST",http_vars,setPlaintext,loading);
	i++
}

function loading(){

	  var div = document.getElementById(loadingDiv);
	  div.innerHTML = "<img src='images/loading.gif' style='text-align:center'/>";
} 

function setPlaintext(request){	 //alert(request.responseText)
	var div = document.getElementById(loadingDiv);
	 div.innerHTML = request.responseText;
}

