jQuery.noConflict();
jQuery(document).ready(function() {

	jQuery('.lavalamp').lavaLamp({ fx: 'backout', speed: 700 });
	jQuery('.lavalampV').lavaLampV({ fx: 'easeOutElastic', speed: 700 });

	// Detect if we are on main nav bar when page loads and hide the nav arrow initially if we aren't
	var where = jQuery('body').attr('id');
	if (where != 'home' && where != 'design' && where != 'testimonials' && where != 'clients' && where != 'contact') {
		jQuery('#nav li.back').hide();
		jQuery('#nav').bind('mouseleave', function(){ jQuery('#nav li.back').hide().stop(); }); //If we are on a sub-nav page, hide arrow on mouseleave of nav.
	}
	//Same goes for sub-nav if we are on main nav page.
	else if (where!='custom'&&where!='modular'&&where!='modular2'&&where!='portable'&&where!='portable2'&&where!='rentals'&&where!='public_area') {
		jQuery('#sub-nav li.backLava').hide();
		jQuery('#sub-nav').bind('mouseleave', function(){ jQuery('#sub-nav li.backLava').hide().stop(); });	
	}
 	if (where=='portable2' || where=='portable3' || where == 'portable4') {
//		jQuery('.lavalampV').lavaLampV({ startItem: 3 });
		jQuery('.backLava').css({'top':'88px'});
//		jQuery('li.page-item-122').addClass('selectedLava');
//		jQuery('#sub-nav li.selectedLava').removeClass('selectedLava');
//		jQuery('#sub-nav').bind('mouseleave', function(){ jQuery('.backLava').css({'top':'88px'}); });
//		jQuery('li.page-item-122').addClass('home');
	}
	
	if (where=='modular2') {
		jQuery('.backLava').css({'top':'44px'});
	}

	jQuery('body#rentals .post a').fancybox();
	jQuery('body#design .post a').fancybox();
	jQuery('body#public_area .post a').fancybox();
	jQuery('body#custom .post a').fancybox();

	jQuery('#home').ready(function(){
		var counter = 0;		
		jQuery(document).everyTime(2000, function(){
			switch (counter) {
				case 0:
				case 1:
				case 2:
				case 3:
				case 4:
				case 5:
				case 6:
					jQuery('#taglines li:hidden:first').fadeIn('slow');
					break;
				case 7:
					jQuery('#taglines li').fadeOut();
					//jQuery('#logo1').animate({left:'0'},{queue:false,duration:300});
					break;
/*
				case 8:
					jQuery('#logo2').animate({bottom:'0'},{queue:false,duration:300});
					break;
				case 9:
					jQuery('#logo3').animate({top:'100px'},{queue:false,duration:300});
					break;
				case 10:
					jQuery('#logo4').animate({right:'0'},{queue:false,duration:300});
					break;
				case 11:
					jQuery('#logo5').animate({right:'0'},{queue:false,duration:300});
					break;
				case 12:
					jQuery('#logo6').animate({right:'219px'},{queue:false,duration:300});
					break;
				case 13:
					jQuery('#logo1').animate({left:'-165px'},{queue:false,duration:300});
					jQuery('#logo2').animate({bottom:'-80px'},{queue:false,duration:300});
					jQuery('#logo3').animate({top:'-80px'},{queue:false,duration:300});
					jQuery('#logo4').animate({right:'-165px'},{queue:false,duration:300});
					jQuery('#logo5').animate({right:'465px'},{queue:false,duration:300});
					jQuery('#logo6').animate({right:'-165px'},{queue:false,duration:300});
					break;
*/
				default:
			}
		
//			if (counter == 13) {
			if (counter == 7) {
				counter = 0;
			} else { counter = counter + 1; }

		});
	});
	
	jQuery('body#contact div.wpcf7-response-output').appendTo('#right-box');

});