function DemotePromotePoints(type,variableName,divAjaxIndicatorId)
{
	    eval(variableName + "_ajax").SaveRating(type, new Function('result', 'ValueSaved(result);'), new Function("alert('An error occured while saving the rating value.');"));
        //Loading_Indicator.style.display='block';
        document.getElementById(divAjaxIndicatorId).style.display ='block';
}
	
function ValueSaved(result)
{
	     result = eval(result);
	     if(result[0] != "IsNotAuthenticated")
	     {
	         var lblPoints = result[0];//id if lblPoints
	         var points = result[2];//count of points
	         document.getElementById(lblPoints).innerHTML = points;
    	     
	         var demoteID = document.getElementById(result[3]);//id of button demoteID
	         demoteID.onclick = "";
	         demoteID.className=result[5];//cssclas of disable button demoteID
    	     
	         var promoteID = document.getElementById(result[4]);//id of button promoteID
	         promoteID.onclick = "";
	         promoteID.className=result[6];//cssclas of disable button promoteID
	     }
	     else 
	     {
	         window.location= result[2];//url of login page
	     }
	     
	    //Loading_Indicator.style.display='none';
	    document.getElementById(result[1]).style.display ='none';
}
