// JS Document

var resGetCalendar = function(t) {
   	//alert(t.responseText); return;
	if (t.responseText.substr(0, 5) == 'Error') {
		Notify(t.responseText, 99);
	} else {
		$('calendar').innerHTML = t.responseText;
	}
}

function getCalendar(from,to,rid) {
	if (rid == undefined) {
		rid = '';
	}
	if (from == undefined) {
		from = '';
	}
	if (to == undefined) {
		to = '';
	}
	var sendVals = 'call=buildCalendar&from='+escape(from)+'&to='+escape(to)+'&rid='+escape(rid);
	new Ajax.Request('http://www.iwantabuzz.com/js/ajax/cal.ajax.php', {method:'post', postBody:sendVals, onComplete:resGetCalendar});
}

function morpher(id,val) {
	if ($('day_'+id).className != 'day active') {
		if (val == 1) {
    		//new Effect.Morph('day_'+id, { style: 'background-color: #EFEFEF; color: #333;', duration: 0.1 });
    	} else if (val == 2) {
    		//new Effect.Morph('day_'+id, { style: 'background-color: #E2591B; color: #FFF;', duration: 0.1 });
    	}
	}
}
