// JavaScript Document - exploiting JQuery	

function showBanner()
{		
		//$("#bannerImage").css({width:1,height:1});
		
		//$("#bannerImage").fadeIn(function(){$(this).animate({width:223,height:78},3500)});
		
		$("#bannerImage").hide();	
		$("#bannerImage").fadeIn(3500);
};


$().ready(function ()
//$(document).ready(function() 
						   {
							   

		

							   
/*		$("#googlePanel").hide();				   
	//if($.browser.msie) { $( function() { alert("Oh no this is Explorer !"); } ); }
	
	var testBoxHeight=$('#testBox').css('height');
	var testBoxWidth=$('#testBox').css('width');
	

$("#mainText").hover(function(){
		$('#googlePanel').fadeIn('slow');
});*/

/*$("#googleAddTower").hide();				   
$("#container").hover(function(){
		$('#googleAddTower').fadeIn('slow');
});*/



/*$("#step1").hide();
$("#step1Click").toggle(function(){
		$('#step1').fadeIn('slow');
		$('#step1Click').text('Step 1');
},function(){		$('#step1').fadeOut('fast');
					$('#step1Click').text('Step 1 - Things to Consider');

});

$("#step2").hide();
$("#step2Click").toggle(function(){
		$('#step2').fadeIn('slow');
		$('#step2Click').text('Step 2');

},function(){		$('#step2').fadeOut('fast');
					$('#step2Click').text('Step 2 - Before you start the Car');

});
$("#step3").hide();
$("#step3Click").toggle(function(){
		$('#step3').fadeIn('slow');
		$('#step3Click').text('Step 3');
},function(){		$('#step3').fadeOut('fast');
					$('#step3Click').text('Step 3 - Starting The Car');

});

$("#step4").hide();
$("#step4Click").toggle(function(){
		$('#step4').fadeIn('slow');
		$('#step4Click').text('Step 4');
},function(){		$('#step4').fadeOut('fast');
					$('#step4Click').text('Step 4 - The Test Drive');

});

$("#step5").hide();
$("#step5Click").toggle(function(){
		$('#step5').fadeIn('slow');
		
},function(){		$('#step5').fadeOut('fast');
					

});
*/
$('#videoLayer').hide();
$("#youtTubeAdvert").hover(function(){
		$('#videoLayer').fadeIn('slow');
});

$('#videoLayer').hide();
$("#youtTubeAdvert").hover(function(){
		$('#videoLayer').fadeIn('slow');
});


$('#enlargeText').bind('click',(function(){		//	function to enlarge or reduce text
		 if(!$('#mainText').is('.largeText')){
		  $('#mainText').addClass('largeText');
		  $('#titleText').addClass('largeText');
		  $('#enlargeText').text('Reduce Text');
		 }else
		 {
		  $('#mainText').removeClass('largeText'); 
		  $('#titleText').removeClass('largeText'); 
  		  $('#enlargeText').text('Enlarge Text');

		 }
	 }));
	

	$('#enlargeText').hover(function(){					// swaps out the style sheet on button
				$(this).removeClass('buttonDefault');
		   		$(this).addClass('buttonHover');},function(){
					$(this).removeClass('buttonHover');
					$(this).addClass('buttonDefault');
	});
	
	$('.standardImage').toggle(function(){
									   
									 $(this).css({width:'90%',height:'auto'});
									  },function()
									  {
										  $(this).css({width:"auto"});
									  });
	

$('.photoImage').css({width:"40%", height:"auto",float:"left"});
	$('.photoImage').toggle(function(){					// swaps out the style sheet on button
				$(this).animate({width:"95%", height:"auto"},1500);
	}
,function(){
				$(this).animate({width:"40%", height:"auto"},1000);
	});
	

    $(".button").hover(function(e){
		$(".button");
        $("img",this).stop()
            .animate({top:"-12px"}, 200).animate({top:"-5px"}, 200)
			// first jump 
            .animate({top:"-10px"}, 150).animate({top:"-5px"}, 200)
            // second jump
            .animate({top:"-7px"}, 100).animate({top:"-5px"}, 100)
            // the last jump
            .animate({top:"-6px"}, 100).animate({top:"-5px"}, 100);
    });
	
	
	//$("#bareBones").css({width:"50%"});
	$("#bareBones").toggle(function(){$(this).animate({width:"715px"},1000)},
		function(){$(this).animate({width:"50%"},500)	});

	$('.problemText').hide(); 
						 
//	$('.linkStyle').toggle(function(){
//						  var testing=$(this).parent().parent();
//						  $('.solution',testing).show();
//						  },function(){
//						  var testing=$(this).parent().parent();
//						  $('.solution',testing).hide();
//					 });						 
	$('.problem H3').click(function(){
						  var testing=$(this).parent();

						$('.problemText').slideUp('slow');			 
						$('.problemText',testing).slideDown('slow');
						  },function(){
						  var testing=$(this).parent();
						  $('.problemText',testing).hide();
					 });						 

	$("#container #mainMenu ul li ul").hide();
	$("#container #mainMenu ul li").hover(function(){
				  $("ul",this).show();
				  
				  },function(){
				  $("ul",this).hide();
					  });
	
	  //  $('p').find(":contains('Mk IV')").css({"font-style":"italic", "font-weight":"bolder"});


	
});
