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

//Javascripts
$(document).ready(function(){ 
  $.favicon('http://cdn.myld.com.au/2/1449/lound-s-fresh-seafoods_d66b74bbc2.png');
	
	menu.contactDetails({
		
		phone: '0747746388', //optional, can have multiple values[array] 
		mobile: null, //optional, can have multiple values[array]
		email: 'sales@loundsfreshseafoods.com.au', //optional, can have multiple values[array] 
		address: '20 Camuglia Street, Garbutt QLD, 4814', //optional, single value
		hours: [['Mon to Fri','8:30am-5:30pm'],['Saturday','8:30am-2:30pm']] //optional
		
	});
  
    // View section_1
    $('#view_section_1').insertBefore('.footer');

    // View error div
    $('#error').insertBefore('.footer'); 
    
    
    // header bg slider
    $("#header .bg").backstretch([
      "http://cdn.myld.com.au/2/1492/web_lound-s-fresh-seafoods_376765eee0.png",
      "http://cdn.myld.com.au/2/1492/web_lound-s-fresh-seafoods_3115539f0a.png",
      "http://cdn.myld.com.au/2/1492/web_lound-s-fresh-seafoods_53d4f521d4.png",
      "http://cdn.myld.com.au/2/1492/web_lound-s-fresh-seafoods_7ec41540bb.png"  
    ], {duration: 3000, fade: 750, random: true});   
    
    /*
    $(window).bind("load resize",function(){
        var width = $(window).width();
        if (width > 991) {
            $('#services-wrap').insertAfter('#masthead-carousel');
        } else {
            $('#services-wrap').insertBefore('#intro-wrap');
        }
    });*/    
    
    
    // contact
    if ( $("body#contact-us").is("*") ) {

        // Contact Form
        $('#contact_form').smartCaptcha({
            validateText: ["name","phone","message"],
            validateEmail: ["email"],
            redirectLink: null,
            validateStyle: "default"
        });

        // Insert Map
        function map() {
          var myLatlng = new google.maps.LatLng(-19.27030, 146.75144);
          var image = 'http://cdn.myld.com.au/2/1449/lound-s-fresh-seafoods_8251556866.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();
        });        
        
        
    }    
    
    
     
}); 
