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

//Javascripts
$(document).ready(function(){ 
  $.favicon('http://cdn.myld.com.au/2/1642/mudgeeraba-landscape-centre_52fb7a519d.png');
	
	menu.contactDetails({
		
		phone: '0755302359', //optional, can have multiple values[array] 
		mobile: null, //optional, can have multiple values[array]
		email: 'mscapes@hotmail.com.au', //optional, can have multiple values[array] 
		address: 'Corner of Boomerang and Springbrook Road Mudgeeraba, QLD 4213', //optional, single value
		hours: [['Mon to Fri','7:00am-5:00pm'],['saturday','7:00am-3:00pm'],['Sunday','8:00am-3:00pm']] //optional
		
	});
    
    
    // View section_1
    $('#view_section_1').insertBefore('.footer');

    // View error div
    $('#error').insertBefore('.footer');
    
    $('.navbar .nav > li').clone().appendTo('#synopsis .nav');
    
    $('.match').matchHeight();
    
    
    // Map
    function map() {
      var myLatlng = new google.maps.LatLng(-28.10410, 153.32320);
      var image = 'http://cdn.myld.com.au/2/1642/mudgeeraba-landscape-centre_3c26987313.png';
      var mapOptions = {
        scrollwheel: false,
        zoom: 13,
        center: myLatlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      }

      if ($('#map').length > 0) {
          var map = new google.maps.Map(document.getElementById('map'), mapOptions);

          var marker = new google.maps.Marker({
              position: myLatlng,
              map: map,
              icon: image
          });

          google.maps.event.addDomListener(window, 'resize', function() {
                map.setCenter(myLatlng);
          });         
          google.maps.event.addDomListener(window, 'orientationchange', function() {
                map.setCenter(myLatlng);
          });   
        }
    }
    $(window).load(function(){
        map();
    });  
    
    
    // Gallery
    if(Modernizr.touch && $(".fancybox").length > 0 )
    {
       var myPhotoSwipe = $(".fancybox").photoSwipe({ enableMouseWheel: false , enableKeyboard: false });
    }
    else
    {
    /* Apply to single image */
        $("a.fancybox").fancybox();

    /* Apply fancybox to multiple items */
        $("a.fancybox[rel='gallery_group']").fancybox({
            'transitionIn'    :    'elastic',
            'transitionOut'    :    'elastic',
            'speedIn'        :    600,
            'speedOut'        :    200
        });

    }
    
    
$('.multiple-items').slick({
  arrows: false,
  dots: true,
  centerMode: false,
  centerPadding: '60px',
  slidesToShow: 3,
  responsive: [
    {
      breakpoint: 768,
      settings: {
        arrows: false,
        centerMode: true,
        centerPadding: '40px',
        slidesToShow: 3
      }
    },
    {
      breakpoint: 480,
      settings: {
        arrows: false,
        centerMode: true,
        centerPadding: '40px',
        slidesToShow: 2
      }
    }
  ]
});
      
    
    
    // CONTACT
    if ( $("body#contact-us").is("*") ) {

        // Contact Form
        $('#contact_form').smartCaptcha({
            validateText: ["name","phone","message"],
            validateEmail: ["email"],
            redirectLink: null,
            validateStyle: "default"
        });

        // Remove Slider
        $('#slider').remove();

        // Insert Map
        $('#map').insertAfter('#header');
        
    } else {
        
    }
    
    
     
}); 
