//fetching the comment post form and processing the post data
function requestCform(sec,id,type) {
	if(!chkBusy()) {
		initHandler();
		field_name = "comment_sec";
		setField(field_name);
		showLoader(field_name);
		ajRequest.send("POST", site_url + "ajax/ajax_comment.php", "action=jShowFormComment&comment_sec="+sec+"&parent_id="+id+"&form_type="+type);
		fetching = true;
	}
}

function postCform(sec,id) {
	if(!chkBusy()) {
		comment_textx = fetchObject("comment_text").value;
		if(comment_textx.replace(/ /g, '') == '') {
			alert("Bitte Text eingeben...");
			return false;
		}
		initHandler();
		field_name = "comment_sec";
		setField(field_name);
		showLoader(field_name);
		ajRequest.send("POST", site_url + "ajax/ajax_comment.php", "action=jPostComment&comment_sec="+sec+"&parent_id="+id+"&comment_text="+urlencode(comment_textx));
		fetching = true;
	}
}

function delComment(sec,id) {
	if(!chkBusy()) {
		initHandler();
		field_name = "comment_sec";
		setField(field_name);
		showLoader(field_name);
		ajRequest.send("POST", site_url + "ajax/ajax_comment.php", "action=jDelComment&comment_sec="+sec+"&comment_id="+id);
		fetching = true;
	}
}

//fetching the news archive
function requestArchive(year,month) {
	if(!chkBusy()) {
		initHandler();
		if(month == 0) {
			field_name = "news_year";
		} else {
			field_name = "news_month";
			fetchObject("head_path").innerHTML = "News Archiv - "+month_ger[month-1]+" "+year;
			/*fetchObject("icontent_box").style.display = "";*/
		}
		setField(field_name);
		showLoader(field_name);
		ajRequest.send("POST", site_url + "ajax.php", "action=jArchive&news_year="+year+"&news_month="+month);
		fetching = true;
	}
}
//////////CALENDAR STUFF//////////

//fetching calendar entries
function requestEvents(time) {
	if(!chkBusy()) {
		initHandler();
		field_name = "hover";
		showLoader(field_name);
		fetchObject(field_name).style.visibility = "visible";
		ajRequest.send("POST", site_url + "ajax.php", "action=jEvents&time="+time);
		fetching = true;
	}
}
