function watchs(uid,toid){
	var success = 0;
	if(uid!="")
		jQuery.facebox({ajax:SITEROOT + '/watchs/watch/success/' + success +'/toid/'+toid });
	else
		window.location.href = SITEROOT + '/signin/user';
}

function addwatch(){
			var formid = $('#formid').val();
			var toid = $('#toid').val();
			var msg = $('#msg').val();
			$.post(SITEROOT + '/watchs/addwatch/',{formid:formid,toid:toid,msg:msg},function(data){
				if(data.success == 1){
					//jQuery.facebox({ajax:SITEROOT + '/friends/addasfriend/success' + '/1'});
					location.reload(true);
				}else{
					jQuery.facebox({ajax:SITEROOT + '/friends/watch/success' + '/2'});
				}
			},'json');
}

function removewatch(wid){
	if(confirm('Are you sure to remove from watchlist?')){
			$.post(SITEROOT + '/watchs/removewatch/',{wid:wid},function(data){
				if(data.success == 1){
					location.reload(true);
				}
			},'json');
		}else{
			return false;
		}
}
