<!--
 var http = createRequestObject();
 function createRequestObject() 
     {
           var xmlhttp;
	 try 
                 { 
                    xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
                 }
	  catch(e) 
                 {
	    try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
	    catch(f) { xmlhttp=null; }
	    }
	        if(!xmlhttp&&typeof XMLHttpRequest!="undefined") 
                        {
	  	   xmlhttp=new XMLHttpRequest();
	           }
		   return  xmlhttp;
 }
function getCurrentIndex(strIPOPerfIDs)
  {
	//var dvelement = document.getElementById('dv');
	//dvelement.innerHTML = "<img src='../images/starimages/progressimgred.gif' width='10' height='10'>";
    try
	{

		http.open('GET', 'ipo_perf_tracker_ajax_action.asp?a='+strIPOPerfIDs);
        http.onreadystatechange = handleResponseText;
	    http.send(null);
		//dvelement.innerHTML = "";
	 }
	    catch(e){}
	    finally{}
 }
function handleResponseText() 
{
try
 {
  if((http.readyState == 4)&& (http.status == 200))
  {

	var response = http.responseText;
	var arrIPOWiseRecords = new Array();
    var update = new Array();
	if(response.indexOf('|') != -1) 
    {
     arrIPOWiseRecords = response.split('|');
  	 for(i=0;i<arrIPOWiseRecords.length;i++){
       if(arrIPOWiseRecords[i] != "" ){
	   update = arrIPOWiseRecords[i].split(',');

	   var Currentindex = document.getElementById('Currentindex'+update[0]);
   	   var Profit_Loss = document.getElementById('Profit_Loss'+update[0]);
	   var DayHigh = document.getElementById('DayHigh'+update[0]);
	   var DayLow = document.getElementById('DayLow'+update[0]);
	   var Volume = document.getElementById('Volume'+update[0]);
	   var LastUpdate = document.getElementById('LastUpdate');

	   var strIssuePrice = update[1] * 1; 
	   var sCurrentindex = update[3] * 1; 
	   var sDate = update[4];
	   var sTime = update[5];
	   var sDayHigh = update[8];
	   var sDayLow = update[9];
	   var sVolume = update[10];
	   var iProfit_Loss;
	   var sLastUpdate = sDate +" "+ sTime;

	   if (sCurrentindex != '0.00'){
	  	   iProfit_Loss = (((sCurrentindex - strIssuePrice)/strIssuePrice) * 100);
		   iProfit_Loss = Math.round(iProfit_Loss*100)/100; 
		   if (iProfit_Loss < 0){
			   iProfit_Loss = "<font color='#FF0000'>" + iProfit_Loss + "% </font>"
		   }else{
			   iProfit_Loss = iProfit_Loss + "%"	
		   }
	   }else{
		   iProfit_Loss = ""
	   }
		   
	   if(sDayHigh == "N/A"){sDayHigh = ""}
	   if(sDayLow == "N/A"){sDayLow = ""}
	   if(sVolume == "N/A" || sVolume == 0){ sVolume = ""}
	   if(sCurrentindex == "0.00"){sCurrentindex = ""}

	  //Calculate Profit_Loss
	  if (Currentindex  != null){Currentindex.innerHTML = sCurrentindex;}
	  if (LastUpdate != null){LastUpdate.innerHTML = sLastUpdate;}
	  if (DayHigh  != null){DayHigh.innerHTML = sDayHigh;}
	  if (DayLow != null){DayLow.innerHTML = sDayLow;}
  	  if (Volume != null){Volume.innerHTML = sVolume;}
   	  if (Profit_Loss != null){Profit_Loss.innerHTML = iProfit_Loss;}
	   }// end if
	}// End For
   }// End if
  }// End if
}// end try
	catch(e){alert("an error occured");}
	finally{}
}

function js_RemoveChar(str)
{
	charToRemove = '"';
	regExp = new RegExp("["+charToRemove+"]","g");
	return str.replace(regExp,"");

}

function funShowWaitSign(strIPT_IDs)
{
	var arrIPT_IDs;
	if (strIPT_IDs != "")
	{
	   arrIPT_IDs = strIPT_IDs.split(',');
       for(i=0;i<arrIPT_IDs.length;i++){
		 var Currentindex = document.getElementById('Currentindex'+arrIPT_IDs[i]);
   	     if ( Currentindex != null){Currentindex.innerHTML = "<img src='images/progressimgred.gif' width='10' height='10'>";}
	    }// end for
	}// end if
	return;
}

-->
