var newsSlider = new Class({
    Implements: [Options, Events],

    initialize: function() {
        this.current_page = 1;
        this.pager_items = $$('#news-pager .main_news_pager_item');
        this.pages_count = this.pager_items.length
        this.slider = new Fx.Tween('news-container',{duration:'long'});

        this.initEvents();
    },

    initEvents : function(){
        this.pager_items.addEvent('click',this.slideToPage.bind(this));
    },

    slideImagesContainer : function(num) {
        this.pager_items.removeClass('active');
        this.pager_items[num-1].addClass('active');
        var ml = (num-1)*(-1)*(812);
        this.slider.start('margin-left',ml);
        this.current_page = parseInt(num);
    },

    slideToPage: function(evt){
        var num = evt.target.get('id').split('-').pop();
        this.slideImagesContainer(num);
    }
});

window.addEvent('load',function(){

        window.ns = new newsSlider();

        swfobject.embedSWF(
            '/flash/player.swf',
            'main-videoplayer',
            '787',
            412,
            '9.0.0',
            '/flash/expressInstall.swf',
            {
                'file':			$('main-videoplayer').get('title'),
                'type':			'video',
                'icons':		true,
                backcolor: '444444',
                frontcolor: 'cccccc',
                lightcolor: 'f8fb01',
                'volume':		'60',
                'skin':			'/flash/default.swf',
                'bufferlength':	'5',
                'autostart': true
            },
            {
                'allowScriptAccess':	'always',
                'allowFullScreen':		'true',
                'scale':				'noscale',
                'salign':				'tl',
                'bgcolor':				'#030303',
                'wmode':                'opaque'
            },
            {
                'id':					'main-videoplayer',
                'name':					'main-videoplayer',
                'align':				'middle'
            }
        );

        
    
});