	$(document).ready(function(){
		
		$('.gallery').addClass('gallery_demo'); // adds new class name to maintain degradability
		
		$('ul.gallery_demo').galleria({
			history   : true, // activates the history object for bookmarking, back-button etc.
			clickNext : true, // helper for making the image clickable
			insert    : '#main_image', // the containing selector for our main image
			onImage   : function(image,caption,thumb) { // let's add some image effects for demonstration purposes
				
				// fade in the image & caption
				image.css('display','none').fadeIn(1000);
				caption.css('display','none').fadeIn(1000);
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// fade out inactive thumbnail
				_li.siblings().children('img.selected').fadeTo(500,0.4);
				
				// fade in active thumbnail
				thumb.fadeTo('fast',1).addClass('selected');
				
				// add a title for the clickable image
				image.attr('title','Next');
			},
			onThumb : function(thumb) { // thumbnail effects goes here
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// if thumbnail is active, fade all the way.
				var _fadeTo = _li.is('.active') ? '1' : '0.4';
				
				// fade in the thumbnail when finnished loading
				thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500);
				
				// hover effects
				thumb.hover(
					function() { thumb.fadeTo('fast',1); },
					function() { _li.not('.active').children('img').fadeTo('fast',0.4); } // don't fade out if the parent is active
				)
			}
		});
	});$(document).ready(function(){
// GD BAR SHOWCASE
$('<div class="activeIcon"><!-- --></div>').insertBefore("a#activeGal");
$("a#sc1, a#sc2, a#sc3, a#sc4, a#sc5, a#sc6").animate({ opacity : 0.55 }, 0);
$(".activeIcon").animate({ opacity : 0.3 }, 1000);

//OLD SAFARI & FIREFOX SUPPORT
$("a#sc1, a#sc2, a#sc3, a#sc4, a#sc5, a#sc6").mouseover(function(){
      $("<div class='showcaseIcon'><!-- --></div>").insertBefore(this);
	  $(".showcaseIcon").animate({ opacity : 0 }, 0);
	  $(".showcaseIcon").animate({ left : "-16px", opacity : 0.75 }, 250);
	  $(this).animate({ opacity : 1 }, 250);
	 
    }).mouseout(function(){
      $(".showcaseIcon").animate({ left : "-40px", opacity : 0 }, 500, function() { $(this).remove(); });
	  $(this).animate({ opacity : 0.55 }, 250);
    });
});

// NO EMAIL SPAM
var tld_ = new Array()
	tld_[040] = "com";
	tld_[1] = "org";
	tld_[2] = "net";
	tld_[041] = "ca";
	tld_[4] = "info";
	tld_[10] = "co.uk";
	tld_[11] = "org.uk";
	tld_[12] = "gov.uk";
	tld_[13] = "ac.uk";
	var topDom_ = 13;
	var m_ = "mailto:";
	var a_ = "@";
	var d_ = ".";
	
	function mail(name, dom, tl, params)
	{
		var s = e(name,dom,tl);
		document.write('<a class="gdorange" href="'+m_+s+params+'">'+s+'</a>');
	}
	function mail2(name, dom, tl, params, display)
	{
		document.write('<a class="gdorange" href="'+m_+e(name,dom,tl)+params+'"><h5>'+display+'</h5></a>');
	}
	function e(name, dom, tl)
	{
		var s = name+a_;
		if (tl!=-2)
		{
			s+= dom;
			if (tl>=0)
				s+= d_+tld_[tl];
		}
		else
			s+= swapper(dom);
		return s;
	}
	function swapper(d)
	{
		var s = "";
		for (var i=0; i<d.length; i+=2) 
			if (i+1==d.length)
				s+= d.charAt(i)
			else
				s+= d.charAt(i+1)+d.charAt(i);
		return s.replace(/\?/g,'.');
	}