	var m_curmonth;
	var m_curyear;
	var bnewdate = false;
	
function initnews(){
		
			
			
			//show image desc & trans
			$(".main_image .desc").show(); //Show Banner
			$(".main_image .block").animate({ opacity: 0.85 }, 1 ); //Set Opacity	
			
			
			
			//click & hover events for image list
			$(".image_thumb ul li:first").addClass('active'); //Add the active class (highlights the very first list item by default)
			$(".image_thumb ul li").click(function(){
				//Set Variables
				var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
				var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
				var imgDesc = $(this).find('.block').html();  //Get HTML of the "block" container
				var imgDescHeight = $(".main_image").find('.block').height(); //Find the height of the "block"
			
				if ($(this).is(".active")) {  //If the list item is active/selected, then...
					return false; // Don't click through - Prevents repetitive animations on active/selected list-item
				} else { //If not active then...
					//Animate the Description
					$(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() { //Pull the block down (negative bottom margin of its own height)
						$(".main_image .block").html(imgDesc).animate({ opacity: 0.85,  marginBottom: "0" }, 250 ); //swap the html of the block, then pull the block container back up and set opacity			
						$(".main_image img").attr({ src: imgTitle , alt: imgAlt}); //Switch the main image (URL + alt tag)
						
						Cufon.refresh();
					});
				}
				//Show active list-item
				$(".image_thumb ul li").removeClass('active'); //Remove class of 'active' on all list-items
				$(this).addClass('active');  //Add class of 'active' on the selected list
		
				return false;
			
			}) .hover(function(){ //Hover effects on list-item
				$(this).addClass('hover'); //Add class "hover" on hover
				}, function() {
				$(this).removeClass('hover'); //Remove class "hover" on hover out
			});
			
			
			//toggle & hide
			$("a.collapse").click(function(){
				$(".main_image .block").slideToggle(); //Toggle the description (slide up and down)
				$("a.collapse").toggleClass("show"); //Toggle the class name of "show" (the hide/show tab)
				return false;
			});
			
			$("#nextarrow").click(function(){
						nextMonth();				   
										   
			   });
			   
			$("#prevarrow").click(function(){
						prevMonth();	   
				});
		}
		
		
		function initcalendar(){	
			if(!bnewdate)
			{
				var date = new Date();
				m_curmonth = date.getUTCMonth();
				m_curyear = date.getFullYear();
				bnewdate = true;
			}
			
			$('.date_has_event').each(function () {
				// options
				var distance = 10;
				var time = 250;
				var hideDelay = 250;
		
				var hideDelayTimer = null;
		
				// tracker
				var beingShown = false;
				var shown = false;
		
				var trigger = $(this);
				var popup = $('.events ul', this).css('opacity', 0);
		
				// set the mouseover and mouseout on both element
				$([trigger.get(0), popup.get(0)]).mouseover(function () {
					// stops the hide event if we move from the trigger to the popup element
					if (hideDelayTimer) clearTimeout(hideDelayTimer);
		
					// don't trigger the animation again if we're being shown, or already visible
					if (beingShown || shown) {
						return;
					} else {
						beingShown = true;
		
						// reset position of popup box
						popup.css({
							bottom: 20,
							left: -76,
							display: 'block' // brings the popup back in to view
						})
		
						// (we're using chaining on the popup) now animate it's opacity and position
						.animate({
							bottom: '+=' + distance + 'px',
							opacity: 1
						}, time, 'swing', function() {
							// once the animation is complete, set the tracker variables
							beingShown = false;
							shown = true;
						});
					}
				}).mouseout(function () {
					// reset the timer if we get fired again - avoids double animations
					if (hideDelayTimer) clearTimeout(hideDelayTimer);
		
					// store the timer so that it can be cleared in the mouseover if required
					hideDelayTimer = setTimeout(function () {
						hideDelayTimer = null;
						popup.animate({
							bottom: '-=' + distance + 'px',
							opacity: 0
						}, time, 'swing', function () {
							// once the animate is complete, set the tracker variables
							shown = false;
							// hide the popup entirely after the effect (opacity alone doesn't do the job)
							popup.css('display', 'none');
						});
					}, hideDelay);
				});
			});			
		}
		
		function loadCalendarData(){
			window.alert('ok');
			var date = new Date();
			var tosend = date.getFullYear() + '##' + (date.getUTCMonth()+1);
			m_curmonth = date.getUTCMonth();
			m_curyear = date.getFullYear();
			window.alert(m_curmonth);
			var data = 'yearmonth=' + encodeURIComponent(tosend);
			//window.alert(hash);
			
			$.ajax({
					url: "includes/calendar.php",	
					type: "GET",		
					data: data,		
					cache: false,
					success: function (html) {
					
						$('#calendarwrapper').html(html);
						initcalendar();	
						Cufon.refresh();
							//window.alert('succes');
					}
			   });	
			
		}
		
		function nextMonth(){
			m_curmonth++;
			
			if(m_curmonth > 11)
			{
				m_curyear++;	
				m_curmonth = 0;
			}
			
			
			updateCal();
			
		}
		
		function prevMonth()
		{
			m_curmonth--;
			
			if(m_curmonth < 0)
			{
				m_curyear--;	
				m_curmonth = 11;
			}			
			
			updateCal();
		}
		
		function updateCal()
		{
			var tosend = m_curyear + '##' + (m_curmonth+1);
			var data = 'yearmonth=' + encodeURIComponent(tosend);
			
			$.ajax({
					url: "includes/calendar.php",	
					type: "GET",		
					data: data,		
					cache: false,
					success: function (html) {
					
						$('#calendarwrapper').html(html);
						initcalendar();	
									
						$("#nextarrow").click(function(){
									nextMonth();				   
													   
						   });
						   
						$("#prevarrow").click(function(){
									prevMonth();	   
							});
						
						Cufon.refresh();
							//window.alert('succes');
					}
			   });		
		}
