/***********************
*  Site Specific JS   *
************************/

$(document).ready(function(){
    

    menu.contactDetails({

        phone: '(07) 4053 7773', //optional, can have multiple values[array]
        email: 'stitchmasterupholstery@hotmail.com', //optional, can have multiple values[array]
        address: '9 MacNamara Street, Manunda Qld 4870', //optional, single value
        hours: [['Mon - Fri','8am - 5pm']] //optional

    }); 
    
    $('h1, h2, h3, h4, h5 , h6').attr('itemprop','name');
    $('p').attr('itemprop','description');
    $('.container').attr('itemtype','http://schema.org/LocalBusiness');
    $('.container-fluid').attr('itemtype','http://schema.org/LocalBusiness');
    $('img').attr('itemprop','image');

    //Contact Page
    if ( $("body#contact").is("*") ) {
      
    }
    
    //VIEW SECTION 1
    $('#view_section_1').insertAfter('#header');
    //$('#view_section_1').append('#content-container');

    //VIEW ERROR DIV
    $('#error').insertAfter('#view_section_1');
    //$('#error').append('#content-container');

  // Contact Form
  $('#contact_form').smartCaptcha({ 
      validateText: ["name", "phone"],
      validateEmail: ["email"],
      validateChar: [{ id: "message", max: null }]
  });

});

    $(document).ready(function(){
		var furniture = $('.furniture');
		var cars = $('.cars');
		var boats = $('.boats');
		var allbtn = $('#all');
		var furniturebtn = $('#furniture');
		var carsbtn = $('#cars');
		var boatsbtn = $('#boats');

		allbtn.on('click',function(){
			furniture.fadeIn('slow');
			cars.fadeIn('slow');
			boats.fadeIn('slow');
		});
		furniturebtn.on('click',function(){
			furniture.fadeIn('slow');
			cars.fadeOut('slow');
			boats.fadeOut('slow');
		});
		carsbtn.on('click',function(){
			furniture.fadeOut('slow');
			cars.fadeIn('slow');
			boats.fadeOut('slow');
		});
		boatsbtn.on('click',function(){
			furniture.fadeOut('slow');
			cars.fadeOut('slow');
			boats.fadeIn('slow');
		});
	});
  
  $(window).load(function() {
  $("body").addClass("loaded");
});

$(document).ready(function(){
  // Add smooth scrolling to all links on home page
  $(".backtotop h3 a").on('click', function(event) {

   // Make sure this.hash has a value before overriding default behavior
  if (this.hash !== "") {

    // Prevent default anchor click behavior
    event.preventDefault();

    // Store hash
    var hash = this.hash;

    // Using jQuery's animate() method to add smooth page scroll
    // The optional number (900) specifies the number of milliseconds it takes to scroll to the specified area
    $('html, body').animate({
      scrollTop: $(hash).offset().top
    }, 900, function(){

      // Add hash (#) to URL when done scrolling (default click behavior)
      window.location.hash = hash;
      });
    } // End if
  });
});

$(document).ready(function(){
  var hash = "#"+window.location.href.split("#")[1];
  $('.nav-stacked>li.active').removeClass("active");
  $('.tab-content>.active').removeClass("active");
  $('li > a[href="'+hash+'"]').parent().addClass("active");
  $(hash).addClass("active in");
  $('html, body').animate({scrollTop: $(hash).offset().top}, 900, function(){window.location.hash = hash;});
});
