// JavaScript Document

$('#banners').cycle({
fx:      'fade', 
speed:    1000, 
timeout:  4000,
startingSlide: 0,
random: false
});

$(function() {
$("#dialog").dialog({	bgiframe: true,	height: 140, width:200,	modal: true,	autoOpen: false	});
});

function closeDialog()
{
	 $("#dialog").dialog("close");
}

function filterCalendar(m, y)
{
	 m = parseInt(m);
		y = parseInt(y);
		
	 $("#news-events").html('<img src="/images/loading_circle.gif" alt="loading" />');
		$.ajax({
  type: "GET",
		url: "/ajax/filter-calendar/"+m+"/"+y+"/",
		success : function (t) {
		  $("#news-events").html(t); 
		}
		});
}

function showEvents(d,m,y,eid)
{
	 $("#dialog").dialog('option', 'width', 700);
  $("#dialog").dialog('option', 'height', 600);
  $("#dialog").dialog('option', 'title', 'Event Viewer');
  $("#dialog").dialog("open");
  $("#dialog").html('<p><img src="/images/loading_circle.gif" alt="Loading"/></p>');
		
		$.ajax({
  type: "GET",
		url: "/ajax/load-event-frame/"+d+"/"+m+"/"+y+"/"+eid+"/",
		success : function (t) {
		  $("#dialog").html(t); 
		}
		});
		
}

function loadEvent(eid)
{
	 eid = parseInt(eid);
		
		$.ajax({
  type: "GET",
		url: "/ajax/load-events/"+eid+"/",
		success : function (t) {
		  $("#event-frame-content").html(t); 
		}
		});
}

$(document).bind("contextmenu",function(e){ return false;  });
