/*
	Site:		Traditional Catering Specialists
	File:		/assets/scripts/global.js
	Author:		Andrew Disley, Simplified http://simplified.co.uk/
	Version:	2010-01-07
	Plugin:		Simplest jQuery Slideshow Plugin - http://github.com/mathiasbynens/Simplest-jQuery-Slideshow
----------------------------------------------- */
var $j=jQuery;var isIE=false;var isIE6=false;var isSafari=false;(function(a){a.fn.slideshow=function(c){var b={timeout:3000,speed:400};if(c){a.extend(b,c)}this.each(function(){var d=a(this);d.children().eq(0).appendTo(d).show();setInterval(function(){d.children().eq(0).hide().appendTo(d).fadeIn(b.speed)},b.timeout)});return this}})(jQuery);var SGlobal={jEOBody:null,utilBrowserTests:function(){if($j.browser.msie){isIE=true}if(typeof document.body.style.maxHeight=="undefined"){isIE6=true;try{document.execCommand("BackgroundImageCache",false,true)}catch(a){}}if($j.browser.safari){isSafari=true;$j("div#Container").addClass("safari")}},init:function(){var a=this;a.jEOBody=$j("body");a.jEOBody.addClass("jQ");a.utilBrowserTests()}};var SComponents={jEOFeatured:null,jEOCTA:null,jEOGallery:null,jEOGalleryCTA:null,jEOGalleryImages:null,cCTA:function(){var a=this;$j("div.c-b",a.jEOCTA).hover(function(){$j(this).addClass("c-b-hover")},function(){$j(this).removeClass("c-b-hover")})},cGallery:function(){var b=this;var a=$j('<div class="c-overlay" id="Overlay"><a class="prev">prev</a><a class="next">next</a><div class="info"></div><img alt="Loading large images" class="progress" src="assets/images/global/loading.gif"></div>');SGlobal.jEOBody.append(a);b.jEOGalleryCTA.mousedown(function(){$j(b.jEOGalleryImages[0]).click()});$j(b.jEOGalleryImages).overlay({oneInstance:true,target:"#Overlay",top:"25%"}).gallery({autohide:false,speed:400,template:"<span>Image ${index} of ${total}</span>"})},init:function(){var a=this;a.jEOFeatured=$j("div#jsFeatured");a.jEOCTA=$j("#Content div.c-cta");a.jEOGallery=$j("#Content div.c-gallery");a.jEOGalleryCTA=$j("img#jsGalleryCTA");a.jEOGalleryImages=$j("a",a.jEOGallery);if(a.jEOCTA.length&&isIE){a.cCTA()}if(a.jEOGallery.length){a.cGallery()}$j("div.c-b",a.jEOFeatured).slideshow({timeout:3000,speed:1000});$j("span.image",a.jEOCTA).slideshow({timeout:6000,speed:1000})}};$j(function(){SGlobal.init();SComponents.init()});