/* <![CDATA[ */

// initialise drop down menu
	jQuery(function(){
		jQuery('ul.sf-menu').superfish();
	});
	
	$(document).ready(function(){
		
		//clear inputs on focus
		$("input.text").focus(function() {
				if( this.value == this.defaultValue ) {
					this.value = "";
				}
			}).blur(function() {
				if( !this.value.length ) {
					this.value = this.defaultValue;
				}
			});
			
		//image Cycle	
		$('#header_image').cycle({
			 fx: 'fade',
			 speed: '500',
			 pause:  3    	
		});
		
		//Change cursor on form elements
		$('input.submit, select').hover(function() {
			$(this).css('cursor','pointer');
			}, function() {
			$(this).css('cursor','auto');
		});
		
		//text resizer
		if($.cookie("resize")) {
			$("link.text").attr("href",$.cookie("resize"));
		}
		$("#textresize a").click(function() {
			$("link.text").attr("href",$(this).attr('rel'));
			$.cookie("resize",$(this).attr('rel'), {expires: 365, path: '/'});
			return false;
		});
		
		//text resizer
		if($.cookie("textonly")) {
			$("link.main").attr("href",$.cookie("textonly"));
		}
		//text only
		$("li.text a").click(function() {
			$("link.main").attr("href",$(this).attr('rel'));
			$.cookie("textonly",$(this).attr('rel'), {expires: 365, path: '/'});
			return false;
		});
		
		//print page
		$('li.print a').click(function() {
			window.print();
			return false;
		})
		
		
		//Calender
		//add class to td if event
		$('table tr td a').parents().addClass('event');
		//make td link
		$("table tr td.event").click(function(){
    	window.location=$(this).find("a").attr("href");return false;
		});
		//change cursor on td
		$('table tr td.event').hover(function() {
			$(this).css('cursor','pointer');
			}, function() {
			$(this).css('cursor','auto');
		});
		
		//events list
		//make block clickable
		$("ul.event_list li").click(function(){
    	window.location=$(this).find("a").attr("href");return false;
		});
		//change cursor
		$('ul.event_list li').hover(function() {
			$(this).css('cursor','pointer');
			$(this).addClass('hover');
			}, function() {
			$(this).css('cursor','auto');
			$(this).removeClass('hover');
		});
		
	
		
		
	});

/* ]]> */
