$(document).ready(function() {
	$('#banner ul').cycle({
		fx : 'fade',
		speed : 'slow',
		prev: '#prev',
		next: '#next',
		pager:  '.pager',
		timeout: '5000',
		cleartype: !$.support.opacity,
		cleartypeNoBg: 'false'
		
	});
	
	$('.ngg-galleryoverview a').lightBox({
		imageLoading: 'http://healthliteracy.arekibo.com/wp-content/themes/health/images/lightbox-btn-loading.gif',
		imageBtnClose: 'http://healthliteracy.arekibo.com/wp-content/themes/health/images/lightbox-btn-close.gif',
		imageBtnPrev: 'http://healthliteracy.arekibo.com/wp-content/themes/health/images/lightbox-btn-prev.gif',
		imageBtnNext: 'http://healthliteracy.arekibo.com/wp-content/themes/health/images/lightbox-btn-next.gif'

		
	});
	
	$('.ngg-galleryoverview .ngg-gallery-thumbnail-box:first-child').css("display", "block")
	
	$('.news:first').addClass('first');
	
	
	$('#competition').validate();
	
	$('.submit').click(function() {
		  $('.submit-text').show();
		});
	
	
	$("ul.download-list li").hover(function() {
		$(this).css({'z-index' : '10'});
		$(this).find('img').addClass("hover").stop()
		.animate({
		marginTop: '0px',
		marginLeft: '0px',
		top: '0%',
		left: '0%',
		width: '150px',
		height: '209px',
		padding: '5px'
		}, 200);
		
		} , function() {
		$(this).css({'z-index' : '0'});
		$(this).find('img').removeClass("hover").stop()
		.animate({
		marginTop: '0',
		marginLeft: '0',
		top: '0',
		left: '0',
		width: '45px',
		height: '63px',
		padding: '5px'
		}, 400);
		}); 
	

    var highestCol = Math.max($('#match-height-1').height(), $('#match-height-2').height());
    $('.holder div').height(highestCol);  
    
    if($.cookie('TEXT_SIZE')) {
		$('body').addClass($.cookie('TEXT_SIZE'));	
	}
    

    
	$('ul.text li a').click(function() {
		var textSize = $(this).attr('class');
		$('body').removeClass('plus minus').addClass(textSize);
		$.cookie('TEXT_SIZE',textSize, { path: '/', expires: 10000 });
		return false;
		});



});







function emailme() {
        var title = document.title;
        var url = document.location.href;
        var subject = "healthliteracy.ie";
        var bodyText = "I saw this page and though you might like to see it " + url;

        window.location.href = "mailto:?subject=" + subject + "&body=" + bodyText;

    }




