notifyFromMod = function () {	
	var display = $("#notifyFromMod").css('display');	
	if(display == 'none') {
		$("#notifyFromMod").show("slow");		
	} else {
		$("#notifyFromMod").hide("slow");
	}
}

ideaOfProfession = function () {	
	var display = $("#ideaOfProfession").css('display');	
	if(display == 'none') {
		$("#ideaOfProfession").show("slow");		
	} else {
		$("#ideaOfProfession").hide("slow");
	}
}
deletedebate = function(id, refobjid) {
	if (confirm(tranhluan_msg_confirm_deletedebate)) {
		location.href = HOST_TRANHLUAN+'debate/dodeletedebate?id='+id+'&refobjid'+refobjid;
	}
}
disabledside = function(ploginusername, pusername, debateid, sideid) {
	if (ploginusername != pusername) {
		if (confirm(tranhluan_msg_confirm_disabledside)) {
			location.href = HOST_TRANHLUAN+'debate/dodisabledside?debateid='+debateid+'&sideid='+sideid;
		}
	} else {
		alert(tranhluan_msg_error_disabledside_myself);
	}
}
uisource = function(id, type) {
	var purl = HOST_TRANHLUAN+'ajax/uisource';
	var pdata = {
		id: id,
		type: type
	}
	$.ajax({
		cache	: false,
		async	: false,
		data	: pdata,
		url		: purl,
		type	: 'post',
		success	: function(response) {
			$.blockUI({
				message: response,
				css: {
					background: '#fff',
					border: 'none',
					width: '600px',
					top:  ($(window).height() - 600)/2 + 'px',
					left: ($(window).width() - 600)/2 + 'px',
					cursor: 'pointer'
				}
			});
		}
	});
}
uiside = function(id, owner) {
	var purl = HOST_TRANHLUAN+'ajax/uiside';
	var pdata = {
		id: id,
		owner: owner
	}
	$.ajax({
		cache	: false,
		async	: false,
		data	: pdata,
		url		: purl,
		type	: 'post',
		success	: function(response) {
			$.blockUI({
				message: response,
				css: {
					background: '#fff',
					border: 'none',
					top:  ($(window).height() - 400)/2 + 'px',
					left: ($(window).width() - 400)/2 + 'px',
					cursor: 'pointer'
				}
			});
		}
	});
}
uiblacklist = function(id) {
	var purl = HOST_TRANHLUAN+'ajax/uiblacklist';
	var pdata = {
		debateid: id
	}
	$.ajax({
		cache	: false,
		async	: false,
		data	: pdata,
		url		: purl,
		type	: 'post',
		success	: function(response) {
			$.blockUI({
			message: response,
				css: {
					background: '#fff',
					border: 'none',
					width: '600px',
					top:  ($(window).height() - 500)/2 + 'px',
					left: ($(window).width() - 600)/2 + 'px',
					cursor: 'pointer'
				}
			});
		}
	});
}
votedebate = function(id) {
	var purl = HOST_TRANHLUAN+'ajax/votedebate';
	var pdata = {
		id: id
	}
	$.ajax({
		cache	: false,
		async	: false,
		data	: pdata,
		url		: purl,
		type	: 'post',
		success	: function(response) {
			if (response) {
				$('#idvotedebate').html(response);
				showUIMessage(tranhluan_msg_success_votedebate);
			} else {
				alert(tranhluan_msg_error_voteddebate);
			}
		}
	});
}
hideidea = function (id) {
	$('#idup'+id).hide();
	$('#iddown'+id).show();
	$('#ul'+id).hide();
}
showidea = function(id) {
	$('#iddown'+id).hide();
	$('#idup'+id).show();
	$('#ul'+id).show();
}

showhidecomment = function(id, show) {
	if (show==0) {
		$('#idhide'+id).hide();
		$('#idshow'+id).show();	
		$('#idcomment'+id).hide('slow');			
	} else {
		$('#idshow'+id).hide();
		$('#idhide'+id).show();		
		$('#idcomment'+id).show('slow');			
	}
}

showhidecontent = function (me, id) {
	var display=$('#idcontent'+id).css('display');
	if (display=='none') {
		$('#idcontent'+id).show('slow');
		$(me).html('Ẩn phản hồi');
		$(me).attr('class', 'iconPointUp');
	} else {
		$('#idcontent'+id).hide('slow');
		$(me).html('Hiển thị phản hồi');
		$(me).attr('class', 'iconPointDown');
	}
	/* 
	if (me.src==HOST_STATIC+'img/btn/plus.gif')	{
		$('#idcontent'+id).show();
		me.src=HOST_STATIC+'img/btn/subtract.gif';
	} else {
		$('#idcontent'+id).hide();
		me.src=HOST_STATIC+'img/btn/plus.gif';
	} */
}
showhideside = function (me, id) {
	if (me.src==HOST_STATIC+'img/icon/debate-pointofview-hide.gif')	{
		$('#idshowside'+id).hide();
		$('#idhideside'+id).show();
	} else {
		$('#idhideside'+id).hide();
		$('#idshowside'+id).show();
	}
}
comment = function(pisgroupowner, pdebateid, psortby) {
	var purl = HOST_TRANHLUAN+'ajax/comment';
	var pdata = {
		isgroupowner: pisgroupowner,
		debateid: pdebateid,
		sortby: psortby
	}
	$.ajax({
		cache	: false,
		async	: false,
		data	: pdata,
		url		: purl,
		type	: 'post',
		success	: function(response) {
			$('#idcomments').html(response);
		}
	});
}
uisumary = function(id) {
	var purl = HOST_TRANHLUAN+'ajax/uisumary';
	var pdata = {
		id: id
	}
	$.ajax({
		cache	: false,
		async	: false,
		data	: pdata,
		url		: purl,
		type	: 'post',
		success	: function(response) {
			$.blockUI({
				message: response,
				css: {
					background: '#fff',
					border: 'none',
					width: '600px',
					top:  ($(window).height() - 400)/2 + 'px',
					left: ($(window).width() - 600)/2 + 'px',
					cursor: 'pointer'
				}
			});
		}
	});
}
uinotify = function(pgroupid, pdebateid, pupdate) {
	var purl = HOST_TRANHLUAN+'ajax/uinotify?pdebateid='+pdebateid+'&pgroupid='+pgroupid+'&pupdate='+pupdate;
	$.ajax({
		cache	: false,
		async	: false,
		data	: null,
		url		: purl,
		type	: 'post',
		success	: function(response) {
			$.blockUI({
				message: response,
				css: {
					background: '#fff',
					border: 'none',
					width: '400px',
					top:  ($(window).height() - 400)/2 + 'px',
					left: ($(window).width() - 400)/2 + 'px',
					cursor: 'pointer'
				}
			});
		}
	});
}
deletenotify = function(pgroupid, pdebateid) {
	if (confirm(tranhluan_msg_confirm_deletenotify)) {
		location.href = HOST_TRANHLUAN+'debate/dodeletenotify?pdebateid='+pdebateid+'&pgroupid='+pgroupid;
	}
}
function showpopupfullimage(img) {
	window.open(img, 'Image', 'width=450,height=450,scrollbars=yes');
}
function fbs_click() {
	var u=location.href;
	var t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer',',width=980,height=600');
}
