
function SaveUserReview(PlaceID,ReviewText,Rating)
{
    PlanetEye.WebSite.WebService.AjaxService.SaveUserReview(PlaceID,ReviewText,Rating,SaveUserReview_Success,SaveUserReview_Fail,"");
}

function SaveUserReview_Success(result, userContext, methodName)
{
    var newLoc = '';
    
    if(window.location.hash.length > 0)
    {
        newLoc = window.location.href.substring(0,window.location.href.indexOf(window.location.hash));
    }
    else
    {
        newLoc = window.location.href;
    }
    
    if(newLoc.indexOf('?') > -1)
    {
    
        if(newLoc.indexOf('jumpto=userreview') == -1)
        {
            newLoc = newLoc + '&jumpto=userreview';
        }
    }
    else
    {
        if(newLoc.indexOf('jumpto=userreview') == -1)
        {
            newLoc = newLoc + '?jumpto=userreview';
        }
    }
    
    window.location.href=newLoc;
}

function SaveUserReview_Fail(error)
{
}


function DeleteReview(ReviewID,ReviewControlID,dFromMid)
{
    var answer = confirm("Delete this review?");
    
	if (answer){
		PlanetEye.WebSite.WebService.AjaxService.DeleteUserReview(ReviewID,DeleteReview_Success,DeleteReview_Fail,ReviewControlID);
		
		if(dFromMid) {document.getElementById('RecentReview').style.display = 'none';}
	}

    
}

function DeleteReview_Success(result, userContext, methodName)
{
    document.getElementById(userContext).style.display = 'none';
    
    if(result != null && result.length > 0)
    {
        document.getElementById('ReviewTextBox').innerHTML = result;
    }
}

function DeleteReview_Fail(error)
{
}
