﻿uiregister = function(pid) {
	$.get(
		HOST_CUOCHEN + 'ajax/uiregister',{id:pid},
		function (response) {
			if (response == 0) {
				location.href = HOST_CUOCHEN+'dating/register?id='+pid;
			} else {
				$.blockUI({
					message: response,
					css: {
						background: 'none',
						border: 'none',
						top:  ($(window).height() - 300)/2 + 'px',
						left: ($(window).width() - 500)/2 + 'px',
						cursor: 'pointer'
					}
				});
			}
		}
	);
}
uimembersofgroup = function(pid, pgroupid, pname, ptype) {
	$.get(
		HOST_CUOCHEN + 'ajax/uimembersofgroup',{id:pid, groupid:pgroupid, name:pname, type:ptype},
		function (response) {
			$.blockUI({
				message: response,
				css: {
					background: 'none',
					border: 'none',
					top:  ($(window).height() - 300)/2 + 'px',
					left: ($(window).width() - 500)/2 + 'px',
					cursor: 'pointer'
				}
			});
		}
	);
}
comment = function(pusername, id, page, iscomment) {
	$.get(
		HOST_CUOCHEN+'ajax/comment?username='+pusername+'&id='+id+'&piscomment='+iscomment+'&page='+page,
		function (response) {
			$('#idComment').html(response);
		}
	);
}
listApprove = function (id, username, isexpire) {
	var purl = HOST_CUOCHEN+'ajax/listapprove';
	var pdata = {
		id:id,
		username:username,
		isexpire:isexpire
	}
	$.ajax({
		cache	: false,
		async	: true,
		data	: pdata,
		url		: purl,
		dataType: 'post',
		success	: function(response) {
			$('#idapprove').html(response);
		}
	});
}
listRegister = function (id, username, isexpire) {
	var purl = HOST_CUOCHEN+'ajax/listregister';
	var pdata = {
		id:id,
		username:username,
		isexpire:isexpire
	}
	$.ajax({
		cache	: false,
		async	: true,
		data	: pdata,
		url		: purl,
		dataType: 'post',
		success	: function(response) {
			$('#idregister').html(response);
		}
	});
}
listApprove2 = function (id, groupid, role, isapproved, isexpire) {
	var purl = HOST_CUOCHEN+'ajax/listapprove2';
	var pdata = {
		id:id,
		groupid:groupid,
		role:role,
		isapproved:isapproved,
		isexpire:isexpire
	}
	$.ajax({
		cache	: false,
		async	: true,
		data	: pdata,
		url		: purl,
		dataType: 'post',
		success	: function(response) {
			$('#idapprove').html(response);
		}
	});
}
listRegister2 = function (id, groupid, role, isexpire) {
	var purl = HOST_CUOCHEN+'ajax/listregister2';
	var pdata = {
		id:id,
		groupid:groupid,
		role:role,
		isapproved:isapproved,
		isexpire:isexpire
	}
	$.ajax({
		cache	: false,
		async	: true,
		data	: pdata,
		url		: purl,
		dataType: 'post',
		success	: function(response) {
			$('#idregister').html(response);
		}
	});
}

uiplan = function(id) {
	$.get(
		HOST_CUOCHEN + 'ajax/uiplan',{id:id},
		function (response) {			
			$.blockUI({
				message: response,
				css: {
					background: 'none',
					border: 'none',
					top:  ($(window).height() - 400)/2 + 'px',
					left: ($(window).width() - 600)/2 + 'px',
					cursor: 'pointer'
				}
			});			
		}
	);
}
