var gumAlert=function(aa,bb,cc){	
	TB_add();
	jAlert(aa, bb);
	$("#popup_ok").click(function(){
		TB_remove();
		if(cc=="back")
		{
			history.back();
		}else if(cc!=null&&cc!="")
		{
			window.parent.location=cc;			
		}
	});
};

var gumWarning=function(aa,bb,cc){
	TB_add();
	jPrompt(aa, bb);
	$("#popup_ok").click(function(){
		TB_remove();
		if(cc=="back")
		{
			history.back();
		}else if(cc!=null&&cc!="")
		{
			window.parent.location=cc;			
		}
	});			
	
	$("#popup_cancel").click(function(){
		TB_remove();
	});
};

var gumAlertTo=function(aa,bb,cc){	
	TB_add();
	jConfirm(aa, bb, function(r) {
		if(r)
		{
			window.parent.location=cc;			
		}
		else
		{			
			window.parent.location="/user/";
		}
	});
};

var gumConfirm=function(aa,bb,cc){	
	TB_add();
	jConfirm(aa, bb, function(r) {
		if(r)
		{
			window.parent.location=cc;
		}
	});	
	
	$("#popup_ok").click(function(){
		TB_remove();
	});
	
	$("#popup_cancel").click(function(){
		TB_remove();
	});
};

var addFriends=function(aa,bb,cc){	
	TB_add();
	jConfirm(aa, bb, function(r) {		
		if(r){
			$.post(cc, function(data) {
				if(data.indexOf(",")>0)
				{
 				 gumWarning(data,"消息提示","");
				}
				else
				{
 				 gumAlert(data,"消息提示","");
				}
			});
		}
	});	
	
	$("#popup_ok").click(function(){
		TB_remove();
	});
	
	$("#popup_cancel").click(function(){
		TB_remove();
	});
};
