	function leaveNote(uid, comment) {
		
		$$.pLeaveNote(uid,comment);
	}

	rn.pLeaveNote = function(uid,comment) {
			$("#commentbutton").css({disabled:true});
			rn.rmsSend({ mod:'user', tar:'user', op:'pLeaveNote',comment:comment,uid:uid  },rn.pLeaveNoter);
    };
	
	rn.pLeaveNoter = function(oRmsR) {
		$("#commentbutton").css({disabled:false});
		if (oRmsR['rmsS']==true)
		{
			//alert(oRmsR['rmsD']['userimg']);
			var comm = $("#blankcomment").clone();
			$(comm).attr('id','comm'+oRmsR['rmsD']['commid']);		
			$(comm).find('.commentmain').text(oRmsR['rmsD']['comm']);
			$(comm).find('.commentimage').children('a').children('img').attr('src',oRmsR['rmsD']['userimg']);
			
			$('#maincommentboard').prepend(comm);
			$('#notecomment').val('');
			$(comm).slideDown("slow");
			//$('#maincommentboard').children('.wallcomment:last').slideUp();
			if ($('#maincommentboard').children('.wallcomment').size()>6) {
				$('#maincommentboard').children('.wallcomment:last').remove();
			}
			$("#commentbutton").attr("disabled","");
		}
		else if (oRmsR['rmsS']==false)
		{
			alert(oRmsR['rmsM']);
		}	
		else
		{
			alert('Communication Error');			
		}
    };	
	
	rn.pDelNote = function(uid,cid) {
		rn.rmsSend({ mod:'user', tar:'user', op:'pDelNote',uid:uid,cid:cid},rn.pDelNoter);
    };
	
	rn.pDelNoter = function(oRmsR) {
		if (oRmsR['rmsS']==true)
		{
			var comm = $("#blankcomment").clone();
			$(comm).hide();
			$(comm).attr('id','comm'+oRmsR['rmsD']['commid']);
			$(comm).children('.commenttext').children('.commentmain').text(oRmsR['rmsD']['comm']);
			$(comm).children('.commentimage').children('a').children('img').attr('src',oRmsR['rmsD']['userimg']);
			$(comm).find('#commtime').text(oRmsR['rmsD']['ts']);
			$(comm).find('#uname').text(oRmsR['rmsD']['uname']);
			$(comm).find('.ulink').attr('href',oRmsR['rmsD']['ulink']);
			$('#maincommentboard').append(comm);
			$(comm).slideDown("slow");
		}
		else if (oRmsR['rmsS']==false)
		{
			
		}	
		else
		{
			alert('Communication Error');			
		}
    };	
	
	
	
	rn.pSetEtiquette = function(uid,cid) {
		rn.rmsSend({ mod:'user', tar:'user', op:'pSetEtiquette'},rn.pSetEtiquetter);
    };
	
	rn.pSetEtiquetter = function(oRmsR) {
		if (oRmsR['rmsS']==true)
		{
			$("#etform").hide();
			$("#etsuccess").show();
		}
		else if (oRmsR['rmsS']==false)
		{
			
		}	
		else
		{
			alert('Communication Error');			
		}
    };	
	
	rn.pSetNoEtiquette = function() {
			$("#etform").hide();
			$("#etnosuccess").show();
    };	
	
	
	
	
	function sendReport(obj,uid,pid) {
		var val = $(obj).parents('#reportbody').children('#reportdiv').children('#selval').val();
		var reason = $(obj).parent().siblings('div :second').children('textarea').val();
		$$.pSendUserReport(pid,uid, val, reason);
	}
	
	function requestFriend(uid) {
		if ( $('#hiddenModalContent'+uid).length > 0 )
			tb_show(null,'#TB_inline?height=250&width=500&inlineId=hiddenModalContent'+uid+'&modal=true',false);
		else 
			$$.pUserFriendRequest(uid);
		
	}
	
	rn.pFollowAdd = function(uid) {
		rn.rmsSend({ mod:'user', tar:'user', op:'pFollowAdd',uid:uid },rn.pFollowAddr);
    };
	
	rn.pFollowAddr = function(oRmsR) {
		if (oRmsR['rmsS']==true)
		{
			$('#followyes').show();
			$('#followbut').hide();
			var c = parseInt($('#followcount').text())+1;
			$('#followcount').html(c);
		}
		else if (oRmsR['rmsS']==false)
		{
			alert(oRmsR['rmsM']);
		}
		else
		{
			alert('Communication Error');
		}
    };
	
	
	rn.pUserFriendRequest = function(uid) {
		rn.rmsSend({ mod:'report', tar:'user', op:'pFriendRequest',uid:uid },rn.pUserFriendRequestr);
    };
	
	rn.pUserFriendRequestr = function(oRmsR) {
		if (oRmsR['rmsS']==true)
		{
			$('body').append(oRmsR['rmsD']['box']);
			tb_show(null,'#TB_inline?height=250&width=500&inlineId=hiddenModalContent'+oRmsR['rmsD']['uid']+'&modal=true',false);

		}
		else if (oRmsR['rmsS']==false)
		{
			alert(oRmsR['rmsM']);
		}
		else
		{
			alert('Communication Error');
		}
    };
	
	rn.sendFriendRequest = function(obj, uid) {
		var reason = $(obj).parents('#reportbody').children('#reportdiv').children('textarea').val();
		rn.rmsSend({ mod:'user', tar:'user', op:'pFriendRequest', uid:uid , reason:reason },rn.sendFriendRequestr);
    };
	
	rn.sendFriendRequestr = function(oRmsR) {
		
			  
		if (oRmsR['rmsS']==true)
		{
			//alert('back');
		}
		else if (oRmsR['rmsS']==false)
		{
			alert(oRmsR['rmsM']);
		}	
		else
		{
			alert('Communication Error');		
		}
    };	
	
	
	rn.resendDifferentEmail = function(uid, email) {
		rn.rmsSend({ mod:'user', tar:'user', op:'pResendDifferentEmail', uid:uid , email:email },rn.pResendDifferentEmailr);
    };
	
	rn.pResendDifferentEmailr = function(oRmsR) {
		
			  
		if (oRmsR['rmsS']==true)
		{
			$$.reloadRPC(oRmsR);
		}
		else if (oRmsR['rmsS']==false)
		{
			alert(oRmsR['rmsM']);
		}	
		else
		{
			alert('Communication Error');			
		}
    };	
	
	
	rn.pCUSER = function(oR) {
		var un=$("#checkname").val();
		rn.rmsSend({ mod:'user', tar:'user', op:'pCUSER', uname:un },rn.pCUSERr);
		//rn.rmsSend({ mod:'cmt', tar:jsmod, op:'pC', id:iId, v:val, cid:jscid },rn.pCr);
		
    };
	
	rn.pCUSERr = function(oRmsR) {

		if (oRmsR['rmsS']==true)
		{
			$('#tick').show();
			$('#cancel').hide();
			$('#newusernamehidden').val(oRmsR['rmsM']);
			$('#savechange').show()
		}
		else if (oRmsR['rmsS']==false)
		{
			$('#tick').hide();
			$('#cancel').show();
			alert(oRmsR['rmsM']);
		}	
		else
		{
			alert('Communication Error');			
		}
    };