// this script will populate the div in htm pages

function getDivObj(name)
 {
	if (document.getElementById)
	 {
		this.obj = document.getElementById(name); 
	 }
	else if (document.all)
	 {
	    this.obj = document.all[name];
	 }
	else if (document.layers)
	 {
	    this.obj = document.layers[name];	
	 }
}// function over



function createRequestObject()
 {
   	var xmlhttp;
	if (window.XMLHttpRequest)
	 { 
	    xmlhttp = new XMLHttpRequest();
	 }
	else if (window.ActiveXObject)
	 {
	    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	 } 
	return  xmlhttp;
 }// function over



function populateDiv(symbol)
{
   //alert("inside function & symbol is----"+symbol);
   xmlHttpObj1=createRequestObject();
   xmlHttpObj2=createRequestObject();
   xmlHttpObj3=createRequestObject();
   xmlHttpObj4=createRequestObject();

   if (xmlHttpObj1==null)
    {
      alert ("Your browser does not support AJAX!");
      return;
    } 
  
   //Random rndmNo1= new Random();
   //int i = rndmNo1.nextInt();
  var url1="templt_grph_lnk_"+symbol+".htm?time="+ new Date();
  //var url1="templt_grph_lnk_"+symbol+".htm?time=1";
  
   //var url1="templt_grph_lnk_"+symbol+".htm";
   xmlHttpObj1.onreadystatechange=function()
   {
      if(xmlHttpObj1.readyState == 4 || xmlHttpObj1.readyState == "complete") 
	   {  
	     if (xmlHttpObj1.status == 200 ) 
	      {
		    var s=xmlHttpObj1.responseText;
		    //alert("rrererrer"+s);
	        divBoxObj = new getDivObj('ipo_graph');
            divBoxObj.obj.innerHTML=xmlHttpObj1.responseText;
	      }
      } 
   }
 
 xmlHttpObj1.open("GET",url1,true);
 xmlHttpObj1.send(null);


 if (xmlHttpObj2==null)
    {
      alert ("Your browser does not support AJAX!");
      return;
    } 
  

  //var url1="templt_grph_lnk_"+symbol+".htm?time="+ new Date();
  var url2="templt_extn_"+symbol+".htm?time="+ new Date();
//alert("url is----"+url2);
   
   //var url2="templt_extn_"+symbol+".htm";
   /*xmlHttpObj2.Clear();
xmlHttpObj2.CacheControl = "no-cache";
xmlHttpObj2.AddHeader("Pragma", "no-cache");
xmlHttpObj2.Expires = -1;
xmlHttpObj2.ContentType = "text/plain";
*/
   xmlHttpObj2.onreadystatechange=function()
   {
      if(xmlHttpObj2.readyState == 4 || xmlHttpObj2.readyState == "complete") 
	   {  
	     if (xmlHttpObj2.status == 200 ) 
	      {
		    var s=xmlHttpObj2.responseText;
		    //alert("rrererrer"+s);
	        divBoxObj = new getDivObj('ipo_extn');
            divBoxObj.obj.innerHTML=xmlHttpObj2.responseText;
	      }
      } 
   }
 
 xmlHttpObj2.open("GET",url2,true);
 xmlHttpObj2.send(null);


 
var url3="templt_mid_"+symbol+".htm?time="+ new Date();
xmlHttpObj3.onreadystatechange=function()
  {
    if(xmlHttpObj3.readyState == 4 || xmlHttpObj3.readyState == "complete")
	{
      if (xmlHttpObj3.status == 200)
		{
	      divBoxObj = new getDivObj('ipo_mid'); 
          divBoxObj.obj.innerHTML=xmlHttpObj3.responseText;
		}
    } 
  }
 
xmlHttpObj3.open("GET",url3,true);
xmlHttpObj3.send(null);

var url4="templt_catgry_"+symbol+".htm?time="+ new Date();
xmlHttpObj4.onreadystatechange=function()
 {
    if(xmlHttpObj4.readyState == 4 || xmlHttpObj4.readyState == "complete")
	{
	//alert("3333333");
   	  if (xmlHttpObj4.status == 200 ) 
		{
            divBoxObj = new getDivObj('ipo_catgry'); 
	        divBoxObj.obj.innerHTML=xmlHttpObj4.responseText;
		}
    } 
 }
 
xmlHttpObj4.open("GET",url4,true);
xmlHttpObj4.send(null);

}// fun populateDiv over

