
    var indexadengineui = Math.round( Math.random() * 10000000 );
    var same = indexadengineui;
    var adshost = 'rehs';

    var scrolltimer = 0;

    var homelink_path = null;

    function getHomeLinkPath()
    {
        if( !homelink_path )
        {
            homelink_path = $('homelink').href
        }
        return homelink_path;
    }
    function scroll( p, o, dir )
    {
        document.getElementById( o ).style.top =  Math.max( -document.getElementById( o ).scrollHeight + document.getElementById( p ).clientHeight, Math.min( ( parseInt( document.getElementById( o ).style.top ) + ( 2 * dir ) ), 0 ) ) + 'px';
        what = ( dir > 0 ? 'scrollUp( \'' + p + '\', \'' + o + '\' )' : 'scrollDown( \'' + p + '\', \'' + o + '\' )' );
        scrolltimer = setTimeout( what, 10 );
        return false;
    }

    function scrollUp( p, o ) { return scroll( p, o, 1 ); }
    function scrollDown( p, o ) { return scroll( p, o, -1 ); }

    function clearScroll() { window.clearTimeout( scrolltimer ); }


    function fix( a ) { a.href = a.href.replace( /NEMSPA_M./g, "" ); return true; }

    function stat( a, b )
    {
        if ( b ) { window.status = a.href.replace( /NEMSPA_M./g, "" ); }
        else { window.status = ""; }
    }

    function Is()
    {
        //browser leválogatás
        agent = navigator.userAgent.toLowerCase();
        this.agent = navigator.userAgent.toLowerCase();
        this.major = parseInt(navigator.appVersion);
        this.minor = parseFloat(navigator.appVersion);
        this.ns = ( ( agent.indexOf( 'mozilla' ) != -1 ) && ( ( agent.indexOf( 'spoofer' ) == -1 ) && ( agent.indexOf( 'compatible' ) == -1 ) ) );
        this.ns4 = ( this.ns && ( this.major <= 4 ) && ( this.minor < 5 ) );
        this.ns6 = ( this.ns && ( this.major >= 5 ) );
        this.opera = ( agent.indexOf( 'opera' ) != -1 );
        this.opera6 = ( this.major >= 6 );
        this.ie = ( agent.indexOf( "msie" ) != -1 );
        this.ie4 = ( this.ie && ( this.major == 4 ) && ( agent.indexOf( "msie 5.0" ) == -1 ) );
        this.ie5 = ( this.ie && ( this.major == 4 ) && ( agent.indexOf( "msie 5" ) != -1 ) );
        this.ie6 = ( this.ie && ( this.major == 4 ) && ( agent.indexOf( "msie 6" ) != -1 ) );
        this.ie7 = ( this.ie && ( this.major == 4 ) && ( agent.indexOf( "msie 7" ) != -1 ) );
        this.iframe = ( this.ie || this.ns6 || this.opera6 );
        this.popup = ( this.ie || this.ns6 || this.opera6 );
        this.layer = ( this.ie || this.ns6 );
    }

    var is = new Is();

    function getCookie(NameOfCookie)
    {
        if (document.cookie.length > 0)
        {
            begin = document.cookie.indexOf( NameOfCookie + "=" );
            if (begin != -1)
            {
                begin += NameOfCookie.length + 1;
                end = document.cookie.indexOf( ";", begin);
                if ( end == -1 ) { end = document.cookie.length; }
                return document.cookie.substring( begin, end );
            } else { return null; }
        }
    }

    function setCookie( NameOfCookie, expiredays )
    {
        var value = getCookie( NameOfCookie );
        if (!value) { value = 0;}
        if ( parseInt(value) <= maxMegjelenes )
        {
            value = parseInt( value ) + 1;
            var ExpireDate = new Date ();
            ExpireDate.setTime( ExpireDate.getTime() + ( expiredays * 24 * 3600 * 1000 ) );
            document.cookie = NameOfCookie + "=" + escape( value ) + ";path=/" + ( ( expiredays == null ) ? "" : "; expires=" + ExpireDate.toGMTString() );
        }
        return value;
    }

    function incCookie( NameOfCookie, expirehours )
    {
        var ExpireDate = new Date ();
        var value = getCookie( NameOfCookie );
        if (!value) { value = 1; } else { value = parseInt( value ) + 1; }
        ExpireDate.setTime( ExpireDate.getTime() + ( expirehours * 3600 * 1000 ) );
        document.cookie = NameOfCookie + "=" + escape( value ) + ( ( expirehours == null ) ? "" : "; expires=" + ExpireDate.toGMTString() );
        return value;
    }

    function createCookie(name,value,days) {
            if (days) {
                var date = new Date();
                date.setTime(date.getTime()+(days*24*60*60*1000));
                var expires = "; expires="+date.toGMTString();
            }
            else var expires = "";
            document.cookie = name+"="+value+expires+"; path=/";
        }

        function readCookie(name) {
            var nameEQ = name + "=";
            var ca = document.cookie.split(';');
            for(var i=0;i < ca.length;i++) {
                var c = ca[i];
                while (c.charAt(0)==' ') c = c.substring(1,c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
            }
            return null;
        }

        function eraseCookie(name) {
            createCookie(name,"",-1);
        }

    function teszt_banner( ade_lc, bhely_id, width, height, margin_top, margin_bottom, co )
    {
        if ( co == undefined ) { co = 1; }
        if ( is.iframe )
        {
            rnd = "uniq" + Math.round( Math.random() * 10000000 );
            document.write( '<div style="margin-top: ' + margin_top + 'px; margin-bottom: ' + margin_bottom + 'px;" id="' + rnd + '">' );
            document.write( '<iframe name="indexadengineframe' + same + '" src="http://sher3.index.hu/ad?lc=' + ade_lc + '&amp;ui=' + indexadengineui + '&amp;co=' + co + '&amp;cn=1&amp;do=' + document.domain + '&amp;ho=' + width + '&amp;ve=' + height + '" width="' + width + '" vspace="0" hspace="0" marginheight="0" marginwidth="0" height="' + height + '" frameborder="0" scrolling="no"></iframe>' );
            document.write( '<scr'+'ipt type="text/javascript">cont = document.getElementById( "' + rnd + '" ).parentNode.parentNode; if ( cont.id == "microsite" ) { cont.style.width = "' + width + 'px"; cont.style.marginLeft = "' + ( 220 - width / 2 ) + 'px"; }</scr'+'ipt>' );
            document.write( '</div>' );
        } else {
            document.write( '<div style="margin-top: ' + margin_top + 'px; margin-bottom: ' + margin_bottom + 'px;">' );
            document.write( '<a target="_top" href="http://sher3.index.hu/rd?lc=' + ade_lc + '&ui=' + indexadengineui + '"><img src="http://sher3.index.hu/ad?lc=' + ade_lc + '&amp;ui=' + indexadengineui + '" border="0" height="' + height + '" width="' + width + '"></a>' );
            document.write( '</div>' );
        }
    }


    function eu_open( nick )
    {
        var num = Math.round( Math.random() * 100000000000 );
        window.open( 'http://index.hu/res/eu/lexikon/list_out.php?ff=look&amp;key=' + nick, 'gyaloglo' + num, 'resizable=no,status=no,width=530,height=400,top=10,left=10,scrollbars=yes' );
    }

    function gallery( o )
    {
        window.open( o.href + '&currpic=' + o.childNodes[0].src, 'IndexKepek', 'scrollbars=no,resizable=no,menu=no,width=610,height=560' );
        return false;
    }

    function flashbanner( ade_lc, id, width, height, ver )
    {
        if ( getFlashVersion() >= ver )
        {
            document.getElementById( id ).innerHTML = '';
            banner( ade_lc, 0, width, height, 0, 0 );
        }
    }

    function getFlashVersion()
    {
        var flashversion = 0;
        if ( navigator.plugins && navigator.mimeTypes.length )
        {
            var x = navigator.plugins["Shockwave Flash"];
            if( x && x.description )
            {
                var y = x.description;
                flashversion = y.charAt( y.indexOf( '.' ) - 1 );
            }
        }
        else
        {
            result = false;
            for( var i = 15; ( ( i >= 3 ) && ( result != true ) ); i-- )
            {
                   execScript('on error resume next: result = IsObject( CreateObject( "ShockwaveFlash.ShockwaveFlash.' + i + '" ) )', 'VBScript' );
                   flashversion = i;
            }
        }
        return flashversion;
    }

    function onLayerFinishedPlaying( swf_id ) { document.getElementById( swf_id   + '_container' ).style.display = 'none'; }
    function openwindow( click_url ) { window.open( click_url ); }
    function real_DoCommand( command, id, click_url )
    {
        switch ( command )
        {
            case 'hide' : document.getElementById( id + '_container' ).style.visibility = 'hidden'; break;
            case 'click' : openwindow( click_url ); break;
        }
    }

    function display_layer( layers )
    {
        var shown = 0;
        for( i = 0; i < layers.length; i++ )
        {
            layer = layers[ i ]; swf_url = layer[0]; click_url = layer[1]; swf_width = layer[2]; swf_height = layer[3]; swf_length = layer[4]; swf_top = layer[5]; swf_left = layer[6]; swf_zindex = layer[7]; swf_id = layer[8]; maxmegj = layer[9]; expirehours = layer[10]; required_flash_version = layer[11]; transparent = layer[12]; custom = layer[13];
            if ( !shown )
            {
                if ( expirehours == undefined ) { expirehours = 24; }
                if ( maxmegj == undefined ) { maxmegj = 1; }
                if ( ( is.layer && ( !transparent || is.ie ) ) && ( incCookie( swf_id, expirehours ) <= maxmegj ) )
                {
                    if ( !isNaN( swf_url ) && !custom ) { swf_url = 'http://' + adshost + '.' + document.domain + '/get?ad=' + swf_url + '&dl=1&dt=swf&di=1'; }
                    if ( !isNaN( click_url ) ) { click_url = 'http://' + adshost + '.' + document.domain + '/rd?ad=' + click_url; }
                    if ( required_flash_version == undefined ) { required_flash_version = 5; }
                    if ( getFlashVersion() >= required_flash_version )
                    {
                        document.write( '<div id="' + swf_id + '_container" style="position: absolute; left: ' + swf_left + 'px; top:' + swf_top + 'px; z-index: ' + swf_zindex + '">' );
                        if ( custom )
                        {
                            document.write( '<script type="text/javascript" src="' + 'http://' + adshost + '.' + document.domain + '/get?ad=' + swf_url + '&dl=1&dt=co&di=1' + '"></script>');
                        }
                        else
                        {
                            jel = ( ( swf_url.indexOf( '?' ) != -1 ) ? '&' : '?' );
                            document.write( '<script type="text/javascript">function ' + swf_id + '_DoCommand( command, args ) { real_DoCommand( command, "' + swf_id + '", "' + click_url + '" ); }</script>');
                            document.write( '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" width="' + swf_width + '" height="' + swf_height + '" id="' + swf_id + '">' );
                            document.write( '<param name="movie" value="' + swf_url + jel + 'clickTag=' + escape( click_url ) + '" />' );
                            document.write( '<param name="quality" value="autohigh" />' );
                            document.write( '<param name="wmode" value="transparent" />' );
                            document.write( '<param name="swLiveConnect" value="true" />' );
                            document.write( '<embed swLiveConnect="true" src="' + swf_url + jel + 'clickTag=' + escape( click_url ) + '" quality="autohigh" width="' + swf_width + '" height="' + swf_height + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" name="' + swf_id + '">' );
                            document.write( '</embed>' );
                            document.write( '</object>');
                        }
                        document.write( '</div>');
                        setTimeout( "onLayerFinishedPlaying( '" + swf_id + "' )", swf_length * 1000 );
                        shown = 1;
                    }
                }
            }
        }
    }

    function popup( popname, lc, maxmegj, expirehours )
    {
        if ( expirehours == undefined ) { expirehours = 24; }
        if ( ( is.popup ) && ( incCookie( popname, expirehours ) <= maxmegj ) )
        {
            document.write('<iframe name="indexadengineframe" src="http://' + adshost + '.index.hu/ad?lc=' + lc + '&amp;ui=' + indexadengineui + '&amp;co=1" width="1" vspace="0" hspace="0" marginheight="0" marginwidth="0" height="1" frameborder="0" scrolling="no"></iframe>');
        }
    }

    function popunder( popname, lc, maxmegj, expirehours )
    {
        if ( expirehours == undefined ) { expirehours = 24; }
        if ( ( is.popup ) && ( incCookie( popname, expirehours ) <= maxmegj ) )
        {
            if (!window.name) { window.name = "pupuplaunchwindow"; }
            windowname = window.name;
            document.write('<iframe name="indexadengineframe" src="http://' + adshost + '.index.hu/ad?lc=' + lc + '&amp;ui=' + indexadengineui + '&amp;co=1" width="1" vspace="0" hspace="0" marginheight="0" marginwidth="0" height="1" frameborder="0" scrolling="no"></iframe>');
            setTimeout( "focus( windowname )", 800 );
        }
    }

    function layer( layername, lc, maxmegj, expirehours )
    {
        if ( expirehours == undefined ) { expirehours = 24; }
        if ( ( is.layer ) && ( incCookie( layername, expirehours ) <= maxmegj ) )
        {
            document.write( '<scr' + 'ipt type="text/javascript" src="http://' + adshost + '.index.hu/get?lc=' + lc + '&dl=1&dt=co"></scr' + 'ipt>' );
        }
    }

    function gyaloglo_open( nick )
    {
        var num = Math.round( Math.random() * 100000000000 );
        window.open( 'http://index.hu/x?gyal=http%3A//chat.gyaloglo.hu/php/gochat_cgyh.php%3Fusername=' + nick, 'gyaloglo'+num, 'resizable=no,status=no,width=602,height=560,top=10,left=10,scrollbars=no' );
        return false;
    }

    var theTop = 255;
    var sticky;
// bookline trackelohoz url
    var scarab_item_id = document.location.href.replace( /:\d+/, '' );
    if( scarab_item_id.indexOf( '.hu/x' ) != -1 ) scarab_item_id = unescape( scarab_item_id.split( 'url=http%3A%2F%2F' )[ 1 ] );
    scarab_item_id = scarab_item_id.split( '?' )[ 0 ].split( '#' )[ 0 ].replace( document.location.protocol + '//', '' );
    if( scarab_item_id.indexOf( document.domain ) != -1 ) scarab_item_id = scarab_item_id.substr( scarab_item_id.indexOf( document.domain ) ).replace( /~\w+\//, '' );
//

    function trigger_share( gatype, gaevent, ctid ) {
        var url = document.location.href.split( '#' )[ 0 ].split( '?' )[ 0 ];
        _gaq.push( ['_trackSocial', gatype, gaevent, url ] );
        jQuery.ajax( {
            url: 'http://' + document.domain + '/x.php',
            data: {
                url: url,
                id: ctid
            },
            success: function() {}
        } )
    }

    function plusone( button ) {
        trigger_share( 'plusone', button.state == 'on' ? 'share' : 'unshare', button.state == 'on' ? 'plusone' : 'minusone' );
    }

    windowonload = function(e)
    {

    if( jQuery( '#kereso_24ora' ).length )
    {
        autoComplete.bind( 'szerzo' );
        autoComplete.bind( 'cimkek' );
    }
        if( document.location.href.indexOf( '/kockahas/' ) != -1 ) {
            var idhash = document.location.href.split( '#' )[ 1 ];
            if( typeof idhash != "undefined" ) {
                if( jQuery( 'body' ).hasClass( 'rovat' ) ) {
                    jQuery( 'a' ).each( function() {
                        var anchor = jQuery( this );
                        if( anchor.attr( 'name' ) == idhash ) anchor.next().find( '.menociki_numbers' ).show();
                    } );
                }
                else jQuery( '.menociki_numbers' ).show();
            }
        }
//ertekeles futoszalaghoz

        jQuery( '.ertekeles_cont' ).map( function() {
            jQuery( this ).find( 'td' ).each( function() {
                jQuery( this ).mouseenter( function() {
                    var ertek = this.id.match( /\d+/g )[ 0 ],
                        id = jQuery( this ).parents( '.ertekeles_cont' ).attr( 'id' ).match( /\d+/g )[ 0 ];
                    for( var i = 1; i <= 10; i++ ) { jQuery( '#ertek' + i + '_' + id ).animate( { opacity: ( ertek >= i ) * 1 }, 20 ); }
                } );
            } );
            jQuery( this ).find( '.ert_szavazas' ).mouseleave( function() {
                var id = jQuery( this ).parents( '.ertekeles_cont' ).attr( 'id' ).match( /\d+/g )[ 0 ];
                for( var i = 1; i <= 10; i++ ) { jQuery( '#ertek'+ i + '_' + id ).animate( { opacity: 0 }, 500 ); }
                jQuery( this ).prev().fadeIn( 500 );
            } ).mouseenter( function() {
                jQuery( this ).prev().fadeOut( 20 );
            } );
        } );

// mac-en mashova kell pozicionalni a hatteret a felso FB like button mellett,
// hogy ugyan ott legyen, mint ahova a likeolasok szamat rendereli majd
        if( navigator.userAgent.indexOf( 'Mac' ) != -1 ) {
            jQuery( '.fb_iframe_widget iframe' ).each( function() {
                jQuery( this ).css( 'background-position', ( jQuery( this ).parents( 'li.recommend' ).length ? '94' : '69' ) + 'px 1px' );
            } );
        }
//
//share buttonok
        jQuery( '.sharing .share' ).each( function() {
            jQuery( this ).click( function( e ) {
                e.preventDefault();
                jQuery( this ).parents( '.sharing' ).first().next().fadeToggle();
            } );
        } );
        jQuery( '.sharing .close' ).each( function() {
            jQuery( this ).click( function( e ) {
                e.preventDefault();
                jQuery( this ).parents( '.sharing' ).first().prev().find( '.share' ).click();
            } );
        } );
        if( jQuery( '#sendthis_link_share' ).length ) new Control.Modal( jQuery( '#sendthis_link_share' )[ 0 ], { overlayCloseOnClick: false } );
        if( jQuery( '#sendthis_bottom_link_share' ).length ) new Control.Modal( jQuery( '#sendthis_bottom_link_share' )[ 0 ], { overlayCloseOnClick: false } );
        if( typeof FB != "undefined" ) {
            FB.Event.subscribe( 'edge.create', function( r ) {
                trigger_share( 'facebook', 'like', 'fblike' );
            } );
            FB.Event.subscribe( 'edge.remove', function( r ) {
                trigger_share( 'facebook', 'unlike', 'fbunlike' );
            } );
        }
        if( typeof twttr != "undefined" ) twttr.events.bind( 'tweet', function( event ) { trigger_share( 'twitter', 'tweet', 'tweet' ); } );
//
// bookline trackelo
        if( typeof Scarab != "undefined" ) {
            Scarab.view( scarab_item_id );
            Scarab.setMerchantId('16536C8B346C3F58');
            Scarab.go();
        }
//
        PicScroller.init();
        if( jQuery( '.pp_important' ).length )
        {
            var pp_cookie_name = 'pp_' + document.location.pathname.match( /(\w+\/\d{4}\/\d{2}\/\d{2}\/\w+)/gi )[ 0 ].replace( /\//gi, '' );
            var pp_cookie = false; // zart e a fontosabb reszletek doboz
            if( document.cookie.indexOf( pp_cookie_name + '=true' ) != -1 )
            {
                pp_cookie = true;
                jQuery( '.lead' ).find( 'ul' ).hide();
                jQuery( '.pp_important' ).toggleClass( 'closed' );
            }
            jQuery( '.pp_important' ).click( function( e )
            {
                e.preventDefault();
                jQuery( '.lead' ).find( 'ul' ).slideToggle( function()
                {
                    pp_cookie = document.cookie.indexOf( pp_cookie_name + '=true' ) == -1;
                    document.cookie = pp_cookie_name + '=' + ( pp_cookie ).toString() + ';';
                    jQuery( '.pp_important' ).toggleClass( 'closed' );
                } );

            } );
        }
        if( ( document.cookie.toString().indexOf( 'index_mobile=true' ) != -1 ) || ( window.navigator.userAgent.indexOf('Mobile') != -1 ) )
        {
            jQuery( '#miniajanlat' ).append(
                jQuery( '<li></li>' ).append(
                    jQuery( '<span></span>' ).html( ' | ' )
                ).append(
                    jQuery( '<a></a>' ).attr( 'href', document.location.href.split( '?' )[ 0 ].split( '#' )[ 0 ] + '?mobil' ).html( 'Mobil verzió' ).css( 'font-weight', 'bold' )
                )
            );
        }

        showad;
        printify();
        if ( typeof Calendar != 'undefined' )
        {
            IndexCalendarSetup( $('tol'), $('tol_trigger_c') );
            IndexCalendarSetup( $('ig'), $('ig_trigger_c') );
            IndexCalendarSetup( $('datum'), $('datum_trigger_c'), function( cal ) { $('datum').form.submit(); }  );
            IndexCalendarSetup( $('date1'), $('date1_trigger_c') );
            IndexCalendarSetup( $('date'), $('date_trigger_c') );
        }

        if ( $('bessenyei') ) {
            $('bessenyei').style.display = 'block';
            setTimeout("removebp()",12000);
        }
        if( $('idojaras_select') )
        {
            $('idojaras_select').observe( 'change' , function( event ) { idojaras_select( event ) } );
            $('idojaras_select').observe( 'keyup' , function( event ) { idojaras_select( event ) } );
function idojaras_select( event )
{
    if( $( event.target ).value != '' )
    {
        parts = $( event.target ).value.split( '|' );
        href = 'http://velvet.hu/x?ido=/idojaras/' + parts[ 0 ] + '/';
        $( 'idojaras' ).removeClassName( $( 'idojaras' ).className.split( ' ' )[ 1 ] ).addClassName( parts[ 4 ] ).title = parts[ 5 ];
        $( 'idojaras' ).href = href;
        options = $$( '#idojaras_select option' );
        for( i = 0; ln = options.length, i < ln; i++ ) if( options[ i ].value == $( event.target ).value ) $( 'idojaras_varos' ).innerHTML = '<a class="box_link" href="' + href + '">' + options[ i ].innerHTML + '</a> <span class="min">' + parts[ 2 ] + '°C</span> / <span class="max">' + parts[ 3 ] + '°C</span>, most ' + parts[ 1 ] + '°C';
        createCookie( 'selectedcity', parts[ 0 ], 365 );
    }
}
        }
        $$( 'form.idojaras_form' ).each( function( element ) { element.getElements()[ 0 ].observe( 'change', function( event ) { if( this.getValue() != '0' ) document.location.href = 'http://velvet.hu/idojaras/' + this.getValue() + '/'; } ); } );

        if ( $('indabox') ) {
            indalinks = $$('#indabox UL LI>A');
            for(  i = 0; i < indalinks.length; i++ )
            {
                indalinks[i].onmouseover = function() {
                    dobozok = $$('#indabox .szoveg');
                    for(  j = 0; j < indalinks.length; j++ ) { dobozok[j].style.display = ( this.parentNode == dobozok[j].parentNode ? 'block' : 'none' ); }
                    lik = $$('#indabox LI');
                    for(  j = 0; j < lik.length; j++ )
                    {
                        if ( ( this.parentNode == lik[j] ) && !lik[j].hasClassName( 'selected' ) ) { lik[j].addClassName( 'selected' ); }
                        if ( this.parentNode != lik[j] ) { lik[j].removeClassName( 'selected' ); }
                    }
                }
            }
        }
        if ( $('kepekprev') ) {
            $('kepeknext').onclick = function()
            {
                lista = $$('#vizual .kepek UL LI')
                for( i = 0; i < lista.length; i++ ) { if ( lista[i].hasClassName( 'selected' ) ) { j = i; } }
                lista[ j ].removeClassName( 'selected' )
                lista[ ( j < lista.length - 1 ) ? j + 1 : 0 ].addClassName( 'selected' );
                return false;
            }
            $('videoknext').onclick = function()
            {
                lista = $$('#vizual .videok UL LI')
                for( i = 0; i < lista.length; i++ ) { if ( lista[i].hasClassName( 'selected' ) ) { j = i; } }
                lista[ j ].removeClassName( 'selected' )
                lista[ ( j < lista.length - 1 ) ? j + 1 : 0 ].addClassName( 'selected' );
                return false;
            }
            $('kepekprev').onclick = function()
            {
                lista = $$('#vizual .kepek UL LI')
                for( i = 0; i < lista.length; i++ ) { if ( lista[i].hasClassName( 'selected' ) ) { j = i; } }
                lista[ j ].removeClassName( 'selected' )
                lista[ ( j > 0 ) ? j - 1 : lista.length - 1 ].addClassName( 'selected' );
                return false;
            }
            $('videokprev').onclick = function()
            {
                lista = $$('#vizual .videok UL LI')
                for( i = 0; i < lista.length; i++ ) { if ( lista[i].hasClassName( 'selected' ) ) { j = i; } }
                lista[ j ].removeClassName( 'selected' )
                lista[ ( j > 0 ) ? j - 1 : lista.length - 1 ].addClassName( 'selected' );
                return false;
            }
        }
        $$( 'form.vote_monster_form' ).each( function( element )
        {
            Event.observe( element, 'submit', function( event )
            {
                event.stop();
                var selected = null;
                var parameters = 'op=postmini&IS_AJAX_REQUEST=true&method=castvote&noauth=1' + '&mininame=' + element.id.substring( 5 );
                this.getInputs( 'radio', 'option' ).each( function( elem ) { if( elem.getValue() != null ) selected = elem } );
                if( selected != null ) parameters = parameters + '&option=' + selected.value;
                new Ajax.Request( this.action,
                {
                    parameters: parameters,
                    onSuccess: function( data )
                    {
                        var swap_text = '';
                        if( element.hasClassName( 'monster_hidden_form' ) ) swap_text = 'Köszönjük, hogy szavazott!';
                        else swap_text = data.responseText;
                        $( element.id.substring( 5 ) ).innerHTML = data.responseText;
                    }
                } );
            } );
        } );
        if ( $('pager_top') )
        {
            page_init();
            //init_pagerlinks();
            //switch_page();
        }
        if ( $('cikklistak') != null )
        {
        /*
            $('friss').onclick = function()
            {
                if ( !this.hasClassName( 'selected' ) ) {
                    this.addClassName( 'selected' )
                    $('nepszeru').removeClassName( 'selected' );
                    this.next().style.display = 'block';
                    $('nepszeru').next().hide();
                }
                return false;
            }*/
            /* $('nepszeru').onclick = function()
            {
                if ( !this.hasClassName( 'selected' ) ) {
                    this.addClassName( 'selected' )
                    $('friss').removeClassName( 'selected' );
                    this.next().style.display = 'block';
                    $('friss').next().hide();
                }
                return false;
            } */
            $('videok').onclick = function()
            {
                if ( !this.hasClassName( 'selected' ) ) {
                    this.addClassName( 'selected' )
                    $('kepek').removeClassName( 'selected' );
                    this.next().style.display = 'block';
                    $('kepek').next().hide();
                }
                return false;
            }
            $('kepek').onclick = function()
            {
                if ( !this.hasClassName( 'selected' ) ) {
                    this.addClassName( 'selected' )
                    $('videok').removeClassName( 'selected' );
                    this.next().style.display = 'block';
                    $('videok').next().hide();
                }
                return false;
            }
        }
        if ( $('sendthis_link') != null ) {
            if ($('sendthis_link')) new Control.Modal( $('sendthis_link'), { overlayCloseOnClick: false } );
            if ($('sendthis_link_bottom')) new Control.Modal( $('sendthis_link_bottom'), { overlayCloseOnClick: false } );
        }
        $A(document.getElementsByClassName('modal')).each(function(link){
            new Control.Modal( link, { overlayCloseOnClick: true,
                iframe: true,
                iframeTemplate: new Template('<iframe src="#{href}" scrolling="no" width="100%" height="100%" frameborder="0" id="#{id}"></iframe>')
            });
        });

        $A(document.getElementsByClassName('modpopup')).each(
            function(link){
            var mw=600;
            var mh=500;
            if(link.id != undefined){
            s = link.id.split('_');
            if(s[0] != null) mw = s[0];
            if(s[1] != null) mh = s[1];
            }
            new Control.Modal( link, { overlayCloseOnClick: true,
                iframe: true,
                width: mw,
                height: mh,
                iframeTemplate: new Template('<iframe src="#{href}" scrolling="no" width="100%" height="100%" frameborder="0" id="#{id}"></iframe>') } );
        });
        sticky = document.getElementById('sticky');
        if ( sticky != null ) temp = setTimeout('movesticky()', 10);
    }

    function init_pagerlinks()
    {
        linkek = $('cikkpager_pages').getElementsByTagName( 'A' )
        for( i = 0; i < linkek.length; i++ ) { linkek[ i ].href = linkek[ i ].href.replace( '!', '#' ); }
        linkek = $('cikkpager_pages_bottom').getElementsByTagName( 'A' )
        for( i = 0; i < linkek.length; i++ ) { linkek[ i ].href = linkek[ i ].href.replace( '!', '#' ); }
        $('cikkpager_next_anchor').href = $('cikkpager_next_anchor').href.replace( '!', '#' );
        $('cikkpager_prev_anchor').href = $('cikkpager_prev_anchor').href.replace( '!', '#' );
        $('cikkpager_next_anchor_bottom').href = $('cikkpager_next_anchor_bottom').href.replace( '!', '#' );
        $('cikkpager_prev_anchor_bottom').href = $('cikkpager_prev_anchor_bottom').href.replace( '!', '#' );
    }

    function switch_page()
    {
        current = window.location.hash.replace( '#', '' );
    if ( current && $( 'oldal_' + current ) )
        {
            oldalak = $$( '#szoveg .oldal' ).each( function( s ) { s.removeClassName( 'aktiv' ); } );
            $( 'oldal_' + current ).addClassName( 'aktiv' );
            $('kopf').style.display = $( 'oldal_' + current ).hasClassName( 'elso' ) ? 'block' : 'none';
            $('cikkpager_prev').style.display = $( 'oldal_' + current ).hasClassName( 'elso' ) ? 'none' : 'block';
            $('cikkpager_next').style.display = $( 'oldal_' + current ).hasClassName( 'utolso' ) ? 'none' : 'block';
            $('cikkpager_prev_bottom').style.display = $( 'oldal_' + current ).hasClassName( 'elso' ) ? 'none' : 'block';
            $('cikkpager_next_bottom').style.display = $( 'oldal_' + current ).hasClassName( 'utolso' ) ? 'none' : 'block';
            linkek = $('cikkpager_pages').getElementsByTagName( 'A' );
            for( i = 0; i < linkek.length; i++ )
            {
//        linkek[i].removeClassName( 'selected' );
                if ( linkek[i].href == window.location.href )
                {
                    if ( i > 0 ) { $('cikkpager_prev_anchor').href = linkek[ i - 1 ].href; }
                    if ( i < linkek.length - 1 ) { $('cikkpager_next_anchor').href = linkek[ i + 1 ].href; }
//            linkek[i].addClassName( 'selected' );
                }
            }
            linkek = $('cikkpager_pages_bottom').getElementsByTagName( 'A' );
            for( i = 0; i < linkek.length; i++ )
            {
//        linkek[i].removeClassName( 'selected' );
                if ( linkek[i].href == window.location.href )
                {
                    if ( i > 0 ) { $('cikkpager_prev_anchor_bottom').href = linkek[ i - 1 ].href; }
                    if ( i < linkek.length - 1 ) { $('cikkpager_next_anchor_bottom').href = linkek[ i + 1 ].href; }
//            linkek[i].addClassName( 'selected' );
                }
            }
        }
        window.setTimeout( switch_page, 1000 );
    }

    var CURRENT_PAGE = 1;
    var PAGES = 0;
    function page_init()
    {
        PAGES = $$('DIV.oldal').length;
        $$( 'A.onestep.next1' ).each(function(i){ i.onclick = function(){ return page_next(1); }});
        $$( 'A.onestep.prev1' ).each(function(i){ i.onclick = function(){ return page_next(-1); }});
        $$( 'DIV.tobboldalas_cikk DIV.pages A' ).each(function(i){
                if ( $(i).hasClassName('actual') ) { CURRENT_PAGE = parseInt(i.className.split(' ')[0].split('_')[1]); }
                i.onclick = function(){ var cn = $(i).hasClassName('actual') ? i.className.split(' ')[0] : i.className; return page_switch(parseInt(cn.split('_')[1])); }
        });
        if ( window.location.hash && parseInt( window.location.hash.substring(1) ) ) { page_switch( window.location.hash.substring(1) ); }
    }
    function page_switch(page)
    {
        var old = [];
        var t;
        if ( !PAGES ) { PAGES = $$('DIV.oldal').length; }
        page = parseInt(page);
        if ( CURRENT_PAGE ) {
            var t = $('cikk_oldal_' + CURRENT_PAGE);
            if ( t ) { if ( t.hasClassName('aktiv') ) { t.removeClassName('aktiv'); } }
            old = $$('a.oldal_' + CURRENT_PAGE);
        }
        $(old).each( function(i){ $(i).removeClassName('actual') });
        $$('a.oldal_' + page).each( function(i){ $(i).addClassName('actual') });
        t = $('cikk_oldal_' + page);
        if ( t ) {
            CURRENT_PAGE = page;
            if ( !t.hasClassName('aktiv') ) { t.addClassName( 'aktiv' ); }
            $$( 'A.onestep.next1' ).each(function(i){ i.style.visibility = CURRENT_PAGE == PAGES ? 'hidden' : 'visible'; });
            $$( 'A.onestep.prev1' ).each(function(i){ i.style.visibility = CURRENT_PAGE == 1 ? 'hidden' : 'visible'; });
            //window.location.href = '#szoveg';
            window.location.hash = page;
            window.scrollTo(0, $('szoveg').offsetTop);
        }
        return false;
    }

    function page_next(dir)
    {
        dir = parseInt(dir);
        if ( !PAGES ) { PAGES = $$('DIV.oldal').length; }
        var page = CURRENT_PAGE + dir;
        return PAGES >= ( page ) && ( page > 0 ) ? page_switch( page ) : false;
    }

    function printify()
    {
        if ( $('szoveg') )
        {
            try {
            //$('print_orig').checked = false;
            var links = $('pager_top') ? $$( '#szoveg .oldal A' ) : $('szoveg').getElementsByTagName( 'A' );
            if ( links && links.length > 0 ) { cikklinks = '<h3 class="print_linkshead">A cikkben hivatkozott linkek:</h3><ul class="print_hivatkozasok">'; }
            var cikklis = '';
            j = 0;
            if ( links ) for( i = 0; i < links.length; i++ )
            {
                if ( ( links[i].parentNode.nodeName == 'P' || links[i].parentNode.id == 'szoveg' ) && links[i].name != 'more' )
                {
                    links[i].innerHTML = links[i].innerHTML + '<span class="print_anchor"> [' + ( j + 1 ) + ']</span>';
                    cikklis += '<li>[' + ( j + 1 ) + '] ' + links[i].href + '</li>';
                    j++;
                }
            }
            if ( cikklis != '' )
            {
                cikklinks += cikklis + '</ul>';
                var newD = document.createElement( 'DIV' );
                newD.id = 'print_links_container';
                newD.innerHTML = cikklinks;
                var ocikk_bottom = $('cikk_bottom');
                if ( ocikk_bottom ) ocikk_bottom.parentNode.insertBefore( newD, ocikk_bottom );
            }
            var szerzok_linkek = $('szerzo') ? $('szerzo').getElementsByTagName( 'A' ) : new Array();
            for( i = 0; i < szerzok_linkek.length; i++ )
            {
                var re = /\?(.*)/g;
                var href = szerzok_linkek[i].href.replace( 'mailto:', '' ).replace( 'NEMSPA_M', '' ).replace( re, '' );
                szerzok_linkek[i].innerHTML = szerzok[i].innerHTML + '<span class="print_szerzo"> - ' + href + '</span>';
            }
            var kapcsolodo_linkek = $$('#kapcsolodo A');
            if ( kapcsolodo_linkek ) for( i = 0; i < kapcsolodo_linkek.length; i++ )
            {
                var re = /^(.*?)=http/;
                var href = unescape( kapcsolodo_linkek[i].href.replace( re, 'http' ) );
                kapcsolodo_linkek[i].innerHTML = kapcsolodo_linkek[i].innerHTML + '<span class="print_anchor"> - ' + href + '</span>';
            }
        } catch (e) {
            //alert(e.description);
        }
        }
    }

    function movesticky()
    {
          if ( window.pageYOffset != undefined ) { scrollpos = window.pageYOffset; }
        else if ( document.compatMode == 'BackCompat' ) { scrollpos = document.body.scrollTop; }
        else { scrollpos = document.documentElement.scrollTop; }
        if ( scrollpos > theTop ) { topa = ( sticky.style.position == "absolute" ) ? scrollpos : 0; }
        else { topa = ( sticky.style.position == "absolute" ) ? theTop : theTop - scrollpos; }
        sticky.style.top = topa + 'px';
        temp = setTimeout('movesticky()', 0);
    }

    function val06map_DoFSCommand(command, args) {}
    function getFlashMovieObject(movieName)
    {
        if (window.document[movieName])
        {
            return window.document[movieName];
        }

        if (navigator.appName.indexOf("Microsoft Internet")==-1)
        {
            if (document.embeds && document.embeds[movieName])
            {
                return document.embeds[movieName];
            }
        }
        else
        {
            return document.getElementById(movieName);
        }
        return document.getElementById( movieName );
    }

    function diplayActiveControl( url, w, h )
    {
        document.write( '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" width="' + w + '" height="' + h + '" id="multilink">' );
        document.write( '<param name="movie" value="' + url + '">' );
        document.write( '<param name="quality" value="autohigh">' );
        document.write( '<embed src="' + url + '" quality="autohigh" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" name="multilink">' );
        document.write( '</embed>' );
        document.write( '</object>' );
    }

   function numbersonly(myfield, e, dec)
   {
     var key;
     var keychar;

     if (window.event) { key = window.event.keyCode; }
     else if (e) { key = e.which; }
     else { return true; }
     keychar = String.fromCharCode(key);

     // vezerlo karakterek
     if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) ) { return true; }

     // szamok
     else if ((("0123456789").indexOf(keychar) > -1)) { return true; }
     else if ( keychar == "." ) { return true; }
     else { return false; }
   }

   function number_format(a, b, c, d) {
      a = Math.round(a * Math.pow(10, b)) / Math.pow(10, b);
      e = a + '';
      f = e.split('.');
      if (!f[0]) {
        f[0] = '0';
      }
      if (!f[1]) {
        f[1] = '';
      }
      if (f[1].length < b) {
      g = f[1];
      for (i=f[1].length + 1; i <= b; i++) {
      g += '0';
      }
        f[1] = g;
      }
      if(d != '' && f[0].length > 3) {
        h = f[0];
        f[0] = '';
        for(j = 3; j < h.length; j+=3) {
          i = h.slice(h.length - j, h.length - j + 3);
          f[0] = d + i +  f[0] + '';
        }
        j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3));
        f[0] = j + f[0];
     }
     c = (b <= 0) ? '' : c;
     return f[0] + c + f[1];
}

    var dohover = true;
    var feedopened = false;
    var feedtimeout = 0;
    var closetimeout = new Array();
    var feedsloaded = false;
    initHover = function()
    {
        navRoot = $('rovatok');
        if(!navRoot.childNodes)return;
        for( i = 0; i < navRoot.childNodes.length; i++ )
        {
            node = navRoot.childNodes[ i ];
            if ( node.nodeName == "LI" )
            {
                if ( node.id != 'cimlap_rovat' )
                {
                    node.innerHTML += '<ul class="navi_feed" style="display: none;"><li></li></ul>';
                    prev = node.previousSibling.nodeName == 'LI' ? node.previousSibling : node.previousSibling.previousSibling;
                    if ( node.className == 'selected' )
                    {
                        prev.style.backgroundImage = prev.id == 'cimlap_rovat' ? 'none' : 'url(' + getHomeLinkPath() + 'assets/images/navi_arrow.gif)';
                    }
                }
                node.onmouseover = function()
                {
                    if ( dohover )
                    {
                        window.clearTimeout( closetimeout[ this.id ] );
                        if ( this.id == 'cimlap_rovat' )
                        {
                            this.style.backgroundImage = 'url(' + getHomeLinkPath() + 'assets/images/navi_bg_noarrow_hi.gif)';
                            feedtimeout = window.setTimeout( 'feedopened = true', feedopened ? 10 : 400 );

                        }
                        else
                        {
                            prev = this.previousSibling.nodeName == 'LI' ? this.previousSibling : this.previousSibling.previousSibling;
                            if ( prev && prev.className != 'selected' )
                            {
                                prev.style.backgroundImage = prev.id == 'cimlap_rovat' ? 'none' : 'url(' + getHomeLinkPath() + 'assets/images/navi_arrow.gif)';
                            }
                            this.style.backgroundImage = 'url(' + getHomeLinkPath() + 'assets/images/navi_bg_hi.gif)';
                            feedtimeout = window.setTimeout( 'openfeed( \'' + this.id + '\' )', feedopened ? 10 : 400 );
                        }
                        for( i = 0; i < this.childNodes.length && this.childNodes[ i ].nodeName != 'A'; i++ ) {}
                        if ( i < this.childNodes.length )
                        {
                            this.childNodes[ i ].style.backgroundImage = 'url(' + getHomeLinkPath() + 'assets/images/navi_bg_left_hi.gif)';
                            this.childNodes[ i ].style.color = 'white';
                        }
                    }
                }
                node.onmouseout = function()
                {
                    if ( dohover )
                    {
                        window.clearTimeout( feedtimeout );
                        closetimeout[ this.id ] = window.setTimeout( 'closefeed( \'' + this.id + '\' )', 5 );
                        next = null;
                        if ( this.nextSibling != null )
                        {
                            next = this.nextSibling.nodeName == 'LI' ? this.nextSibling : this.nextSibling.nextSibling;
                        }
                        if ( this.id == 'cimlap_rovat' )
                        {
                            this.style.backgroundImage = this.className == 'selected' ? 'url(' + getHomeLinkPath() + 'assets/images/navi_bg_noarrow.gif)' : next.className == 'selected' ? 'none' : 'url(' + getHomeLinkPath() + 'assets/images/navi_pipe.gif)';
                        }
                        else
                        {
                            prev = this.previousSibling.nodeName == 'LI' ? this.previousSibling : this.previousSibling.previousSibling;
                            if ( prev.className != 'selected' )
                            {
                                prev.style.backgroundImage = prev.id == 'cimlap_rovat' ? 'url(' + getHomeLinkPath() + 'assets/images/navi_pipe.gif)' : 'url(' + getHomeLinkPath() + 'assets/images/navi_arrow_pipe.gif)';
                            }
                            if ( this.className == 'selected' )
                            {
                                this.style.backgroundImage =  'url(' + getHomeLinkPath() + 'assets/images/navi_bg.gif)';
                                prev.style.backgroundImage = prev.id == 'cimlap_rovat' ? 'none' : 'url(' + getHomeLinkPath() + 'assets/images/navi_arrow.gif)';
                            }
                            else
                            {
                                if ( this.id == 'navi_video' )
                                {
                                    this.style.backgroundImage = 'url(' + getHomeLinkPath() + 'assets/images/navi_arrow.gif)';
                                }
                                else
                                {
                                    this.style.backgroundImage = next.className == 'selected' ? 'url(' + getHomeLinkPath() + 'assets/images/navi_arrow.gif)' : 'url(' + getHomeLinkPath() + 'assets/images/navi_arrow_pipe.gif)';
                                }
                            }
                        }
                        for( i = 0; i < this.childNodes.length && this.childNodes[ i ].nodeName != 'A'; i++ ) {}
                        if ( i < this.childNodes.length )
                        {
                            this.childNodes[ i ].style.backgroundImage = this.className == 'selected' ? 'url(' + getHomeLinkPath() + 'assets/images/navi_bg_left.gif)' : 'none';
                            this.childNodes[ i ].style.color = this.className == 'selected' ? 'white' : 'black';
                        }
                    }
                }
            }
        }
        ofeatured = $('featured');
        if ( ofeatured != null )
        {
            $('featured').onmouseover = function() { dohover = false; }
            $('featured').onmouseout = function() { dohover = true; }
        }
    }

    function openfeed( tab )
    {
        tab = $( tab );
        if ( !feedsloaded )
        {
            feedsloaded = true;
            new Ajax.Request( getHomeLinkPath() + 'assets/static/navi_feed.html',
                {
                    method: 'get',
                    onSuccess: function( transport )
                    {
                        var response = transport.responseText || "";
                        arr = response.split( '<next>' );
                        orovatok = $('rovatok');
                        k = 0;
                        for( i = 1; i < orovatok.childNodes.length; i++ )
                        {
                            node = orovatok.childNodes[ i ];
                            if ( node.nodeName == "LI" )
                            {
                                for( j = 0; j < node.childNodes.length && node.childNodes[ j ].className != 'navi_feed'; j++ ) {}
                                if ( j < node.childNodes.length )
                                {
                                    node.childNodes[ j ].innerHTML = arr[ k ];
                                    k++;
                                }
                            }
                        }
                        window.setTimeout( 'feedsloaded = false', 5 * 60 * 1000 );
                    }
                }
            );
        }

        for( i = 0; i < tab.childNodes.length && tab.childNodes[ i ].className != 'navi_feed'; i++ ) {}
        if ( i < tab.childNodes.length )
        {
            feed = tab.childNodes[ i ];
            feed.style.display = 'block';
        }
        feedopened = true;
    }

    function closefeed( tab )
    {
        tab = $( tab );
        for( i = 0; i < tab.childNodes.length && tab.childNodes[ i ].className != 'navi_feed'; i++ ) {}
        if ( i < tab.childNodes.length )
        {
            feed = tab.childNodes[ i ];
            feed.style.display = 'none';
        }
        feedopened = false;
    }


