 $(function() {
                $('#tabs').tabs();
				
				
				// THIS SETS UP MENU CORRECTLY
				// IF JS IS NOT ON THEN THIS DOESNT GET APPLIED AND CSS DEFAULTS SHOW EACH MENU UL
				$("#tabs-1, #tabs-2, #tabs-3").addClass("enabled");
				
				// IF THE PAGE IS EQUAL TO BELOW THEN THE LINK GETS THE SELECTED CLASS APPLIED
				$("body.what-is-smart-repair a.link").addClass("current selected");
				$("body.open-days a.link2").addClass("current selected");
				$("body.contact-us a.link3").addClass("current selected");
				
				// IF THE PAGE IS EQUAL TO BELOW THEN THE SUB NAVIGATION IS NOT SHOWN
				$("body.close #navigation-container, body.close #tabs-1, body.close #tabs-2, body.close #tabs-3").addClass("hide");
				
				// IF A LINK IN THE TABS IS CLICKED THEN THE SUBNAVIGATION IS SHOW
				$("#tabs a").click(function(){
           			$("#navigation-container, #tabs-1, #tabs-2, #tabs-3").removeClass("hide");
					$("a.link").removeClass("selected");
					$("a.link2").removeClass("selected");
					
					
           			//$(this).addClass("selected");
       				});
				
				$(".tab1").click(function(){
						$("#tabs-2, #tabs-3 ").addClass("ui-tabs-hide");
						$("#tabs-1").removeClass("ui-tabs-hide").addClass("enabled");
						$("#tabs a").removeClass("selected");
						$(".tab1").addClass("selected");
						
						// WHEN TAB IS CLICKED AND PAGE IS CURRENT THIS APPLIES STYLING TO LINK
						$("body.market-opportunity #tabs #tabs-1 .market-opportunity a").addClass("selected");
						$("body.revenue-opportunity #tabs #tabs-1 .revenue-opportunity a").addClass("selected");
						$("body.franchise-opportunity #tabs #tabs-1 .franchise-opportunity a").addClass("selected");
						$("body.franchise-training #tabs #tabs-1 .franchise-training a").addClass("selected");
						$("body.franchise-package #tabs #tabs-1 .franchise-package a").addClass("selected");
						$("body.franchise-success #tabs #tabs-1 .franchise-success a").addClass("selected");
						});
					
				$(".tab2").click(function(){
						//MAY BE NEEDED NOT SURE YET
						//$("#tabs-1, #tabs-3 ").addClass("ui-tabs-hide");
						//$("#tabs-2").removeClass("ui-tabs-hide").addClass("enabled");				  
						$("#tabs a").removeClass("selected");
						$(".tab2").addClass("selected");
						
						// WHEN TAB IS CLICKED AND PAGE IS CURRENT THIS APPLIES STYLING TO LINK
						$("body.what-we-repair #tabs #tabs-2 .what-we-repair a").addClass("selected");
						$("body.best-option #tabs #tabs-2 .best-option a").addClass("selected");
						$("body.damage-quote #tabs #tabs-2 .damage-quote a").addClass("selected");
						$("body.customer-testimonials #tabs #tabs-2 .customer-testimonials a").addClass("selected");
						$("body.customer-feedback #tabs #tabs-2 .customer-feedback a").addClass("selected");
						
						});
					
				$(".tab3").click(function(){
						$("#tabs a").removeClass("selected");
						$(".tab3").addClass("selected");
						
						// WHEN TAB IS CLICKED AND PAGE IS CURRENT THIS APPLIES STYLING TO LINK
						// WHEN TAB IS CLICKED AND PAGE IS CURRENT THIS APPLIES STYLING TO LINK
						$("body.technician-locator #tabs #tabs-3 .technician-locator label").addClass("selected");
						
						});
					
				// THIS IS FOR THE FIRST SET OF SUB NAVIGATION
				$("body.one #tabs a.tab1").addClass("current selected");
				$("body.market-opportunity #tabs #tabs-1 .market-opportunity a").addClass("selected");
				$("body.revenue-opportunity #tabs #tabs-1 .revenue-opportunity a").addClass("selected");
				$("body.franchise-opportunity #tabs #tabs-1 .franchise-opportunity a").addClass("selected");
				$("body.franchise-training #tabs #tabs-1 .franchise-training a").addClass("selected");
				$("body.franchise-package #tabs #tabs-1 .franchise-package a").addClass("selected");
				$("body.franchise-success #tabs #tabs-1 .franchise-success a").addClass("selected");
				
				// THIS IS FOR THE SECOND SET OF SUB NAVIGATION
				$("body.two #tabs-1, body.two #tabs-3 ").addClass("ui-tabs-hide");
				$("body.what-we-repair #tabs a.tab2, body.two #tabs-2").addClass("current selected enabled").removeClass("ui-tabs-hide");
				$("body.what-we-repair #tabs #tabs-2 .what-we-repair a").addClass("selected");
				
				$("body.best-option #tabs a.tab2, body.two #tabs-2").addClass("current selected enabled").removeClass("ui-tabs-hide");		
				$("body.best-option #tabs #tabs-2 .best-option a").addClass("selected");
				
				$("body.damage-quote #tabs a.tab2, body.two #tabs-2").addClass("current selected enabled").removeClass("ui-tabs-hide");		
				$("body.damage-quote #tabs #tabs-2 .damage-quote a").addClass("selected");
				
				$("body.customer-testimonials #tabs a.tab2, body.two #tabs-2").addClass("current selected enabled").removeClass("ui-tabs-hide");		
				$("body.customer-testimonials #tabs #tabs-2 .customer-testimonials a").addClass("selected");
				
				$("body.customer-feedback #tabs a.tab2, body.two #tabs-2").addClass("current selected enabled").removeClass("ui-tabs-hide");		
				$("body.customer-feedback #tabs #tabs-2 .customer-feedback a").addClass("selected");				

				// THIS IS FOR THE THIRD SET OF SUB NAVIGATION
				$("body.three #tabs-1, body.three #tabs-2 ").addClass("ui-tabs-hide");
				$("body.technician-locator #tabs a.tab3, body.three #tabs-3").addClass("current selected enabled").removeClass("ui-tabs-hide");		
				$("body.technician-locator #tabs #tabs-3 .technician-locator label").addClass("selected");
            });
 
 

 

