function setHeightsWait(){
	setTimeout("setHeightsStart()",50)
}
function setHeightsStart(){
	$(".calEvt").setHeights();
}
function loadEvents(i){
	for (var j in i) {
		try{
		document.evtInfo[j].value = i[j];
		}catch(e){
			alert(e);
		}
	}
	document.evtInfo.submit()
	return false;
}

jQuery.fn.extend({
  setHeights: function(params){
    var jQ = jQuery;
	
    return this.each(function(){
		if (jQ(this).attr('id')) {
			var id = jQ(this).attr('id');
			//get height
			var idHeight = jQ(this).attr('offsetHeight');
			//loop over each item and set the height
			jQ("table.eventCal ." + id).css('height', idHeight -2 );
		}
    });
  },
  showNext: function(params){
    var jQ = jQuery;

    return this.each(function(){
		
		var lis = jQ(this);
		
		var activeli = lis.find(".openArrowItem");	 
		var nextli = activeli.next();
		if (nextli.hasClass("last")) nextli = lis.find(":first");
		
		activeli.removeClass('openArrowItem').addClass('closedArrowItem');
		nextli.removeClass('closedArrowItem').addClass('openArrowItem');
    });
  }
});

