function load_xml_string(tabName,id) {
var xmlDoc;
var url = "../../GetScript.aspx?CommandName=TopLocationSearch&LocType="+tabName;
var http = new JKL.ParseXML( url );
var data = http.parse();
if(id==0){
xmlDoc= data.Root.Car;
}else if(id==2){
xmlDoc= data.Root.Flight;
}else if(id==1){
xmlDoc= data.Root.Hotel;
}

//alert(xmlDoc.SearchInfo.length);

var destinationToKey= new Array();
var destinationToName=new Array();
var destinationCount=new Array();

var flag=1;
		
for(var i=0;i<xmlDoc.SearchInfo.length;i++)
 {
     var flag=1;
			
    //alert(xmlDoc.childNodes[0].childNodes[id].childNodes[i].childNodes[1].firstChild.nodeValue);
     if(destinationToKey.length>0)
        {			
			   for (var z=0;z<=destinationToKey.length;z++)
               {
                    if (destinationToKey[z] == xmlDoc.SearchInfo[i].To)
                    {
                        destinationCount[z] = destinationCount[z] + parseFloat(xmlDoc.SearchInfo[i].Count);
                        flag=0;
                    }
                }
			}
            if (flag==1)
            {
                destinationToKey[i]=xmlDoc.SearchInfo[i].To;
                destinationCount[i]=parseFloat(xmlDoc.SearchInfo[i].Count);
				destinationToName[i]=xmlDoc.SearchInfo[i].ToName;
            }
 }
var k=0;
var index=0;
var newDestinationToKey=new Array();
var newDestinationCount=new Array();
var newDestinationToName=new Array();
do
{
  if(destinationCount[k]!=null)
  {
  newDestinationToKey[index]=destinationToKey[k];
  newDestinationCount[index]=destinationCount[k];
  newDestinationToName[index]=destinationToName[k];
  index++;
  }
 k++;
}
while(k<destinationCount.length);

//alert(newDestinationCount.length);

 var tampon;
 var tamponTo;
 var tamponToName;
 
    for (var i = 0; i < newDestinationCount.length-1; i++)
    {
        for (var z = (i+1); z < newDestinationCount.length; z++)
        {
            if (newDestinationCount[i] < newDestinationCount[z])
            {   	
                tampon = newDestinationCount[i];
                newDestinationCount[i] = newDestinationCount[z];
                newDestinationCount[z] = tampon;

                tamponTo = newDestinationToKey[i];
                newDestinationToKey[i] = newDestinationToKey[z];
                newDestinationToKey[z] = tamponTo;
				
				tamponToName = newDestinationToName[i];
                newDestinationToName[i] = newDestinationToName[z];
                newDestinationToName[z] = tamponToName;
            }
        }
    }

var array_random=new Array();
var rand_no;
var array_rand_no;
var x;

for(var i=0;i<newDestinationToKey.length;i++)
{
    rand_no = Math.random();
    rand_no = rand_no * newDestinationToKey.length;
    array_rand_no=rand_no.toString().split(".");
    x=array_rand_no[0];

    if(array_random.length>0)
    {
     var z=0;
     do
      {
       if(array_random[z]==x)
	    {
	     rand_no = Math.random();
         rand_no = rand_no * newDestinationToKey.length;
	     array_rand_no=rand_no.toString().split(".");
         x=array_rand_no[0];
	     z=0; 
	    }
	    else
	    {
	     z++;
	    }
      }
     while (z<array_random.length);
     array_random[i]=x;  
    }else{
      array_random[i]=x;
    }
}

var z;
var index=0;
var HTML = new StringBuilder(); 
HTML.append('<div align="center">');
for(var i=0;i<newDestinationToKey.length;i++)
{
    index++;
    var key=array_random[i];
    z=newDestinationToName[key];
    HTML.append("<a href='javascript:SetTopDestinationValues(",key,")' id='topDest_",key,"' class='topDest_",key,"'>",newDestinationToName[key] ,"</a>&nbsp;");
    if(index>5) {
    HTML.append('<br>');
    index=0;
}
}
HTML.append('</div>');

document.getElementById("divTopDestinations").innerHTML=HTML.toString();
return [newDestinationToKey,newDestinationToName];

}