// fade and nav controls for js web services on home page.. all $ changed to jQuery for no conflict.

// create own rules for noscript and set divs to be hidden using css (remember print too) if js is enabled.
jQuery(document).ready(function(){
document.body.className += ' js-enabled';
});


// tab nav and index content top boxes.. web design etc.
jQuery(document).ready(function(){
	jQuery('ul.tabNav a').click(function() {
		var curChildIndex = jQuery(this).parent().prevAll().length + 1;
		/// rh. should see if "this" is actually the current one.. bit crap that current one can also be clicked and fades away and then back again...
		//// in ie the text is fuzzy until the fade in has completed..looks shit, prob why mutant uses carousel.. all loaded, fades away, moves, then fades in..??.. put colour behind text.. helps.
		jQuery(this).parent().parent().children('.current').removeClass('current');
		jQuery(this).parent().addClass('current');
		jQuery(this).parent().parent().prev('.tabContainer').children('.current').fadeOut(200,function() { // fast, normal.instead of num
			jQuery(this).removeClass('current');/// change next to prev. if swap order of nav and container.
			
			//jQuery(this).parent().children('div:nth-child('+curChildIndex+')').fadeIn('normal',function() {
			jQuery(this).parent().children('div:nth-child('+curChildIndex+')').fadeIn(200,function() {
				jQuery(this).addClass('current');
			});
		});
		return false;
	});
}); 

// not sure why needed..? text render issue??
function removeFilter() {
  jQuery('p.quote').removeAttr("filter");
}

// show/hide services
jQuery(document).ready(function() {
	jQuery('div.services').addClass('hide');
	jQuery('.services-hide').addClass('hide');

	jQuery('.services-show').click(function() {
		/// could do the code below for instant show, without fade
		//jQuery(this).parent().parent().children('div.services').removeClass('hide');
		
		jQuery(this).parent().parent().children('div.services').fadeIn('fast',function() { // set speed of function.
			///jQuery('div.services').removeClass('hide'); // weve gone up parents and into a child div so only need (this)
			jQuery(this).removeClass('hide');
		});
		
		jQuery(this).addClass('hide');
		jQuery(this).parent().children('.services-hide').removeClass('hide');
		return false;
	});
		
	jQuery('.services-hide').click(function() {
		jQuery(this).parent().parent().children('div.services').fadeOut('fast',function() { // set speed of function.
			///jQuery('div.services').removeClass('hide'); // weve gone up parents and into a child div so only need (this)
			jQuery(this).addClass('hide');
		});
		
		/*jQuery('div.services').fadeOut('fast',function() {
			jQuery('div.services').addClass('hide');
		});*/
		jQuery(this).addClass('hide');
		jQuery(this).parent().children('.services-show').removeClass('hide');
		return false;
	});
	
});
// end show/hide services

/*
jQuery(document).ready(function() {
jQuery('div.services').hide();

	jQuery('.services-show').click(function() {
	jQuery('div.services').show('slow');
	return false;
	});
	
});
*/

