//<![CDATA[

var _loader         = {
    init          : function() {
        this.core();
    },
    core          : function() {
        var i;

        for (i in libraries) {
            if (libraries[i].init && libraries[i].before) {
                this.array.before.push(libraries[i].url);
            } else if( libraries[i].init && !libraries[i].before) {
                this.array.after.push(libraries[i].url);
            }

            libraries[i].init    = false;
        }

        this.require(this.array.before);
        this.array.before = new Array();
    },
    array         : {
        before    : [],
        after     : []
    },
    require       : function(libs) {
        var i     = 0;
        var limit = libs.length;
        var html  = ''

        for (i; i < limit; i++) {
            html  += '<script src="' + libs[i] + '" type="text/javascript"></script>';
        }

        document.write(html);
    },
    after         : function() {
        _loader.require(_loader.array.after);
        this.array.after         = new Array();
    }

};


var def             = {
    project         : {
        name        : 'claro-curtas',
        path        : '/',
        pathJs      : '/_js/',
        pathSwf     : '/_swf/',
        pathFlv     : '/_flv/',
        pathJson    : '/_json/',
        pathImg     : '/_img/'
    }
};


var libraries       = {

    core            : {
        init        : true,
        before      : false,
        url         : def.project.pathJs + 'global/_core.js'
    },

    jQuery          : {
        init        : true,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery-1.3.2.min.js'
    },
    
    jQfield         : {
        init        : false,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.field.min.js'
    },
    
    jQprint         : {
        init        : true,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.PrintArea.min.js'
    },

	jQmenu          : {
        init        : true,
        before      : false,
        url         : def.project.pathJs + 'lib/superfish.min.js'
    },

    jQswfObject     : {
        init        : false,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.swfobject.1-0-5.min.js'
    },

    jQueryQuery     : {
        init        : false,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.query.min.js'
    },

    jQjcarousel     : {
        init        : false,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.carousel.min.js'
    },

    jQModal         : {
        init        : true,
        before      : false,
        url         : def.project.pathJs + 'lib/jqmodal.min.js'
    },

    jQvalidate      : {
        init        : true,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.validate.min.js'
    },

    jQmask          : {
        init        : false,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.maskedinput-1.1.4.pack.js'
    },

    jCharcounter    : {
        init        : false,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.charcounter.min.js'
    },

    jQform          : {
        init        : true,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.form.min.js'
    },

    jQscrollTo      : {
        init        : true,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.scrollto.min.js'
    },
    
    jQflickrGallery : {
        init        : false,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.flickrGallery.js'
    },    

    comVT           : {
        init        : false,
        before      : false,
        url         : def.project.pathJs + 'com/com.video.tutorial.js'
    },
	
    fileStyle       : {
        init        : false,
        before      : false,
        url         : def.project.pathJs + 'lib/jquery.filestyle.mini.js'
    },
	
    gAnalytics      : {
        init        : true,
        before      : false,
        url         : 'https:' == document.location.protocol ? 'https://ssl.google-analytics.com/ga.js' : 'http://www.google-analytics.com/ga.js',
		code        : 'UA-2039129-17',
        domain      : '.clarocurtas.com.br'
    }

};


_loader.init();


//]]>