/**
 * @author Ryan Johnson <ryan@livepipe.net>
 * @copyright 2007 LivePipe LLC
 * @package Control.Modal
 * @license MIT
 * @url http://livepipe.net/projects/control_modal/
 * @version 1.2.11
 */

if(typeof(Class) != "undefined"){
if(typeof(Control) == "undefined")
    Control = {};
  Control.Modal = Class.create();
  Object.extend(Control.Modal,{
    loaded: false,
    responders: $A([]),
    overlay: false,
    container: false,
    current: false,
    ie: false,
    targetRegexp: /#(.+)$/,
    imgRegexp: /\.(jpe?g|gif|png|tiff?)$/,
    overlayStyles: {
        position: 'absolute',
        top: 0,
        left: 0,
        zIndex: 9998
    },
    load: function(){
        if(!Control.Modal.loaded){
            Control.Modal.loaded = true;
            Control.Modal.ie = (navigator.appName == 'Microsoft Internet Explorer');
            Control.Modal.overlay = $(document.createElement('div'));
            Control.Modal.overlay.id = 'modal_overlay';
            Object.extend(Control.Modal.overlay.style,Control.Modal.overlayStyles);
            Control.Modal.overlay.hide();
            Control.Modal.container = $(document.createElement('div'));
            Control.Modal.container.id = 'modal_container';
            Control.Modal.container.hide();
            document.getElementsByTagName('body')[0].appendChild(Control.Modal.overlay);
            document.getElementsByTagName('body')[0].appendChild(Control.Modal.container);
        }
    },
    open: function(contents,options){
        m = new Control.Modal(false,$H({contents:contents}).merge(options));
        m.open();
        return m;
    },
    close: function(){
        if(Control.Modal.current)
            Control.Modal.current.close();
    },
    attachEvents: function(){
        Event.observe(window,'load',Control.Modal.load);
        //Event.observe(window,'unload',Event.unloadCache,false);
    },
    center: function(){
        element = this.container;
        if(!element._centered){
            this.container.setStyle({
                position: 'absolute'
            });
            this.container._centered = true;
        }
        dimensions = Control.Modal.container.getDimensions();
        Position.prepare();
        offset_left = (Position.deltaX + Math.floor((Control.Modal.getWindowWidth() - dimensions.width) / 2));
        offset_top = (Position.deltaY + Math.floor((Control.Modal.getWindowHeight() - dimensions.height) / 2));
        modal_dimensions = Control.Modal.container.getDimensions();
        Control.Modal.container.setStyle({
            top: ((modal_dimensions.height <= Control.Modal.getWindowHeight()) ? ((offset_top != null && offset_top > 0) ? offset_top : '0') + 'px' : 0),
            left: ((modal_dimensions.width <= Control.Modal.getWindowWidth()) ? ((offset_left != null && offset_left > 0) ? offset_left : '0') + 'px' : 0)
        });
    },
    getWindowWidth: function(){
        return (self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || 0);
    },
    getWindowHeight: function(){
        return (self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0);
    },
    getDocumentWidth: function(){
        return Math.max(document.body.scrollWidth,Control.Modal.getWindowWidth());
    },
    getDocumentHeight: function(){
        return Math.max(document.body.scrollHeight,Control.Modal.getWindowHeight());
    },
    onKeyDown: function(event){
        if(event.keyCode == Event.KEY_ESC)
            Control.Modal.close();
    },
    addResponder: function(responder){
        Control.Modal.responders.push(responder);
    },
    removeResponder: function(responder){
        Control.Modal.responders = Control.Modal.responders.without(responder);
    },
    //from Scriptaculous
    setOpacity: function(element,value){
        element= $(element);
        if(value == 1){
            Element.setStyle(element,{
                opacity: (/Gecko/.test(navigator.userAgent) && !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 0.999999 : null
            });
        if(/MSIE/.test(navigator.userAgent))
            Element.setStyle(element,{
                filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')
            });
        }else{
            if(value < 0.00001) value = 0;
            Element.setStyle(element, {opacity: value});
            if(/MSIE/.test(navigator.userAgent))
                Element.setStyle(element,{
                    filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'') + 'alpha(opacity='+value*100+')'
                });
        }
    }
});
Object.extend(Control.Modal.prototype,{
    mode: '',
    html: false,
    href: '',
    element: false,
    src: false,
    imageLoaded: false,
    initialize: function(element,options){
        this.element = $(element);
        this.options = {
            beforeOpen: Prototype.emptyFunction,
            afterOpen: Prototype.emptyFunction,
            beforeClose: Prototype.emptyFunction,
            afterClose: Prototype.emptyFunction,
            beforeLoad: Prototype.emptyFunction,
            onLoad: Prototype.emptyFunction,
            onFailure: Prototype.emptyFunction,
            onException: Prototype.emptyFunction,
            afterLoad: Prototype.emptyFunction,
            beforeImageLoad: Prototype.emptyFunction,
            afterImageLoad: Prototype.emptyFunction,
            contents: false,
            image: false,
            imageTemplate: new Template('<img src="#{src}" id="#{id}"/>'),
            imageAutoDisplay: true,
            imageCloseOnClick: true,
            hover: false,
            iframe: false,
            iframeTemplate: new Template('<iframe src="#{href}" width="100%" height="100%" frameborder="0" id="#{id}"></iframe>'),
            evalScripts: true, //for Ajax, define here instead of in requestOptions
            requestOptions: {}, //for Ajax.Request
            overlayDisplay: true,
            overlayClassName: '',
            overlayCloseOnClick: true,
            containerClassName: '',
            opacity: 0.3,
            zIndex: 9998,
            width: null,
            height: null,
            offsetLeft: 0, //for use with 'relative'
            offsetTop: 0, //for use with 'relative'
            position: 'absolute' //'absolute' or 'relative'
        };
        if(options)
            for(o in options)
                this.options[o] = options[o];
        target_match = false;
        image_match = false;
        if(this.element){
            target_match = Control.Modal.targetRegexp.exec(this.element.href);
            image_match = Control.Modal.imgRegexp.exec(this.element.href);
        }
        if(this.options.contents){
            this.mode = 'contents';
        }else if(this.options.image || image_match){
            this.mode = 'image';
            this.src = this.element.href;
        }else if(target_match){
            this.mode = 'named';
            x = $(target_match[1]);
            this.html = x.innerHTML;
            x.remove();
            this.href = target_match[1];
        }else{
            this.mode = (this.options.iframe) ? 'iframe' : 'ajax';
            this.href = this.element.href;
        }
        if(this.element){
            if(this.options.hover){
                this.element.observe('mouseover',this.open.bind(this));
                this.element.observe('mouseout',this.close.bind(this));
            }else{
                this.element.onclick = function(){
                    this.open();
                    return false;
                }.bindAsEventListener(this);
            }
        }
        targets = Control.Modal.targetRegexp.exec(window.location);
        this.position = function(){
            Control.Modal.overlay.setStyle({
                height: Control.Modal.getDocumentHeight() + 'px',
                width: Control.Modal.getDocumentWidth() + 'px'
            });
            if(this.options.position == 'absolute')
                Control.Modal.center();
            else{
                yx = Position.cumulativeOffset(this.element);
                Control.Modal.container.setStyle({
                    position: 'absolute',
                    top: yx[1] + this.options.offsetTop,
                    left: yx[0] + this.options.offsetLeft
                });
            }
        }.bind(this);
        if(this.mode == 'image'){
            this.afterImageLoad = function(){
                if(this.options.imageAutoDisplay && !window.opera)
                    $('modal_image').show();
                this.position();
                this.notifyResponders('afterImageLoad');
            }.bind(this);
        }
        if(this.mode == 'named' && targets && targets[1] && targets[1] == this.href)
            this.open();
    },
    open: function(){
        if(!this.options.hover)
            Event.observe($(document.getElementsByTagName('body')[0]),'keydown',Control.Modal.onKeyDown);
        Control.Modal.current = this;
        if(this.notifyResponders('beforeOpen') === false)
            return;
        if(!this.options.hover){
            Control.Modal.overlay.setStyle({
                zIndex: this.options.zIndex
            });
            Control.Modal.setOpacity(Control.Modal.overlay,this.options.opacity);
        }
        Control.Modal.container.setStyle({
            zIndex: this.options.zIndex + 1,
            width: (this.options.width ? this.options.width + 'px' : ''),
            height: (this.options.height ? this.options.height + 'px' : '')
        });
        if(Control.Modal.ie && !this.options.hover){
            $A(document.getElementsByTagName('select')).each(function(select){
                select.style.visibility = 'hidden';
            });
        }
        Control.Modal.overlay.addClassName(this.options.overlayClassName);
        Control.Modal.container.addClassName(this.options.containerClassName);
        switch(this.mode){
            case 'image':
                this.imageLoaded = false;
                this.notifyResponders('beforeImageLoad');
                this.update(this.options.imageTemplate.evaluate({src: this.src, id: 'modal_image'}));
                this.position();
                if(this.options.imageAutoDisplay && !window.opera)
                    $('modal_image').hide();
                if(this.options.imageCloseOnClick)
                    $('modal_image').observe('click',Control.Modal.close);
                $('modal_image').observe('load',this.afterImageLoad);
                $('modal_image').observe('readystatechange',this.afterImageLoad);
                break;
            case 'ajax':
                this.notifyResponders('beforeLoad');
                options = {
                    method: 'get',
                    onSuccess: function(request){
                        this.notifyResponders('onLoad',request);
                        this.update(request.responseText);
                        if(this.options.evalScripts)
                            request.responseText.evalScripts();
                        this.notifyResponders('afterLoad',request);
                    }.bind(this),
                    onFailure: this.options.onFailure,
                    onException: this.options.onException
                };
                if(this.options.requestOptions)
                    for(o in this.options.requestOptions)
                        options[o] = this.options.requestOptions[o];
                new Ajax.Request(this.href + '?plain=1',options);
                break;
            case 'iframe':
                this.update(this.options.iframeTemplate.evaluate({href: this.href, id: 'modal_iframe'}));
                this.position();
                break;
            case 'contents':
                this.update((typeof(this.options.contents) == 'function' ? this.options.contents.bind(this)() : this.options.contents));
                break;
            case 'named':
                this.update(this.html);
                break;
        }
        if(!this.options.hover){
            if(this.options.overlayCloseOnClick && this.options.overlayDisplay)
                Control.Modal.overlay.observe('click',Control.Modal.close);
            if(this.options.overlayDisplay)
                Control.Modal.overlay.show();
        }
        this.options.afterOpen();
    },
    update: function(html){
        Control.Modal.container.update(html);
        this.position();
        Control.Modal.container.show();
        if(this.options.position == 'absolute'){
            Event.stopObserving(window,'resize',this.position,false);
            Event.stopObserving(window,'scroll',this.position,false);
            Event.observe(window,'resize',this.position,false);
            Event.observe(window,'scroll',this.position,false);
        }
    },
    close: function(){
        response = this.notifyResponders('beforeClose');
        if(response == false && response != null)
            return;
        if(this.mode == 'image'){
            if(this.options.imageCloseOnClick)
                $('modal_image').stopObserving('click',Control.Modal.close);
            $('modal_image').stopObserving('load',this.afterImageLoad);
            $('modal_image').stopObserving('readystatechange',this.afterImageLoad);
        }
        if(Control.Modal.ie && !this.options.hover){
            $A(document.getElementsByTagName('select')).each(function(select){
                select.style.visibility = 'visible';
            });
        }
        if(!this.options.hover)
            Event.stopObserving(window,'keyup',Control.Modal.onKeyDown);
        Control.Modal.current = false;
        Control.Modal.overlay.removeClassName(this.options.overlayClassName);
        Control.Modal.container.removeClassName(this.options.containerClassName);
        Event.stopObserving(window,'resize',this.position,false);
        Event.stopObserving(window,'scroll',this.position,false);
        if(!this.options.hover){
            if(this.options.overlayCloseOnClick && this.options.overlayDisplay)
                Control.Modal.overlay.stopObserving('click',Control.Modal.close);
            if(this.options.overlayDisplay)
                Control.Modal.overlay.hide();
        }
        Control.Modal.container.update('');
        Control.Modal.container.hide();
        this.notifyResponders('afterClose');
    },
    notifyResponders: function(event_name,argument){
        Control.Modal.responders.each(function(responder){
            if(responder[event_name])
                responder[event_name](argument);
        });
        response = this.options[event_name] ? this.options[event_name](argument) : null;
        return response;
    }
});
Control.Modal.attachEvents();
Event.observe(window,'load',windowonload);
} // van-e prototype


    function removebp() {
        $('bessenyei').style.display = 'none';
    }

    var preview_stylesheet = false;
    var preview_stylesheet_helper;
    var oldbodypadding;
    var oldbodymargin;

    function set_print_css()
    {
        _gaq.push(['_trackEvent', 'printthis', 'nyomtathato', document.location.href.split( '?' )[ 0 ].split( '#' )[ 0 ] ]);
        if ( !preview_stylesheet )
        {
            if( document.createStyleSheet ){
                    printcontrols_stylesheet = document.createStyleSheet( getHomeLinkPath() + 'assets/css/printcontrols.css' );
                    preview_stylesheet = document.createStyleSheet( getHomeLinkPath() + 'assets/css/printpreview.css' );
            } else {

                    preview_stylesheet = document.createElement('link');
                    preview_stylesheet.rel='stylesheet';
                    preview_stylesheet.type = 'text/css';
                    preview_stylesheet.href= getHomeLinkPath() + 'assets/css/printpreview.css';
                    preview_stylesheet.media = 'screen';
                    document.getElementsByTagName("head")[0].appendChild( preview_stylesheet );

                    printcontrols_stylesheet = document.createElement('link');
                    printcontrols_stylesheet.rel='stylesheet';
                    printcontrols_stylesheet.type = 'text/css';
                    printcontrols_stylesheet.href=getHomeLinkPath() + 'assets/css/printcontrols.css';
                    printcontrols_stylesheet.media = 'screen';
                    document.getElementsByTagName("head")[0].appendChild( printcontrols_stylesheet );
            }
            //document.getElementById("internetado_head").style.display = "none";
            //document.body.innerHTML = '<div id="printcontrols"><a href="#" class="back" onclick="reset_print_page(); return false;">Vissza</a><form action="" method="post" name="print"><input type="checkbox" class="checkbox" id="print_pictures" onclick="if ( this.checked ) { $$(\'#szoveg .kep\').each( function(e) { e.style.display = \'inline\' } ); } else { $$(\'#szoveg .kep\').each( function(e) { e.style.display = \'none\' } ); }"/>&nbsp;a képeket is szeretném<input type="checkbox" checked="checked" id="print_anchors" class="checkbox masodik" onclick="if ( $(\'print_links_container\') ) { $(\'print_links_container\').style.display = this.checked ? \'block\' : \'none\'; if ( this.checked ) { $$(\'#szoveg .print_anchor\').each( function(e) { e.style.display = \'inline\' } ); } else { $$(\'#szoveg .print_anchor\').each( function(e) { e.style.display = \'none\' } ); } }" />&nbsp;a cikkben hivatkozott linkeket is nyomtassa<!-- input type="checkbox" checked class="checkbox masodik" id="print_orig" onchange="if ( this.checked ) { unset_print_css(); } else { set_print_css(); }"/>&nbsp;Eredeti oldal --><input type="submit" id="nyomtat" value=" Nyomtatás " onclick="window.print(); return false;" /></form></div>'+ document.body.innerHTML;
            jQuery( document.body ).prepend( '<div id="printcontrols"><a href="#" class="back" onclick="reset_print_page(); return false;">Vissza</a><form action="" method="post" name="print"><input type="checkbox" class="checkbox" id="print_pictures" onclick="if ( this.checked ) { $$(\'#szoveg .kep\').each( function(e) { e.style.display = \'inline\' } ); } else { $$(\'#szoveg .kep\').each( function(e) { e.style.display = \'none\' } ); }"/>&nbsp;a képeket is szeretném' + ( $$('.charts').length > 0 ? '<input type="checkbox" class="checkbox masodik" id="print_charts" onclick="if ( this.checked ) { $$(\'.charts\').each( function(e) { e.style.display = \'block\' } ); } else { $$(\'.charts\').each( function(e) { e.style.display = \'none\' } ); }"/>&nbsp;a grafikonokat is szeretném' : '' ) + '<input type="checkbox" checked="checked" id="print_anchors" class="checkbox masodik" onclick="if ( $(\'print_links_container\') ) { $(\'print_links_container\').style.display = this.checked ? \'block\' : \'none\'; if ( this.checked ) { $$(\'#szoveg .print_anchor\').each( function(e) { e.style.display = \'inline\' } ); } else { $$(\'#szoveg .print_anchor\').each( function(e) { e.style.display = \'none\' } ); } }" />&nbsp;a cikkben hivatkozott linkeket is nyomtassa ' + ( $('comment_list_container') ? '<input type="checkbox" class="checkbox masodik" id="print_comments" onchange="$(\'comment_list_container\').toggle()"/>&nbsp;a kommenteket is szeretném' : '' ) + '&nbsp;<input type="submit" id="nyomtat" value=" Nyomtatás " onclick="_gaq.push([\'_trackEvent\', \'printthis\', \'nyomtatva\', \'' + document.location.href.split( '?' )[ 0 ].split( '#' )[ 0 ] + '\' ]); window.print(); return false;" /></form></div>' );
            Ext.each( Ext.query( '.miniapp.charts' ), function( element )
            {
                eval( 'draw_' + element.id + '();' );
            } );
        }
        else
        {
            preview_stylesheet.disabled = false;
            printcontrols_stylesheet.disabled = false;
        }
        $$('HEAD LINK').each( function(e) { if ( e.media == 'print' ) { e.disabled = false; } } );
        $$('.print_szerzo').each( function(e) { e.style.display = 'inline'; } );
//        if ( $('print_ad') ) { $('print_ad').style.display = 'block'; }

        if ( $('print_anchors').checked )
        {
            if ( $('print_links_container') ) { $('print_links_container').style.display = 'block'; }
            $$('.print_anchor').each( function(e) { e.style.display = 'inline'; } );
        }
        else
        {
            if ( $('print_links_container') ) { $('print_links_container').style.display = 'none'; }
            $$('.print_anchor').each( function(e) { e.style.display = 'none'; } );
        }
        if ( $('print_pictures').checked ) { $$('#szoveg .kep').each( function(e) { e.style.display = 'block'; } ); }
        else { $$('#szoveg .kep').each( function(e) { e.style.display = 'none'; } ); }

        if ($( 'print_comments' ) && $('comment_list_container')) {
            if ( !$('print_comments').checked ) { $('comment_list_container').style.display = 'none'; }
        }
        if ($( 'microsite_microsite' ) ) $('microsite_microsite').style.display = 'none';
        document.body.scrollTo( 0 );
    }

    function unset_print_css()
    {
        $$('HEAD LINK').each( function(e) { if ( e.media == 'print' ) { e.disabled = true; } } );
        document.body.style.margin = '0 0pt 10px 20px';
        preview_stylesheet.disabled = true;
    }

    function reset_print_page()
    {
        _gaq.push(['_trackEvent', 'printthis', 'vissza', document.location.href.split( '?' )[ 0 ].split( '#' )[ 0 ] ]);
        $$('HEAD LINK').each( function(e) { if ( e.media == 'print' ) { e.disabled = false; } } );
        document.body.style.margin = '15px auto';
        preview_stylesheet.disabled = true;
        printcontrols_stylesheet.disabled = true;
        if ( $('print_links_container') ) { $('print_links_container').style.display = 'none'; }
        //document.getElementById("internetado_head").style.display = "block";
        if ( $('print_ad') ) { $('print_ad').style.display = 'none'; }
        $$('.print_szerzo').each( function(e) { e.style.display = 'none'; } );
        $$('.print_anchor').each( function(e) { e.style.display = 'none'; } );
        $$('#szoveg .kep').each( function(e) { e.style.display = 'block'; } );
        $$('.charts').each( function(e) { e.style.display = 'block'; } );
        if ($( 'microsite_microsite' ) ) $('microsite_microsite').style.display = 'block';
        if ($('comment_list_container')) {
             $('comment_list_container').style.display = 'block';
        }
    }

    // tenisz kozv timer
    function GetCurrentTime() {
        var my_current_timestamp;
        my_current_timestamp = new Date();
        return my_current_timestamp.getTime();
    }

    function dotime( datetime )
    {
        akttime = GetCurrentTime();
        var starttime = new Date();
        starttime.setTime(Date.parse(datetime));
        if ( akttime > starttime ) {
        esec = (akttime - starttime) / 1000;    //compute elapsed time
        eora = parseInt(esec / 3600) ;
        mperc = esec % 3600 ;
        eperc = parseInt( mperc / 60 );
        msec  = parseInt( mperc % 60 );
        var timestr;
        timestr = eora+"'"+eperc+"\"";
        var timer = document.getElementById('timer');
        if (document.getElementById) { timer.innerHTML = timestr; }
        }
   }
  // tenisz kozv timer vege

  //cimlap programdoboz
            function programkeres(targetform){
                if('/kultur/musor/tv/' == targetform.programtipus.value && ('all' == targetform.from.value || targetform.from.selectedIndex==0 )){targetform.from.selectedIndex=1;}
                targetform.action=targetform.programtipus.value;
                targetform.submit();
            }
    //cimlap programdoboz vege

    //cimlap idojarasdoboz

    function style2txt(txt){
    	var style2txtarr = {derult: 'Derült idő várható', valtozo1: 'Változékony', eso: 'Esős', havaseso: 'Havas eső', havazas: 'Havazás', zapor: 'Zápor', havaseso_zapor: 'Havas eső', hozapor: 'Hózápor', zivatar: 'Zivatar', hozivatar: 'Hózivatar', szeles: 'Szeles', kodos: 'Ködös', paras: 'Párás', valtozoan_felhos: 'Felhős', borult: 'Borult' };
    	return null != style2txtarr[txt] ? style2txtarr[txt] + ', ' : '';
    	}

    function changeCityBox(i){
    	if(i>0){
    		citydata=(cbx[i-1]).split(';');
    		st = "box_ikon " + citydata[2];
    		document.getElementById('idojaras_ikon').className = st;
    		inner = "";
    		inner+='<a class="box_link" href="/x?ido=/idojaras/" onclick="submitidojaras();return false">'+citydata[1]+'</a>'+style2txt(citydata[2])+'<span class="min">'+citydata[3]+'°C</span> / <span class="max">'+citydata[4]+'°C</span>'
    		document.getElementById('idojarasbox').innerHTML=inner;
    		createCookie('selectedcity', citydata[0], 365);
    	}

    }

    function submitidojaras(){
    	o=document.getElementById('idojaras_select')
    	y=o.options.length;
    	if(o.options.selectedIndex>0){document.getElementById('selectedcity').value = o[o.options.selectedIndex].value;}
    	document.idojaras_form.submit();
    }
    //cimlap idojarasdoboz vege

    // Tippmax
    function showtp(id) {
    var d = document.getElementById(id);
        for (var i = 1; i<=10; i++) {
            if (document.getElementById('tmpic'+i)) {document.getElementById('tmpic'+i).style.display='none';}
        }
    if (d) {d.style.display='block';}
    }
    // HP bubble adhoz
    function showad(id) {
    var d = document.getElementById(id);
        for (var i = 1; i<=10; i++) {
            if (document.getElementById('adbubble'+i)) {document.getElementById('adbubble'+i).style.display='none';}
        }
    if (d) {d.style.display='block';}
    }

    // inda promo
    function ipromo(a) {
        b = getCookie('ipromo');
        var d = document.getElementById('ipromo');
        var now = new Date();
        tmp = now.getTime();
        var exp = ( tmp + (1000 * 60 * 60 * 24 ));
        var expt = new Date(exp);
        exp = expt.toGMTString();
        if (b != 'shown' )  {    d.style.display = "block"; } else { d.style.display = "none"; }
        if ( a == 1 ) { document.cookie = 'ipromo=shown; expires='+exp+';'; d.style.display = "none";  }
    }

    function openFull( vurl )
    {
        var url = "http://mf.index.hu/player_ng.swf?file=" + vurl + "&mode=big";
        var fs = window.open( url , "FullScreenVideo", "toolbar=no,width=" + screen.availWidth  + ",height=" + screen.availHeight + ",status=no,resizable=yes,fullscreen=yes,scrollbars=no");
        fs.focus();
    }

    function openFull169( vurl )
    {
        var url = "http://mf.index.hu/player_ng_169.swf?file=" + vurl + "&mode=big";
        var fs = window.open( url , "FullScreenVideo", "toolbar=no,width=" + screen.availWidth  + ",height=" + screen.availHeight + ",status=no,resizable=yes,fullscreen=yes,scrollbars=no");
        fs.focus();
    }

    function moderateComment( id )
    {
        var moderate = $( 'ban_' + id + '_moderate' ).options[$( 'ban_' + id + '_moderate' ).selectedIndex].value;
        var block    = $( 'ban_' + id + '_block' ).options[$( 'ban_' + id + '_block' ).selectedIndex].value;
        if( moderate || block )
        {
            var win = window.open(
                munkaUrl + 'moderateComment?id=' + id + '&moderate=' + moderate + '&days=' + block,
                'commentadmin',
                'location=1,status=1,scrollbars=1,height=600,width=600'
            );

            if( moderate == 1 )
            {
                $( 'c' + id ).parentNode.removeChild( $( 'c' + id ) );
            }
            else
            {
                $( 'ban_' + id ).style.display = 'none';
                $( 'openban_' + id ).show();
            }
        }
        else
        {
            $( 'ban_' + id ).hide();
            $( 'openban_' + id ).show();
        }
    }

