var xmlHttp
function showAllPhones(userId,companyId,dealerId,dealerName,dealerRef,secId)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 
 
if(userId == '')
{
userId = "null"
}

if(companyId == '')
{
companyId = "null"
}

if(dealerId == '')
{
dealerId = "null"
}

if(dealerName == '')
{
dealerName = "null"
}

if(dealerRef == '')
{
dealerRef = "null"
}

if(secId == '')
{
secId = "null"
}

var userIdString="?userId="+userId
var companyIdString="&companyId="+companyId
var dealerIdString="&dealerId="+dealerId
var dealerNameString="&dealerName="+dealerName
var dealerRefString="&dealerRef="+dealerRef
var secIdString="&secId="+secId

var url="getAllBlackberrysConsumer.php"
url=url+userIdString+companyIdString+dealerIdString+dealerNameString+dealerRefString+secIdString
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=phoneChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function phoneChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("allPhoneArea").focus();
 document.getElementById("allPhoneArea").innerHTML=xmlHttp.responseText
 } 
else
 {
 document.getElementById("allPhoneArea").focus();
 document.getElementById("allPhoneArea").innerHTML="<a><img src='images/update.gif'></a>"
 }
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}