﻿// JScript File

var _communityList;

function GetCommunities()
{
    wsrvJTMaloney.CommunityList(onGetCommunities_Complete, onGetCommunities_Error);
}
function onGetCommunities_Complete(result)
{
    _communityList = result;
    CommunityPhoneNumbers();
}
function onGetCommunities_Error(err)
{
	alert('error getting list');
}
function CommunityPhoneNumbers()
{

    var v = "<table cellpadding='0' cellspacing='0' border='0'  width='100%'";
    for(var i=0;i<_communityList.length;i++)
    {
        if( (i % 2) == 0)
            v += "<tr bgcolor='#efeded'>";
        else
            v+= "<tr bgcolor='#ffffff'>";
    
        v+="<td align='left' valign='top' width='100%' nowrap>&nbsp;&nbsp;" + _communityList[i].Title + "</td>";
        v+="<td align='right' valign='top' width='100%'>" + _communityList[i].PhoneNumber + "&nbsp;&nbsp;</td>";
	        
        v+= "</tr>";
    }
    v+= "</table>";

		//alert(v);    
    $get('div_CommunityPhonenumbers').innerHTML = v;
}
      

Sys.Application.notifyScriptLoaded();

