function displayUnlocks ()
{
	if ( unseen_unlocks == true )
	{
		$.ajax({
			url: basepath + "scripts_unlocks/mark_seen",
			global: false,
			dataType: "html",
			async: false,
			success: function(html){
			}
		});
	}
	$.ajax({
		url: basepath + "scripts_unlocks/unseen",
		global: false,
		dataType: "html",
		async: false,
		success: function(html){
			simpleModal(html,450,600);
		}
	});
}

function banMember ( member )
{
	$.ajax({
		url: basepath + "scripts_forum/member_ban",
		global: false,
		type: "POST",
		data: ({member : member}),
		dataType: "html",
		async: false,
		success: function(html){
			simpleModal(html,340,450);
			$('#member_ban_forum').ajaxForm( { 
				data: { member: member },
				beforeSubmit: function () {
					$('.simplemodal-wrap').slideUp(350);
				},
				success: function (responseText) {
					window.setTimeout(
					function () {
						$('.simplemodal-wrap').html(responseText);
						$('.simplemodal-wrap').fadeIn(350);
					}, 
					800);
				}
			});
		}
	});
}

function moveTopic (topic)
{
	$.ajax({
		url: basepath + "scripts_forum/topic_move",
		global: false,
		type: "POST",
		data: ({topic : topic}),
		dataType: "html",
		async: false,
		success: function(html){
			simpleModal(html,180,270);
			$('#topic_move_forum').ajaxForm( { 
				data: { topic: topic },
				beforeSubmit: function () {
					$('.simplemodal-wrap').slideUp(350);
				},
				success: function (responseText) {
					window.setTimeout(
					function () {
						$('.simplemodal-wrap').html(responseText);
						$('.simplemodal-wrap').fadeIn(350);
					}, 
					800);
				}
			});
		}
	});
}

function quickReply (topic)
{
	$.ajax({
		url: basepath + "scripts_forum/quick_reply",
		global: false,
		type: "POST",
		data: ({topic : topic}),
		dataType: "html",
		async: false,
		success: function(html){
			simpleModal(html,300,550);
			$('#quick_reply').ajaxForm( { 
				data: { topic: topic },
				beforeSubmit: function () {
					$('.simplemodal-wrap').slideUp(350);
				},
				success: function (responseText) {
					document.getElementById("quickPost").innerHTML = responseText;
					$('#quickReplyText').slideUp(350);
					$.modal.close();
					$('#quickPost').delay(1050).slideDown(350);
				}
			});
		}
	});
}

function addJob ()
{
	$.ajax({
		url: basepath + "scripts_admin/jobs_add",
		success: function(html){
			simpleModal(html,420,600);
			$('form#simplemodal-data').ajaxForm( { 
				beforeSubmit: function () {
					$('.simplemodal-wrap').slideUp(350);
				},
				success: function (responseText) {
				$.modal.close();
				$('#1_1_tr').before(responseText);
					
				}
			});
		}
	});
}

function openGame (game)
{
	$.ajax({
		url: basepath + "play/game",
		global: false,
		type: "POST",
		data: ({game : game}),
		dataType: "html",
		async: false,
		success: function(html){
			simpleModal(html,470,565);
		}
	});
}

function addFriend ()
{
	$.ajax({
		url: basepath + "scripts_mingle/friend_add",
		global: false,
		type: "POST",
		dataType: "html",
		async: false,
		success: function(html){
			simpleModal(html,180,270);
			$('#friend_add').ajaxForm( { 
				beforeSubmit: function () {
					$('.simplemodal-wrap').slideUp(350);
				},
				success: function (responseText) {
					window.setTimeout(
					function () {
						$('.simplemodal-wrap').html(responseText);
						$('.simplemodal-wrap').fadeIn(350);
					}, 
					800);
				}
			});
		}
	});
}

function removeFriend ()
{
	$.ajax({
		url: basepath + "scripts_mingle/friend_remove",
		global: false,
		type: "POST",
		dataType: "html",
		async: false,
		success: function(html){
			simpleModal(html,180,320);
			$('#friend_remove').ajaxForm( { 
				beforeSubmit: function () {
					$('.simplemodal-wrap').slideUp(350);
				},
				success: function (responseText) {
					window.setTimeout(
					function () {
						$('.simplemodal-wrap').html(responseText);
						$('.simplemodal-wrap').fadeIn(350);
					}, 
					800);
				}
			});
		}
	});
}

function simpleModal (html,height,width)
{
	
	$.modal(html,{
		containerCss:{
			height:height,
			width:width
		},
		onOpen: function(dialog) {
			dialog.overlay.fadeIn(350,function () {
				dialog.container.fadeIn(350,function () {
				dialog.data.slideDown(350);
				});
			});
		},
		onClose: function(dialog) {
			dialog.data.slideUp(350,function () {
				dialog.container.fadeOut(350,function () {
					dialog.overlay.fadeOut(350,function () {
						$.modal.close();
					});
				});
			});
		}
	});
	
}
