$(function(){
	$.fn.supersized.options = {  
		startwidth: 640,  
		startheight: 480,
		vertical_center: 1,
		slideshow: 0  
	};
	$('#supersize').supersized(); 
	
	  $('#picswap').cycle({
		fx:   'fade',  
		delay: 4000,
		timeout:6000,
		after:   onAfter
	});
	 
	 $('a.panellink').click(function () {
		var panelID = $(this)[0].getAttribute('href');
		//alert(panelID);
		var htmlStr = $('#'+panelID).html();
		$('#visible').html(htmlStr);
		return false;
	});
	
	$('#pics').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		delay: 2000 
	});
	
	if($('.jqtransform').length) {
		$('.jqtransform').jqTransform({imgPath:'{/designs/middlelagoon3/images/img/'});
	}
	
});

function onAfter () {
	$('#pictitle').text(this.alt);
	$('#piclink').html('<a class="panellink" href="'+this.title+'">Click to find out more</a>');
	$('a.panellink').click(function () {
		var panelID = $(this)[0].getAttribute('href');
		//alert(panelID);
		var htmlStr = $('#'+panelID).html();
		$('#visible').html(htmlStr);
		return false;								 
	});
	
}


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-11449116-7']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


