
var communityCache=null;

var communities=null; 
var currentCommunity=null;

function showCommunities()
{
  getCommunitiesWindow();
 
  return  true;
}

function getCommunityById(id)
{
  if (communitites==null) return null;
  for (i=0; i<communities.length; i++)
  {
    if (communities[i].id==id)
      return communities[i]; 
  }
  return null;
}


function getCommunities(selectedId)
{
 var s=""; 

 for (i=0; i<communities.length; i++)
 {
   if (i!=0) s+="&nbsp; ";
   s+="<"+"a href='javascript:void(0)'";
   if (eval(communities[i].id)==selectedId)
     s+=" style='background:#00F500'";
   s+=" title='"+communities[i].description+"' onClick='goToCommunity("+i+");return false;'>"+communities[i].name+"<"+"/a>";
 }  

 return s;
}

function getShowTypeSelect1()
{
 var s ="<select name='showType' id='showTypeSelect' class='baseFont'>"
       +"<option value='0'>all in area</a>"
       +"</select>";

 return s;
}

function getShowTypeSelect2()
{
 var s ="<select name='showType' id='showTypeSelect' class='baseFont' onChange='reloadMap()'>"
       +"<option value='0'>all in area</a>"
       +"<option value='1' selected>all in community</a>"
       +"</select>";

 return s;
}

function getShowTypeSelect3()
{
 var s ="<select name='showType' id='showTypeSelect' class='baseFont' onChange='reloadMap()'>"
       +"<option value='0' selected>all in area</a>"
       +"<option value='2'>my in area</a>"
       +"</select>";

 return s;
}

function getShowTypeSelect4()
{
 var s ="<select name='showType' id='showTypeSelect' class='baseFont' onChange='reloadMap()'>"
       +"<option value='0'>all in area</a>"
       +"<option value='1' selected>all in community</a>"
       +"<option value='2'>my in area</a>"
       +"<option value='3'>my in community</a>"
       +"</select>";

 return s;
}

