//Enable cufon font replacement
Cufon.replace('#content h1, #title small, #content h2, #content h3, #slideTabs h3, #content h4, #content blockquote');

//SET NOCONFLICT TO WORK WITH OTHER LIBRARIES
jQuery.noConflict();

//CUSTOM JQUERY FUNCTIONS
jQuery(document).ready(function(){
	
	jQuery('#content a').filter(function() {
		return this.hostname && this.hostname !== location.hostname;
	}).addClass('externalLink');
	
	jQuery('ul li:even').addClass('even');
	
	jQuery('ul li.here, ul li.parent_here').removeClass('even');
	
	jQuery('dl dd:first-child').addClass('first');
	jQuery('dl dd:last-child').addClass('last');
});


function homeShowcase(){
	
	//Loop function
	var showcaseLoop = setInterval(showcaseRotate,9000);	

}

var showcaseItems = ['atm', 'contractors', 'telephonetest', 'fleetmanagers'], i = 0;

function showcaseRotate(){

	// Get currentId
	var currentId = showcaseItems[++i] || showcaseItems[i=0];

	//Check if current browser is IE6
	if(typeof document.body.style.maxHeight === "undefined") {
	
		//Fade out previous banner
		jQuery('#slides div.slide').hide();
	
		//Fade in new banner
		jQuery('#slides #slide_' + currentId).show();
				
	} else {
	
		//Fade out previous banner
		jQuery('#slides div.slide').fadeOut('fast');
	
		//Fade in new banner
		jQuery('#slides #slide_' + currentId).fadeIn('fast');
	
	}

}

jQuery.fn.clearForm = function() {
	return this.each(function() {
		var type = this.type, tag = this.tagName.toLowerCase();
		if (tag == 'form')
			return jQuery(':input',this).clearForm();
		if (type == 'text' || type == 'password' || tag == 'textarea')
			this.value = '';
		else if (type == 'checkbox' || type == 'radio')
			this.checked = false;
		else if (tag == 'select')
			this.selectedIndex = -1;
	});
};


