/**********
sIFR Config
**********/

var corky = { src: 'http://www.eazydublin.com/assets/swf/corky.swf' };

// Now you can set some configuration settings.
// See also <http://wiki.novemberborn.net/sifr3/JavaScript+Configuration>.
// One setting you probably want to use is `sIFR.useStyleCheck`. Before you do that,
// read <http://wiki.novemberborn.net/sifr3/DetectingCSSLoad>.

// sIFR.useStyleCheck = true;
sIFR.wmode = 'opaque';

// Next, activate sIFR:
sIFR.activate(corky);

sIFR.replace(corky, {
  selector: 'h2',
  css: '.sIFR-root { color: #e43d37; font-size: 40px; }',
  wmode: 'transparent',
  sWmode: 'transparent'
});

sIFR.replace(corky, {
  selector: '#content h3',
  css: [
  		'.sIFR-root { color: #e43d37; font-size: 30px; }',
  		'a {color: #e43d37; text-decoration: none; }',
  		'a:hover {color: #e43d37; text-decoration: underline; }'
  	   ],
  wmode: 'transparent',
  sWmode: 'transparent'
});

$(document).ready(function () {
	var selectLabel = $('#languages label').text();
	$('#languages ul li a').hover(
		function () {
        	$('#languages label').text($(this).attr('title')); 
      	}, 
      	function () {
        	$('#languages label').text(selectLabel);
      	}
	);
	
	$('#cal-prev').live('click', function()
	{
		$.ajax({
			url: 		'/'+$('#page').attr('class')+'/ajax/calendar'+this.getAttribute('title'),
			dataType: 	'html',
			cache: 		false,
			success: 	function(html){
				$('#diary-dates').empty().append(html);
			}		
		});
		return false;
	});
	
	$('#cal-next').live('click', function()
	{
		$.ajax({
			url: 		'/'+$('#page').attr('class')+'/ajax/calendar'+this.getAttribute('title'),
			dataType: 	'html',
			success: 	function(html){
				$('#diary-dates').empty().append(html);
			}		
		});
		return false;
	});
	
	$("a.event").live("mouseover", function(){
   		$(this).qtip({
   			show: { ready: true },
   			content: $(this).attr('rel'), 
   			style: { name: 'cream', tip: true },
		   	position: {
		      corner: {
		         target: 'leftTop',
		         tooltip: 'bottomLeft'
		      }
		   }
   		});
	});
	
	$('a.gallery').lightBox();
	
	// EXTERNAL LINKS
	$('A[rel="external"]').click(function()
	{
		window.open($(this).attr('href'));
		return false;
	});
	
});