﻿function openVideo() {
    var popup = '<iframe width="600" height="450" src="https://www.youtube.com/embed/zrwcIJ3baBA?rel=0&autoplay=1" frameborder="0" allowfullscreen="true"></iframe>';
    new StickyWin.Modal({
        content: popup,
        maskOptions: { style: { 'background-color':'#333', 'opacity':.6 }},
        destroyOnClose: true
    });
}
function openVideo2() {
    var popup = '<iframe width="600" height="450" src="https://www.youtube.com/embed/mtZK8KuotEY?rel=0&autoplay=1" frameborder="0" allowfullscreen="true"></iframe>';
    new StickyWin.Modal({
        content: popup,
        maskOptions: { style: { 'background-color':'#333', 'opacity':.6 }},
        destroyOnClose: true
    });
}
function resizeContentArea() {
    var master = document.id('master');
    var footer = document.id('bottom');
    if (master && footer) {
        master.setStyle('height', Math.max(700, window.getSize().y - footer.getSize().y));
    }
}

function initNewsScroller() {
    var container = document.id('news-scroller');
    new Request({ url: '/news.txt', method: 'get', onSuccess: function(result) {
        result.split('\n').each(function(line) {
            if (line.trim().length > 0)
                new Element('div', { 'class': 'news-item' }).set('html', line.trim()).inject(container);
        });
        new Mooquee({ 'element': 'news-scroller', 'cssitem': 'news-item', 'pause': 5 });
    }}).send();
}

window.addEvent('load', function() { resizeContentArea(); });
window.addEvent('resize', function() { resizeContentArea(); });


