function loadContent(model, str, mediatype, sql_start) {
	var url = "ajax.php?";
	var pars = "action=loadContent&model=" + model + "&s=" + str + "&mediatype=" + mediatype + "&start=" + sql_start;
	var myAjax = new Ajax.Request(url, {
		method: 'get',
		parameters: pars,
		onLoading: function () {
			loading = document.createElement("div");
			loading.setAttribute("class", "boxloading");
			loading.setAttribute("className", "boxloading");
			loading.style.height = $('table').offsetHeight-2+"px";
			loadingimage = document.createElement("div");
			loadingimage.setAttribute("class", "boxloadingimage");
			loadingimage.setAttribute("className", "boxloadingimage");
			loadingimage.style.height = $('table').offsetHeight-2+"px";
			$('table').appendChild(loading);
			$('table').appendChild(loadingimage);
		},
		onSuccess: function (req) {
			$('table').innerHTML = req.responseText;
			$('mediatype').value = mediatype;
		}
	});
}

function showFaq(id) {
	for(var i=0; i<=5; i++) {
		if($('faq' + i).style.display != "none") {
			new Effect.toggle('faq' + i, 'Blind', {duration: 0.3});
		}
	}
	new Effect.toggle('faq' + id, 'Blind', {duration: 0.3});
}

function loadMedia(id, mediatype) {
	var details = $$('div.details');
	for(var i=0; i<details.length; i++) {
		details[i].style.display = "none";
		var iId = details[i].id.split("_");
		$('result_' + iId[1]).style.background = "white";
		$('icon_' + iId[1]).src = "images/icon_" + mediatype + ".gif";
		$('result_' + iId[1]).style.borderBottom = "1px solid white";
		$('result_' + iId[1]).style.borderTop = "1px solid #c4c4c4";
		$('details_' + iId[1]).style.display = "none";
		$('content_' + iId[1]).style.color = "#8a8a8a";
		$('date_' + iId[1]).style.color = "#8a8a8a";
	}
	var url = "ajax.php?";
	var pars = "action=loadMediaDetails";
	var myAjax = new Ajax.Request(url, {
		method: 'get',
		parameters: pars,
		onLoading: function () {
			$('result_' + id).style.background = "#d6f0f9";
			$('result_' + id).style.borderBottom = "1px solid #d6f0f9";
			$('result_' + id).style.borderTop = "1px solid #009fda";
			$('icon_' + id).src = "images/icon_active_" + mediatype + ".gif";
			$('content_' + id).style.color = "#48494A";
			$('date_' + id).style.color = "#48494A";
			$('details_' + id).innerHTML = "";
		},
		onSuccess: function (req) {
			$('details_' + id).innerHTML = req.responseText;
			$('details_' + id).style.display = "block";
		}
	});
}