﻿function calendar(month, year, mode, templateName) {

	document.getElementById("calendar").style.opacity = "1";

	$('#iamnotaframe').slideUp("slow",
		function(){
			reloadCalendar(month, year, mode, templateName);
		}
	);
}

function reloadCalendar(month, year, mode, templateName) {
	$('#iamnotaframe').load('ajax/calendar.php?month='+month+'&year='+year+'&mode='+mode+'&templateName=' + templateName  , function () {
			$('#iamnotaframe').slideDown("slow");
	});

}

function search(event, templateName) {	
	if (event.keyCode == 13) {
		var searchTerm = document.getElementById("searchTerms").value;
		$('#iamnotaframe').load('ajax/calendar.php?mode=search&templateName='+templateName+'&searchTerm='  + searchTerm, function () {
			$('#iamnotaframe').slideDown("slow");
		});
		return false;
	}
	else {
		return true;
	}
}
