$(document).ready(function(){
	//----------------------------------------------Sliders
	$(".newsSlider").jCarouselLite({
			btnNext: ".next",
			btnPrev: ".prev",
			vertical: true,
			visible: 1,
			circular: false
	});
	/*
	bounceout
	elasinout
	elasout
	backin
	backinout
	backout
	*/
	
	
	//----------------------------------------------Text resizer
	if ($.cookie('fontSize') != null) {
		var fontSize = $.cookie('fontSize');
		$('html').css('font-size', fontSize);	
		//alert('Font Size:'+fontSize);
		$('html').animate( { fontSize: fontSize }, 1 )
	} 
	
	var originalFontSize = $('html').css('font-size');	
	
	$("#resetFont").click(function(){
		$('html').animate( { fontSize: originalFontSize }, 500 )
		//alert(originalFontSize);
		$.cookie('fontSize', null);
	});
	//Increase Font Size
	$("#increaseFont").click(function(){
		var currentFontSize = $('html').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum*1.2;
		$('html').animate( { fontSize: newFontSize }, 500 )
		$.cookie('fontSize', newFontSize);
		return false;
	});
	//Decrease Font Size
	$("#decreaseFont").click(function(){
		var currentFontSize = $('html').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum*0.8;
		$('html').animate( { fontSize: newFontSize }, 500 )
		$.cookie('fontSize', newFontSize);
		return false;
	});

	//------------------------------------------------ Set style
	$('#wrapperHome #contentWrapper #content img').css('margin-left','-4px');
	
	$('#content table tr:odd').addClass('odd');
	$('#content table tr:even').addClass('even');
					  
	//alert($.cookie('style'));
	/*
	if ($.cookie('style') == 'main_h') {
		$('#ajaxSearch_form table td').eq(1).html(' ').html('<input id="ajaxSearch_submit" type="submit" name="sub" value="Go!" />');
		alert('main_h');
	}
	if ($.cookie('style') == 'main_h') {
		$('#ajaxSearch_form table td').eq(1).html(' ').html('<input id="ajaxSearch_submit" type="image"  src="assets/templates/moorehall_lodge/images/search_button.gif" name="sub" value="Go!" />');
		alert('main');
	}
	*/
	//------------------------------------------------ Tooltips

	$('a.toolTip').hoverIntent(function(){	
		myimage = $(this).children('img');										
		mytitle = myimage.attr('title'); 
		mycontent = myimage.attr('alt');
		myimage.attr('title', '').attr('alt', '');
		$(this).append('<div class="toolTipContainer"></div>');	
		$(this).children('div.toolTipContainer').html('<h1>'+mytitle+'</h1><p>'+mycontent+'</p>').show().animate({ height: "90px" }, 1000 );	
	},function() { 
		$(this).children('div.toolTipContainer').animate({ height: "0px" }, 500 , function () { $(this).fadeOut().empty().remove(); });	 
		myimage.attr('title', mytitle).attr('alt', mycontent);	 
	});
	
	
	
}); //Close document.ready

$(window).bind("load", function() {
    //-----------  Preload images for slideshows
	//$('#loading').hide();
	//$('#slideshowWrapper').fadeIn('slow');
});