// overload jquery's onDomReady
if ( jQuery.browser.mozilla || jQuery.browser.opera ) {
        document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
        document.addEventListener( "DOMContentLoaded", function(){ jQuery.ready(); }, false );
}
jQuery.event.remove( window, "load", jQuery.ready );
jQuery.event.add( window, "load", function(){ jQuery.ready(); } );
jQuery.extend({
        includeStates: {},
        include: function(url, callback, dependency){
                if ( typeof callback != 'function' && ! dependency ) {
                        dependency = callback;
                        callback = null;
                }
                url = url.replace('\n', '');
                jQuery.includeStates[url] = false;
                var script = document.createElement('script');
                script.type = 'text/javascript';
                script.onload = function () {
                        jQuery.includeStates[url] = true;
                        if ( callback )
                                callback.call(script);
                };
                script.onreadystatechange = function () {
                        if ( this.readyState != "complete" && this.readyState != "loaded" ) return;
                        jQuery.includeStates[url] = true;
                        if ( callback )
                                callback.call(script);
                };
                script.src = url;
                if ( dependency ) {
                        if ( dependency.constructor != Array )
                                dependency = [dependency];
                        setTimeout(function(){
                                var valid = true;
                                $.each(dependency, function(k, v){
                                        if (! v() ) {
                                                valid = false;
                                                return false;
                                        }
                                })
                                if ( valid )
                                        document.getElementsByTagName('head')[0].appendChild(script);
                                else
                                        setTimeout(arguments.callee, 10);
                        }, 10);
                }
                else
                        document.getElementsByTagName('head')[0].appendChild(script);
                return function(){
                        return jQuery.includeStates[url];
                }
        },
        readyOld: jQuery.ready,
        ready: function () {
                if (jQuery.isReady) return;
                imReady = true;
                $.each(jQuery.includeStates, function(url, state) {
                        if (! state)
                                return imReady = false;
                });
                if (imReady) {
                        jQuery.readyOld.apply(jQuery, arguments);
                } else {
                        setTimeout(arguments.callee, 10);
                }
        }
});

///// include js files ////////////
$.include('/templates/22mainstreet/js/cufon/FrancophilSans_500-FrancophilSans_700.font.js');
$.include('/templates/22mainstreet/js/jquery.easing.1.3.js');

	 

	

// ========================================= Sliders ===================================================

	

	// Scripts Initials
	if (jQuery("body").length) {
		$.include('/templates/22mainstreet/js/common.js');
	}
