function UpdateDivContent(element,txt)
{
    try
    {
	    (typeof txt== 'string') ? element.set('html', txt) : element.adopt(txt);
	}
	catch(e)
	{
	    //alert("Update Div Content Error.Content:"+txt);
	}
}

function PopUp(sendLink, name, width, height, scrollbars) {
    PopUpEx(sendLink, name, width, height, scrollbars);
}	
function PopUpEx(sendLink, name, width, height, scrollbars) {
    mm= "width=" + width + ",height=" + height + ",scrollbars=" + scrollbars;
    win = window.open(sendLink, name, mm);
    if (win && win.open && !win.closed)
        win.focus();
    return win;
}

function FullSize(url,ix,iy) {
    if(ix>0) {
        PopUp(url,"fsphoto",ix+6,iy+6,"no");
    }
}

function RandomUserid(l,u)
{
    return Math.floor((Math.random() * (u-l+1))+l);
}

function UpgradeGoldMembership()
{
	window.location.href=UpgradeMembershipURL;
}

function UploadPhoto()
{
    window.location.href=UploadPhotoURL;
}

function EditProfile()
{
    window.location.href=EditProfileURL;
}

function GoToFavoriteProfile()
{
	window.location.href=GoToFavoriteProfileURL;
}

function NeedLogin()
{
    window.location.href="login.asp?needlogin=1";
}


function WindowReload()
{
    var CurrentLocationURL=window.location.href;
    var CurrentLocationURLArray=CurrentLocationURL.split('#');
	window.location.href=CurrentLocationURLArray[0];
}

function OpenInstantMessenger()
{
    try
    {
        window.parent.OpenInstantMessenger();
    }
    catch(e)
    {
        alert("Sorry, your browser don't support Frame or Javascript! Please use Internet Explorer 6.0+ or FireFox2.0+ and make sure your setting allow Frame and Javascript!");
    }
}