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

//Javascripts
$(document).ready(function(){ 
  $.favicon('http://cdn.myld.com.au/2/661/gillen-plumbing_e17829f55c.png','http://cdn.myld.com.au/2/661/gillen-plumbing_f9dc6fa366.ico');
	
	menu.contactDetails({
		phone: '889524485', 
					//optional, can have multiple values['0752212345', ['Head Office', '0752212345']]
		mobile: '418890431', 
					//optional, can have multiple values['0452212345', ['Tom', '0452212345']]
		email: 'gillenplumbing@bigpond.com', 
					//optional, can have multiple values['email@gmail.com', ['Support', 'support@yahoo.com']]
		address: 'Shed 3, Shirley Court, Alice Springs, NT 0870', 
					//optional, can have multiple values['Robina, QLD', ['Southport', 'Southport, QLD']]
		 hours: [ 
					['Mon-Fri', '7:30am - 4:30pm']
			] 
			//optional 
	});
	
	//slider
	jQuery('.camera_wrap').camera({
		random: true,
		height: '600px',
		loader: 'none',
		minHeight: '600px',
		navigation: false,
		playPause: false
	});
     
});

$(window).load(function(){
	mapcanvas();
});

//form validation
$('#custom_form').formValidation({ 
  validateText: ["name", "message", "number"],
  validateEmail: ["email"],
  validateSpam: true,
	captchaTheme: 'default'
}); 

//map
function mapcanvas() {
  var myLatlng = new google.maps.LatLng(-23.69304, 133.86322);
  var image = 'http://cdn.myld.com.au/2/661/gillen-plumbing_a55e5959ec.png';
  var mapOptions = {
    zoom: 13,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  
  if ($('#map-canvas').length > 0) {
      var map = new google.maps.Map(document.getElementById('map-canvas'), 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);
	  });   
	}
}

//view section 1
$('#view_section_1').insertAfter('#slider');

//error div
$('#error').insertAfter('#slider');

//justify nav
$('.navbar .nav').addClass('nav-justified');