function $(id){return document.getElementById(id);}
function GetMessagesCount()
{	
	$('topMessage').innerHTML = this.responseXML.lastChild.firstChild.data;
}
function displayLoginLink()
{
    if(CurrentUserID!=0)
    {       
            $("topLogined").style.display=""; 
            $("topNotLogin").style.display="none"; 
            $("topCurrentUserName").innerHTML=CurrentUserName;
            $("topCurrentUserName").href="/Album/"+CurrentUserID+".htm";
            $("topMyAlbum").href="/Album/"+CurrentUserID+".htm";
            Xml.Request('/Interface/GetUnreadMessagesCount.aspx?userid=' + CurrentUserID + '&username=' + escape(CurrentUserName), null, GetMessagesCount);
	        $("topMessage").href = 'http://passport.soufun.com/message.web/messageunreadlist.aspx/userid=' + CurrentUserID;
     }
     else
     {        
        $("topLogined").style.display="none"; 
        $("topNotLogin").style.display="";    
     }
}  
displayLoginLink();
function RefreshUserInfo()
{   
    displayLoginLink();
}
if(typeof(selectRange)!="undefined")
{
    for(var i=0;i<$("range").length;i++)
    {
        if($("range").options[i].value==selectRange)
        {
            $("range").options[i].selected=true;
            break;
        }
    }
}
if(typeof(searchKey)!="undefined" && searchKey!="")
{
    $("q").value=searchKey;
}