﻿var xml_TASI;
showTASIitems();
function showTASIitems()
{
    try
    {
//        if (!document.all)
//        return
        //alert('ok');    
       getallTASIitems();   
       setTimeout("showTASIitems()",TASITimer)
   }
   catch(oc)
   {
        alert('TASIitems.showTASIitems Error');
   }
}
function getallTASIitems()
{
    try
    {    
    var url="../DataForms/DataTASI.aspx";
    //alert(url);
    xml_TASI=DoCallbackTASI(url);
    //alert(xml_TASI);
    if (xml_TASI!=null)
    {
        xml_TASI.onreadystatechange=setallTASIitems;
    }
	 }
	catch(oc)
	{
	    //alert('error');
	}
}
function DoCallbackTASI(url)
{
var xmlRequest=null;
	try
	{
		xmlRequest=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			xmlRequest=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			try
		    {
		       xmlRequest=new XMLHttpRequest();
		       if (xmlRequest.overrideMimeType) 
		       {
                xmlRequest.overrideMimeType('text/xml');
               }
		    }
		    catch(a)
		    {
			    xmlRequest=null;
			}
		}
	}
	if(!xmlRequest&&typeof XMLHttpreqADSuest!="undefined")
	{
		xmlRequest=new XMLHttpreqADSuest();
	}
 xmlRequest.open("GET", url, true);
   xmlRequest.send(null);
   return  xmlRequest;
}
function setallTASIitems()
{
    try
    {
        if (xml_TASI.readyState==4)
	    {
	            if (xml_TASI.status==200)
		        {
                    //alert(xml_TASI.responseText);
                    var result = xml_TASI.responseText;
                    //alert(result);
                    var TASIitems = "";
                                              
                        
                    if(result!="")
                    {
                        //alert(result);
                        var temp = new Array();
                        var temp1 = new Array();                        
                        temp = result.split('#');
                        //alert(temp[1]);                                            
                        if(temp[0].toString() == "Arabic")
                        {
                            TASIitems += "<table width=100% cellspacing=0 cellpadding=0 class=tab-tabe dir=rtl>";
                            temp1 = temp[1].toString().split(';');
                            //alert(temp1[0]);
                            TASIitems += "<tr >";
                            TASIitems += "<td colspan=5><h2><img src=../images/ico-tasi.gif alt=TASI width=16 height=16 />"+temp1[1].toString()+"</h2></td>";
                            TASIitems += "</tr>";
                            TASIitems += "<tr class=firstrow >";
                            TASIitems += "<td><img alt=TASI src=../Images/"+temp1[6].toString()+".gif /></td>";
                            TASIitems += "<td class=fontrow align=right>"+temp1[3].toString()+"</td>";
                            TASIitems += "<td class=fontrow align=right><font color="+temp1[8].toString()+">"+temp1[4].toString()+"</font></td>"
                            TASIitems += "<td class=fontrow align=right><font color="+temp1[8].toString()+">"+temp1[5].toString()+"</font></td>"
                            TASIitems += "<td class=fontrow align=right>"+temp1[7].toString()+"</td>"                            
                            TASIitems += "</tr>";                                                
                        }
                        else
                        {
                            TASIitems += "<table width=100% cellspacing=0 cellpadding=0 class=tab-tabe dir=ltr>";
                            temp1 = temp[1].toString().split(';');
                            //alert(temp1[0]);
                            TASIitems += "<tr >";
                            TASIitems += "<td colspan=5><h2><img src=../images/ico-tasi.gif alt=TASI width=16 height=16 />"+temp1[0].toString()+"</h2></td>";
                            TASIitems += "</tr>";
                            TASIitems += "<tr class=firstrow >";
                            TASIitems += "<td><img alt=TASI src=../Images/"+temp1[6].toString()+".gif /></td>";                            
                            TASIitems += "<td align=right>"+temp1[3].toString()+"</td>";
                            TASIitems += "<td align=right><font color="+temp1[8].toString()+">"+temp1[4].toString()+"</font></td>"
                            TASIitems += "<td align=right><font color="+temp1[8].toString()+">"+temp1[5].toString()+"</font></td>"
                            TASIitems += "<td align=right>"+temp1[7].toString()+"</td>"                            
                            TASIitems += "</tr>";                        
                        }                       
                        //alert(TASIitems);                            
                     
                    }
                    else
                    {
                    }
                    TASIitems += "</table>";
                    //alert(Sitems);               
                    document.getElementById('TASIDIV').innerHTML= TASIitems;
                }
                else
                {
                    //alert('status');
                }
        }
        else
        {
            //alert('readyState');
        }       
    }
    catch(oc)
    {
        //alert('TASIitems.setallTASIitems');
    }            
}