/* ------------------------------------------------- */
/* On document ready
/* ------------------------------------------------- */
$(document).ready(function($) {
	if($('.scrollable .item').length > 1) $('.scrollable').scrollable({circular: true}).autoscroll({ autoplay: true });
	// Init colorbox
	$('a.colorbox').colorbox();
	// Init form validation
	$('form').validate();
});

/* ------------------------------------------------- */
/* Default IE Fixes for 6/7/8
/* Fixes for last/first child
/* ...
/* ------------------------------------------------- */
var defaultIEFixes = {
	
	init: function() {
		ie = this;
		// First determine if we have IE
		if($.browser.msie && ($.browser.version < 9)) {
			// Last/first-child hack
			// Add elements to your discretion
			ie.firstLastChildHack('#main-menu ul li');
			// Here comes the following hack
		}
	},
	
	firstLastChildHack: function(el) {
		$(el).first().addClass('first-child');
		$(el).last().addClass('last-child');
	}
}

/* ------------------------------------------------- */
/* Commen log functions avoids pesky alerts in FF
/* if FireBug isn't enabled!
/* http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
/* ------------------------------------------------- */
window.log = function(){
	log.history = log.history || [];   // store logs to an array for reference
	log.history.push(arguments);
	if(this.console) { console.log(Array.prototype.slice.call(arguments)); }
};
