/*
	Site:		Nichols & Lea
	File:		/assets/scripts/global.js
	Author:		Andrew Disley, Simplified http://simplified.co.uk/ for Nichols & Lea
	Copyright:	2009 Andrew Disley, Simplified http://simplified.co.uk/ / Nichols & Lea
	Version:	2009-09-15
----------------------------------------------- */

/*	Global Configuration
----------------------------------------------- */
var $j = jQuery;
var isIE6 = false;
var isSafari = false;

/*	Global Literal Object: Site-wide functions
----------------------------------------------- */
var Global = {

	/* Utility: Browser Tests / Specific Fixes/Hooks */
	utilBrowserTests : function() {

		/* Detect if User Agent is IE6 using object detection, apply fix for background flicker bug */
		if (typeof document.body.style.maxHeight == 'undefined') { isIE6 = true; try { document.execCommand('BackgroundImageCache', false, true); } catch(e) { } }

		/* Detect if User Agent is Safari, add class '.safari' to div#Container */
		if ($j.browser.safari) { isSafari = true; $j('div#Container').addClass('safari'); }

	},

	init : function() {

		var cc = this;

		cc.utilBrowserTests();

	}

};

/*	Component: #Services
----------------------------------------------- */
var CServices = {

	init : function() {

		$j('#Services ul').tabs('#Services > section', {current: 'active'}).history();

	}

};


/*	DOM Ready events
----------------------------------------------- */
$j(function() {

	Global.init();

	if ($j('#Services').length) {
		CServices.init();
	}

});