$(function(){
				// REMOVES AND DEFUALT VALUES FROM INPUT FIELDS IN FORMS

				$('input[type="text"], textarea').focus(function() {
					if (this.value == this.defaultValue){ 
						this.value = '';
					}
					if(this.value != this.defaultValue){
						this.select();
					}
				});
				$('input[type="text"], textarea').blur(function() {
					if ($.trim(this.value) == ''){
						this.value = (this.defaultValue ? this.defaultValue : '');
					}
				});

				//$(".sub-content a").append("<em class='link'></em>");
				
				//$("a").hover(function() {
				//	$(this).find("em.link").animate({opacity: "show", top: "-75"}, "slow");
				//	var hoverText = $(this).attr("title");
				//	$(this).find("em.link").text(hoverText);
				//}, function() {
				//	$(this).find("em.link").animate({opacity: "hide", top: "-85"}, "fast");
				//});


});

// CREATES SLIDER / TOGGLE FOR BUSINESS PACKAGE
$(function(){
$(".show-hide").hide();		   
$("#toggle").click(function () {
      $(".show-hide").toggle("slow");
    });
$(".toggle").click(function(){
		$(this).prev(".show-hide").toggle("slow");
	});
});    





$(function(){
	$('#mcbut').click(function(){
		var email = $('#mcemailaddress').val();
		if (email != ""  && email != "Successfully Subscribed!" && email != "enter your email address") {
			$.ajax({
				type:           "GET",
				url:            "/common/mcsub.php",
				dataType:       "html",
				cache:          false,
				data:           'email=' + email,
				success:        function(html){ 
					$('#mcemailaddress').val(html);
				}
			});
			return false;
		}
	return false;
	});
});