Jelo.load('all', function() {
    function onfocus() {
        if (this.value == this.defaultText) {
            this.value = '';
            Jelo.CSS.removeClass(this, 'default');
        }
    }
    function onblur() {
        if (!this.value.length || this.value == this.defaultText) {
            Jelo.CSS.addClass(this, 'default');
            this.value = this.defaultText;
        }
    }
    function defaultText(input, text) {
        if (input && text) {
            Jelo.CSS.addClass(input, 'default');
            Jelo.on(input, 'focus', onfocus);
            Jelo.on(input, 'blur', onblur);
            input.value = input.defaultText = text;
        }
    }
    Jelo.Anim.setDefaultDuration(0.33);
    Jelo.on($$('#login .submit'), 'click', function() {
        Jelo.Dom.ancestor('form', this).submit();
    });
	
	
    //Jelo.each($$('#body-advertisers .popout li'), function(item, index) {
      //  Jelo.on(this, 'mouseover', function() {
       //     var popout = $('#popout'),
         //       html = [
           //         '<h1>Audience Profiling and Targeting</h1><p>Unique audiences delivered with ease. Market your products on a one-to-one basis. Simply select the target audience you want to reach. Entourage Advertising will help you define your audience step-by-step—creating a clear and concise demographic profile to enable you to execute your ad campaign using a wide array of targeting capabilities: audience-targeted, geographic-targeted, venue-targeted, narrowcasting, and keyword-targeted features create impactful campaigns that drive results. Brand-centered, audience-driven, creatively sound digital communication is back in the hands of advertisers. Sophisticated objective-based media plans created in minutes. Media planning has never been easier and more efficient.</p>',
             //       '<h1>Campaign Management</h1><em>Digital Media Buying Made Easy</em><p>Users simply log-in to their account to view and modify campaigns. Entourage Advertising\'s campaign Manager allows you to customize your media plan according to how you want to drive it. Research your target market, plan your segmentation strategy, build your campaign, and execute a media buy.</p><ul><li>Launch, pause, or stop existing campaigns</li><li>Simultaneously launch multiple campaigns</li><li>Test various promotions in different markets</li><li>Optimize targeting efficiency by modifying channels</li></ul><p>Advertisers can execute their campaigns in a variety of ways: per thousand impressions (CPM), quantity of screens, or number of spots. You can execute your media buy for a channel of screens in a specific geographic region, by zip code, a particular network, or by unique screen or venue. Just target your audience, create your campaign, set your budget, and launch. Sophisticated solution-based advertising made simple by Entourage.</p>',
               //     '<h1>Seamless Delivery</h1><p>D.A.T\'s proprietary patented technologies can transform a single advertisement (Digital Asset) and distribute it to any one or a combination of Digital Destinations with zero human touch. Digital assets no longer need to be reformatted and reinserted to launch campaigns in different regions or networks. Entourage Advertising has the ultimate digital distribution vehicle at its disposal. We can take your digital asset and essentially break up a single pixel into a million parts, rebuild it, and redistribute it at the blink of an eye. We are the only cross-platform media distribution company in the world that can push out any digital asset, to any screen, at anytime, anywhere in the world that has a digital destination screen.</p>',
                 //   '<h1>Measurement and Optimization</h1><p>Real-time reporting allows you to see the immediate results of your campaign as soon as you launch it. Our advanced enterprise technology ensures that every campaign that goes to flight doesn\'t miss a single spot. That\'s because every spot is accounted for and measured within your campaign, utilizing the same cutting-edge technology that guarantees your media buy quality impressions. This measurement tool is unmatched in the industry. Your campaign deserves the best metrics-driven analysis to measure your ROI. Our technology will deliver accurate reporting so you can immediately modify your campaign to further optimize your results.</p>',
                   // '<h1>Superior Technology</h1><p>Entourage Advertising\'s innovative technology is powered by D.A.T.\'s global IT enterprise solutions technology. With advanced technology powered by a robust Global Digital Media Distribution Infrastructure that spans 22 countries and 55 distribution points of presence, leveraging Tier 1 connectivity and data centers, the Entourage Media Network brings premium, patented content delivery capabilities to multiple digital platforms.</p><p>Advanced content management systems include global digital media asset classification and storage, publishing workflow and campaign management, integrated demographic data analysis for research and planning, and direct environmental feeds for dynamic and targeted advertising. Key intellectual property includes a turnkey solution for real-time cross-platform content generation and distribution for all advertisers across all participating networks.</p><p>Imagine a world in which your clients\' creative content is seamlessly distributed across a wide variety of digital channels without having to convert and retransmit files. At touch of a button, campaigns are demographically and geographically delivered across the globe with precision. It simply makes sense to execute campaigns that exceed marketing objectives with the lowest possible investment. The key is a seamless solution enabling advertisers to better understand their audience, resulting in highly targeted messaging, improved ROI, a dramatic increase in brand awareness, and an overall increase in strategic marketing efficiency and advertising intelligence.</p>'];
           // popout.innerHTML = '<img src="/ea/img/popout-top.png">' + html[index] +
          //      '<img src="/ea/img/popout-bottom.png">';
         //   Jelo.css(popout, ['opacity', 'display'], ['0.9', 'block']);
       // });
    //});
	
	
    Jelo.on($$('#body-advertisers .popout li'), 'mouseout', function() {
        Jelo.css($('#popout'), 'display', 'none');
    });
    Jelo.each($$('.partner-logos'), function(group) {
        var logos = $$('li', group),
            index = 0;
        Jelo.css(logos.slice(3), ['height', 'opacity'], ['0px', '0']);
        setTimeout(function() {
            if (Jelo.css(Jelo.Dom.ancestor('div', group), 'display') == 'none') {
                setTimeout(arguments.callee, 5000);
                return;
            }
            Jelo.each(logos.slice(index, index + 3), function(item, index) {
                setTimeout(function() {
                    Jelo.Anim.ate({
                        me       : item,
                        css      : 'top: -30px; height: 0px; opacity: 0',
                        duration : 1,
                        easing   : 'strongout'
                    });
                }, index * 100);
            });
            index = index + 3;
            if (index >= logos.length) {
                index = 0;
            }
            Jelo.each(logos.slice(index, index + 3), function(item, index) {
                setTimeout(function() {
                    Jelo.Anim.ate({
                        me       : item,
                        css      : 'top: 0px; height: 130px; opacity: 1',
                        duration : 1,
                        easing   : 'strongboth'
                    });
                }, index * 100);
            });
            setTimeout(arguments.callee, 5000);
        }, 5000);
    });
    if ($('.dse')) {
    	var dseLink = $$('.dse a')[1];
    	dseLink.origColor = Jelo.css(dseLink, 'color');
    	Jelo.on(dseLink, 'mouseover', function() {
    		Jelo.css(this, 'color', '#fff');
    	});
    	Jelo.on(dseLink, 'mouseout', function() {
    		Jelo.css(this, 'color', dseLink.origColor);
    	});
    }
    if ($('#newsletter')) {
        defaultText($('#newsletter [name=fname]'), 'First Name');
        defaultText($('#newsletter [name=lname]'), 'Last Name');
        defaultText($('#newsletter [name=email]'), 'Email Address');
    }
    Jelo.on($$('.player img'), 'click', function() {
        Jelo.css(this, 'display', 'none');
        Jelo.css($('object', this.parentNode), 'display', 'block');
    });
});
function onVideoComplete() {
    setTimeout(function() {
    	var players = $$('.player object');
        if (Jelo.css(players[0], 'display') == 'block') {
            Jelo.css(players[0], 'display', 'none');
            Jelo.css(players[1], 'display', 'block');
        } else {
            Jelo.css(players[1], 'display', 'none');
            Jelo.css($('.player img'), 'display', 'block');
        }
    }, 250);
}



