function ajax_updater(url, params, id, type) {
	$.ajax({
		type: ((type == "post") ? "post" : "get"),
		processData: true,
		url: url,
		data: params,
		cache: false,
		success: function(data) {
			$("#" + id).html(data);
		}
	});
}

function change_image(id, pg, dir) {
	$("#imageArea").html("");
	$("#loader").show();
	$(".half").removeClass("half");
	$("#image_" + id + "_" + pg).addClass("half");
	var params = "pid=" + id + "&pg=" + pg + "&d=" + dir;
	ajax_updater("functions/cb_image.php", params, "imageArea", "get");
}

function show_image(id, pg) {
	var params = "pid=" + id + "&pg=" + pg;
	ajax_updater("functions/cb_category.php", params, "image_area", "get");
}

function show_program(id, pg) {
	var params = "pid=" + id + "&pg=" + pg;
	ajax_updater("functions/cb_program.php", params, "image_area", "get");
}