/**
 * AzteQ : Global JS
 * @version 1.0
 * @requires jQuery 1.6+ - http://www.jquery.com/
*/
/*jslint bitwise: true, eqeqeq: true, passfail: false, nomen: false, plusplus: false, undef: true, laxbreak: true */
/*global window, document, $, jQuery, self */

/**
* @namespace Root namespace for holding all objects created for AzteQ.
*/
var AZT = window.AZT || {};

AZT.carousel = (function() {
	return {
        init: function() {
            // initialise homepage carousel
    		$('#carousel ul').cycle({
				fx: 'fade', 
				speed: 1500, 
				timeout: 6000
			});
		}
	};
}());

AZT.dropdowns = (function() {
	return { 
		init: function() {
			$("#topnav ul").superfish({
				autoArrows: false,
				dropShadows: false
			});
			
			$("#topnav li.has-children").children("a").on("click", function() { 
				return false; // prevent top-level links from going to pages
			});
			
			$("#breadcrumbs ul li:nth-child(2)").not(".last").on("click", function() { 
				return false; 
			});
		}
	};
}());

/*
 * DOM READY AND LOAD EVENTS
 */
$(document).ready(function () {
	AZT.carousel.init();
	AZT.dropdowns.init();
});

