$(document).ready(function(){
	$("#oldEvents").click(function () {
		var tHistory = $("#oldEventsList");
		if (tHistory.hasClass("no_visible")) {
			tHistory.removeClass("no_visible");
			$(this).html($("#hideOldEvents").html());
		} else {
			tHistory.addClass("no_visible");
			$(this).html($("#showOldEvents").html());
		}
	});

	var id;		
	$(".openRepeteadEventModal").click(function () {
		jQuery.facebox($(".repeteadEventModal").html());
		id = $(this).attr('eventId');
		return false;
	});
	
	$(".btnyes").live("click", function(){
		jQuery.get(_cpath+"/Main.html?m=sendRepetedEventAlert&p="+id);
		jQuery(document).trigger('close.facebox');
	});
	
	$(".btnno").live("click", function(){
		jQuery(document).trigger('close.facebox');
	});
	
});