var pagenumright = 0;
  jQuery().ready(function() {
	  
	  $('#cforms2form label').addClass('compressed-font');
	  
	  $('.cf-after').removeClass('compressed-font');
	  
	  $("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

	$("ul.topnav li span").click(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
	
	$(".network-button").click(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$("ul.topnav li span").parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

		$("ul.topnav li span").parent().hover(function() {
		}, function(){
			$("ul.topnav li span").parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$("ul.topnav li span").addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$("ul.topnav li span").removeClass("subhover"); //On hover out, remove class "subhover"
	});
	  
	  
	  jQuery('#events-pagination-top').addClass('compressed-font');
	  	  jQuery('.eme_nav_left').click(function(){
			  pagenumright = pagenumright - 1;
			  var nextweek = "http://localhost/RGU_Union/?eme_offset=" + pagenumright;
			  //alert (nextweek);
			  jQuery('.eme_nav_center').fadeTo('fast',0.01, function(){
				  jQuery('.eme_nav_center').load(nextweek + ' .eme_nav_center',function(){
				  jQuery('.eme_nav_center').fadeTo('fast',1);
			  	  });
			  });
			  jQuery('.frontpage_events').fadeTo('fast',0.01, function(){ 
				  jQuery('.eme_events_list').load(nextweek + ' .frontpage_events', function(){
					  jQuery('.eme_nav_right').attr('href',nextweek);			 
					  jQuery('.frontpage_events').fadeTo(250,1);
				  });
			  });
			  return false;
	  });
	  jQuery('.eme_nav_right').click(function(){
			  pagenumright = pagenumright + 1;
			  var nextweek = "http://localhost/RGU_Union/?eme_offset=" + pagenumright;
			  //alert (nextweek);
			  jQuery('.eme_nav_center').fadeTo('fast',0.01, function(){
				  jQuery('.eme_nav_center').load(nextweek + ' .eme_nav_center',function(){
				  jQuery('.eme_nav_center').fadeTo('fast',1);
			  	});
			  });
			  jQuery('.frontpage_events').fadeTo('fast',0.01,function(){
				  jQuery('.eme_events_list').load(nextweek + ' .frontpage_events', function(){
					  jQuery('.eme_nav_right').attr('href',nextweek);			 
					  jQuery('.frontpage_events').fadeTo(250,1);
			  	  });
			  });
			  return false;
	  });
	  $('#coda-slider-1').codaSlider({
		  crossLinking: false
	  });
  });
