//<![CDATA[
// Home page methods
// By Nuova Comunicação on 20100101
// contact: ti[at]nuova.com.br/ +55 11 5575-3845

var _main           = {
    init          : function() {
        this.before();
    },
    before        : function() {
        //libraries.libraryName.init  = true;
       //_loader.core();
    },
    after         : function() {
        firstBox.init();
		    ambHome.init(); // slideShowTeaser.init();
    }
};


/*First box destaque */
var firstBox  = {

    init    : function() {
        if (this.check())  this.core();
    },

    def     : {
        container    : '.box-highlights-news'
    },

    check   : function() {
        return (_exists(firstBox.def.container)) ? true : false;
    },

    core: function() {

        $(firstBox.def.container).first().addClass('first');

    }
};

/*slideShowTeaser teaser home top */
var slideShowTeaser  = {

    init    : function() {
        if (this.check())  this.core();
    },

    def     : {
        container    : '#gallery'
    },

    check   : function() {
        return (_exists(slideShowTeaser.def.container)) ? true : false;
    },

    core: function(){

		slideShow();
	}
};

// 2010-mar-23: rmdoi: Inserção de AmbHome Flash
var ambHome= {
    init    : function() {
        if (this.check())  this.core();
    },

    def     : {
        container     : '#ambHomeFlash'
    },

    check   : function() {
        return (_exists(ambHome.def.container)) ? true : false;
    },

    core: function() {
        var swf         = def.project.path.swf + "/ambHome.swf";
        var container   = ambHome.def.container;
        var width       = '700';
        var height      = '190';
        var params      = {
                  wmode : 'transparent',
                  menu              : 'false',
                  allowfullscreen   : 'true',
                  allowscriptaccess : 'sameDomain'
        };
        var attributes  = { };
        var bgcolor  = '#000000' //'';
        var flashvars   = {
            InitVars    : 'listurl=/feed/'
        };
        $(container).flash({
              swf: swf,
              width: width,
              height: height,
              params: params,
              bgcolor: bgcolor,
              flashvars: flashvars
        });
        // swfobject.embedSWF(swf, container, width, height, "9.0.0", bgcolor, flashvars, params, attributes);
    }

};

_main.init();


//]]>