PicScroller =
{
    _max: 0,
    _position: 0,
    _scrolling: false,
    _slideWidth: 0,
    _speed: 20,
    _step: 10,
    _stripBoxWidth: 0,
    _timeout: 0,
    bindEvents: function()
    {
        this.obj.left.click( function( e ) { e.preventDefault(); } ).mouseover( function()
        {
            PicScroller.scroll( 'left' );
        } ).mousedown( function()
        {
            PicScroller._speed = PicScroller.config.enhancedSpeed;
            jQuery( document ).mouseup( function()
            {
                PicScroller._speed = PicScroller.config.defaultSpeed;
                jQuery( document ).unbind( 'mouseup' );
            } );
        } ).mouseout( function()
        {
            PicScroller.stopScroll();
        } );
        this.obj.right.click( function( e ) { e.preventDefault(); } ).mouseover( function()
        {
            PicScroller.scroll( 'right' );
        } ).mousedown( function()
        {
            PicScroller._speed = PicScroller.config.enhancedSpeed;
            jQuery( document ).mouseup( function()
            {
                PicScroller._speed = PicScroller.config.defaultSpeed;
                jQuery( document ).unbind( 'mouseup' );
            } );
        } ).mouseout( function()
        {
            PicScroller.stopScroll();
        } );
    },
    config:
    {
        defaultSpeed: 40,
        enhancedSpeed: 15
    },
    init: function()
    {
        this.obj.stripBox = jQuery( 'div.strip' );
        this.obj.left = this.obj.stripBox.find( 'a.lapozo.left' );
        this.obj.right = this.obj.stripBox.find( 'a.lapozo.right' );
        this.obj.slide = this.obj.stripBox.find( 'ul' );
        this.obj.slide.find( 'li' ).each( function( k, i ) { PicScroller._slideWidth += jQuery( this ).innerWidth(); } );
        this.obj.slide.width( this._slideWidth );
        this._slideWidth -= 10;
        this._stripBoxWidth = this.obj.stripBox.innerWidth();
        this._max = this._slideWidth - this._stripBoxWidth;
        this.bindEvents();
    },
    obj:
    {
        left: null,
        right: null,
        slide: null,
        stripBox: null
    },
    scroll: function( direction )
    {
        var _continue = true;
        var direction = direction == 'left' || direction == -1 ? -1 : 1;
        this._scrolling = true;
        this._position -= direction * this._step;
        if( this._position < -this._max )
        {
            _continue = false;
            this._position = -this._max;
            this.obj.right.fadeOut();
        }
        else if( this._position > 0 )
        {
            _continue = false;
            this._position = 0;
            this.obj.left.fadeOut();
        }
        else
        {
            if( this.obj.right.css( 'display' ) == 'none' ) this.obj.right.fadeIn();
            if( this.obj.left.css( 'display' ) == 'none' ) this.obj.left.fadeIn();
        }
        this.obj.slide.css( { left: this._position + 'px' } );
        if( _continue ) this._timeout = setTimeout( function() { PicScroller.scroll( direction ); }, this._speed );
        else this._scrolling = false;
    },
    stopScroll: function()
    {
        clearTimeout( this._timeout );
        this._scrolling = false;
    }
};

var SendThis = {
    url: document.location.href.split( '?' )[ 0 ].split( '#' )[ 0 ],
    GA_cancel: function() { _gaq.push( [ '_trackSocial', 'sendthis', 'megse', this.url ] ); },
    GA_submit: function() {
        var to = jQuery( '#sendthis_to' ).val(),
            targets = to == '' ? 0 : to.split( ',' ).length;
        _gaq.push( [ '_trackSocial', 'sendthis', 'elkuldve', this.url, targets ] );
    }
}

