
    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();

var autoComplete =
{
    __forbidden: [ 13, 38, 40 ],
    storage: {},
    status: {},
    op: { szerzo: 'alnev', cimkek: 'tag' },
    bind: function( id )
    {
        autoComplete.status[ id ] = false;
        autoComplete.storage[ id ] = new Array();
        jQuery( '#autocomplete_' + id ).css( 'top', ( jQuery( '#' + id ).position().top + jQuery( '#' + id ).outerHeight() + 1 ) + 'px' );
        jQuery( '#' + id )
            .keypress( function( e )
            {
                var key = e.charCode ? e.charCode : e.keyCode;
                if( key == 13 )
                {
                    if( !autoComplete.status[ id ] ) return true;
                    else
                    {
                        jQuery( this ).val( jQuery( '#autocomplete_' + id + ' ul li.selected' ).html() );
                        autoComplete.hide( id );
                        e.preventDefault();
                        return false;
                    }
                }
                else if( autoComplete.status[ id ] )
                {
                    if( key == 40 ) jQuery( '#found' + id + '_' + ( parseInt( jQuery( '#autocomplete_' + id + ' ul li.selected' ).attr( 'id' ).split( '_' )[ 1 ] ) + 1 ) ).mouseover();
                    else if ( key == 38 ) jQuery( '#found' + id + '_' + ( parseInt( jQuery( '#autocomplete_' + id + ' ul li.selected' ).attr( 'id' ).split( '_' )[ 1 ] ) - 1 ) ).mouseover();
                }
                else return true;
            } )
            .keyup( function( e )
            {
                var key = e.charCode ? e.charCode : e.keyCode;
                if( autoComplete.__forbidden.indexOf( key ) == -1 )
                {
                    var value = jQuery( this ).val();
                    if( value.length > 1 )
                    {
                        if( typeof autoComplete.storage[ id ][ value ] != 'undefined' )
                        {
                            if( autoComplete.storage[ id ][ value ].suggestions.length ) autoComplete.show( autoComplete.storage[ id ][ value ].suggestions, id );
                            else autoComplete.hide( id )
                        }
                        else
                        {
                            jQuery.ajax(
                            {
                                url: getHomeLinkPath() + '24ora/?op=search' + ( typeof autoComplete.op[ id ] != 'undefined' ? autoComplete.op[ id ] : '' ),
                                data: { s: value },
                                success: function( r )
                                {
                                    if( typeof r.suggestions != 'undefined' )
                                    {
                                        if( r.suggestions.length ) autoComplete.show( r.suggestions, id );
                                        autoComplete.storage[ id ][ value ]=r;
                                    }
                                    else autoComplete.hide( id );
                                },
                                dataType: 'json'
                            } );
                        }
                    }
                }
            } )
            .blur( function() { autoComplete.hide( id ); } )
    },
    show: function( items, target )
    {
        var html = '';
        for( i = 0; i < items.length; i++ )
        {
            html += '<li id="found' + target + '_' + ( i + 1 ) + '">' + items[ i ] + '</li>';
        }
        jQuery( '#autocomplete_' + target ).children( 'ul' ).html( html );
        if( !autoComplete.status[ target ] )
        {
            jQuery( '#autocomplete_' + target ).fadeIn( 200 );
            autoComplete.status[ target ] = 1;
        }
        jQuery( '#autocomplete_' + target ).children( 'ul' ).children( 'li' ).each( function( k, i )
        {
            if( !k ) jQuery( this ).addClass( 'selected' );
            jQuery( this )
                .mouseover( function()
                {
                    jQuery( '#autocomplete_' + target + ' ul li' ).removeClass( 'selected' );
                    jQuery( this ).addClass( 'selected' );
                } )
                .click( function()
                {
                    jQuery( '#' + target ).val( jQuery( this ).html() ).focus();
                    autoComplete.hide( target );
                } );
        } );
    },
    hide: function( id )
    {
        jQuery( '#autocomplete_' + id ).fadeOut( 200 );
        autoComplete.status[ id ] = false;
    }
};

    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 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 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;
    }

    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' );
    }

    var _gaq = _gaq || [];
    windowonload = function(e)
    {
// 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( ( document.cookie.toString().indexOf( 'index_mobile=true' ) != -1 ) || ( window.navigator.userAgent.indexOf('Mobile') != -1 ) )
        {
            jQuery( '#credits' ).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' )
                )
            );
        }

        if ( $('sendthis_link') != null ) new Control.Modal( $('sendthis_link'), { overlayCloseOnClick: false } );
        if ( $('sendquestion_link') != null ) new Control.Modal( $('sendquestion_link'), { overlayCloseOnClick: false } );
        $$( ".related_adatlap" ).each( function( element )
        {
            new Control.Modal( element, { overlayCloseOnClick: false } );
        } );
        $$( ".sendquestion" ).each( function( element )
        {
            new Control.Modal( element, { overlayCloseOnClick: 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;
                    }
                } );
            } );
        } );
        sticky = document.getElementById('sticky');
        if ( sticky != null ) temp = setTimeout('movesticky()', 10);

        //szotar
        $$( 'a.modal' ).each( function( element )
        {
            new Control.Modal( element, { overlayCloseOnClick: false } );
        } );
        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') );
        }

/*
        var modals = document.getElementsByClassName('modal');
        for ( i in modals )
        {
            if( modals[i].tagName == "A" )
            {
                modals[i].id = modals[i].innerHTML;
                new Control.Modal( $( modals[i].id ), { overlayCloseOnClick: 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,{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: function() { if( typeof Effect.ScrollTo == 'function' && typeof $( 'modalpopup' ) != 'undefined' ) Effect.ScrollTo( $( 'modalpopup' ) ); },
            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';
            if( typeof this.element != 'undefined' ) 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,
                backgroundColor: '#000000'
            });
            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 'iframe':
            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];
                if( this.href.indexOf( 'plain=1' ) == -1 ) this.href += '?plain=1';
                this.href = this.href.replace( /popup\//g, '');
                new Ajax.Request(this.href + '&noauth=true',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)
                Effect.Appear( Control.Modal.overlay.id, { to: this.options.opacity } );
        }
        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);
        }
        Control.Modal.overlay.setStyle( { height: document.body.clientHeight + 'px' } );
    },
    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)
                Effect.Fade( Control.Modal.overlay.id, { from: this.options.opacity, delay: 0 } );
        }
        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](argument);
        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 ] ]);
        var css_query = document.location.href.indexOf( 'nepitelet' ) != -1 ? '#content .sajatkepek' : '#szoveg .kep';
        if ( !preview_stylesheet )
        {
            if( document.createStyleSheet ){
                    printcontrols_stylesheet = document.createStyleSheet( getHomeLinkPath().replace( /autok\/|motorok\//g, '' ) + 'assets/css/printcontrols.css' );
                    preview_stylesheet = document.createStyleSheet( getHomeLinkPath().replace( /autok\/|motorok\//g, '' ) + 'assets/css/printpreview.css' );
            } else {

                    preview_stylesheet = document.createElement('link');
                    preview_stylesheet.rel='stylesheet';
                    preview_stylesheet.type = 'text/css';
                    preview_stylesheet.href= getHomeLinkPath().replace( /autok\/|motorok\//g, '' ) + '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().replace( /autok\/|motorok\//g, '' ) + 'assets/css/printcontrols.css';
                    printcontrols_stylesheet.media = 'screen';
                    document.getElementsByTagName("head")[0].appendChild( printcontrols_stylesheet );
            }
            //document.getElementById("internetado_head").style.display = "none";
            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 ) { $$(\'' + css_query + '\').each( function(e) { e.style.display = \'block\' } ); } else { $$(\'' + css_query + '\').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>' );
            jQuery( '.miniapp.charts' ).each( function( k, 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 ) { $$( css_query ).each( function(e) { e.style.display = 'block'; } ); }
        else { $$( css_query ).each( function(e) { e.style.display = 'none'; } ); }
    }

    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'; } );
        $$( document.location.href.indexOf( 'nepitelet' ) != -1 ? '#content .sajatkepek' : '#szoveg .kep' ).each( function(e) { e.style.display = 'block'; } );
        $$('.charts').each( function(e) { e.style.display = 'block'; } );
        if(typeof loadAccordions == 'function') loadAccordions();
    }

    // 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 changeCityBox(i){
        if(i>0){
            citydata=(cbx[i-1]).split(';');
            st = "doboz " + citydata[2];
            document.getElementById('idojaras').className = st;
            inner = "";
            inner+='<span class="idojaras"><span class="min">'+citydata[3]+'Â°C</span> / <span class="max">'+citydata[4]+'Â°C</span></span>';
            inner+='<span class="varos" id><a href="/x?ido=/politika/bulvar/idojaras/" onclick="submitidojaras();return false">'+citydata[1]+'</a></span>';

            document.getElementById('idojaras').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');
        if( d )
        {
            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();
        }
    }

    var show_all_pages = false;
    function toggle_cikk_pages()
    {
        if( show_all_pages )
        {
            $$( '.oldal' ).each( function( element )
            {
                if( element.id != 'cikk_oldal_' + cikk_page )
                {
                    Effect.Fade( element,
                    {
                        duration: 0.5,
                        queue: 'end',
                        afterFinish: function()
                        {
                            element.addClassName( 'hidden_page' );
                        }
                    } );
                }
            } );
            Effect.Appear( 'pager_bottom', { duration: 0.5, queue: 'end' } );
            $( 'cikk_pages' ).update( 'Oldaltörések nélkül' );
        }
        else
        {
            $$( '.hidden_page' ).each( function( element )
            {
                element.setStyle( { display: 'none' } );
                element.removeClassName( 'hidden_page' );
                Effect.Appear( element, { duration: 0.5, queue: 'end' } );
            } );
            Effect.Fade( 'pager_bottom', { duration: 0.5, queue: 'end' } );
            $( 'cikk_pages' ).update( 'Oldaltörésekkel' );
        }
        show_all_pages = show_all_pages ? false : true;
        Effect.ScrollTo( 'szoveg', { duration: 2, queue: 'start' } );
    }

    function checkCaptcha()
    {
        var notice = $('message_error_text');
        var email = $( 'contact_email' ).value;
        if( email.indexOf( '@' ) < email.lastIndexOf( '.' ) && email.lastIndexOf( '.' ) + 5 >= email.length )
        {
            if( $( 'contact_message' ).value != '' )
            {
                var path =  document.getElementById('contentpath').value;
                var rovatpath = document.getElementById('rovatpath').value;
                new Ajax.Request( rovatpath + '?op=checkcaptcha&code=' + document.getElementById('code').value,
                {
                    method: 'get',
                    onSuccess: function(transport)
                    {
                        if('false' == transport.responseText) notice.update('Hibás a megadott kód!');
                        else
                        {
                        	document.getElementById('kapcsolat').action = path;
                        	document.getElementById('kapcsolat').submit();
                    	}
                    }
                });
            }
            else notice.update( 'Nem írt kérdést!' );
        }
        else notice.update( 'Az e-mail címet kötelező megadni!' );
    return false;
    }
    function checkform( form )
    {
      var errorMsg = '';
      if( '' == $('telefon').value ){ errorMsg += " - Mobil kitöltése kötelező.<br />"; }
      if( '' == $('nev').value ){ errorMsg += " - Név kitöltése kötelező.<br />"; }
      if( !checkemail() ){ errorMsg += " - Helyes email cím megadása kötelező.<br />"; }
      if('' == errorMsg) { form.submit(); }
      else { $('errorMsg').innerHTML = errorMsg; return false; }
    }

    function checkemail()
    {
      var str=$('email').value;
      var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
      if (filter.test(str))
	return true;
      else{
	return false;
      }
    }

var SendThis = {
    url: document.location.href.split( '?' )[ 0 ].split( '#' )[ 0 ],
    GA_cancel: function() { _gaq.push( [ '_trackEvent', 'sendthis', 'megse', this.url ] ); },
    GA_submit: function() {
        var to = jQuery( '#sendthis_to' ).val(),
            targets = to == '' ? 0 : to.split( ',' ).length;
        _gaq.push( [ '_trackEvent', 'sendthis', 'elkuldve', this.url, targets ] );
    }
}
/* video sorozat kezelo */
var Video = {
    scrolling: false,
    path: null,
    video: null,
    scroller: null,
    init: function() {
        this.path = null;
        if( typeof default_video_info.site_url != 'undefined' ) {
            this.baseUrl = default_video_info.site_url;
            this.path = default_video_info.path;
        }
        else this.baseUrl = document.location.href.split( 'tv/' ).shift();
        if( document.location.href.indexOf( '#' ) != -1 ) {
            this.path = this.path ? this.path : document.location.href.split( '#' ).pop();
            jQuery.ajax( {
                url: this.baseUrl + this.path,
                data: { op: 'ajax_get_video' },
                dataType: 'JSON',
                success: function( r ) {
                    Video.video = r.orig_data;
                    if( typeof Video.video.content_params.sorozat != "undefined" ) {
                        Video.getSorozatInfo();
                    }
                    else Video.buildPlayer();
                }
            } );
        }
        else {
            this.path = default_video_info.path;
            this.video = default_video_info;
        }
    },
    buildPlayer: function() {
        jQuery( '#box_videoplayer' ).find( 'object' ).first().remove();
        jQuery( '#box_videoplayer' ).find( 'ul#sorozatok' ).first().remove();
        jQuery( '#box_videoplayer' ).prepend(
            jQuery( '<object></object>' ).attr( {
                classid: 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
                width: 643,
                height: 413,
                codebase: 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'
            } ).append(
                jQuery( '<param />' ).attr( { name: 'quality', value: 'high' } )
            ).append(
                jQuery( '<param />' ).attr( { name: 'allowScriptAccess', value: 'always' } )
            ).append(
                jQuery( '<param />' ).attr( { name: 'allowFullScreen', value: 'true' } )
            ).append(
                jQuery( '<param />' ).attr( { name: 'flashvars', value: 'vID=' + Video.video.content_params.video_hash + '&amp;autostart=false&amp;onsite=1' } )
            ).append(
                jQuery( '<param />' ).attr( { name: 'src', value: 'http://files.indavideo.hu/player/gup.swf?b=20090625&amp;vID=' + Video.video.content_params.video_hash + '&amp;autostart=false&amp;onsite=1' } )
            ).append(
                jQuery( '<param />' ).attr( { name: 'bgcolor', value: '#666666' } )
            ).append(
                jQuery( '<embed />' ).attr( {
                    flashvars: 'vID=' + Video.video.content_params.video_hash + '&amp;autostart=false&amp;onsite=1',
                    src: 'http://files.indavideo.hu/player/gup.swf?b=20090625&amp;vID=' + Video.video.content_params.video_hash + '&amp;autostart=false&amp;onsite=1',
                    bgcolor: '#666666',
                    allowfullscreen: 'true',
                    allowScriptAccess: 'always',
                    quality: 'high',
                    type: 'application/x-shockwave-flash',
                    width: 643,
                    height: 413,
                    pliginspage: 'http://www.macromedia.com/go/getflashplayer'
                } )
            )
        );
        var ajanlo = jQuery( '#box_videoplayer' ).find( '.ajanlo' );
        ajanlo.find( 'h2' ).first().html( Video.video.cim );
        ajanlo.find( 'h3' ).first().html( Video.video.szoveg );
        var tags = ajanlo.find( '.post_bottom' ).find( '.tags' );
        tags.find( 'li' ).each( function() { if( !jQuery( this ).hasClass( 'label' ) ) jQuery( this ).remove(); } );
        for( var i = 0; i < Video.video.content_params.tags.length; i++ ) {
            tags.append(
                jQuery( '<li></li>' ).append(
                    jQuery( '<a></a>' ).attr( {
                        href: Video.baseUrl + '?cimkek=' + Video.video.content_params.tags[ i ].name
                    } ).text( Video.video.content_params.tags[ i ].name ).addClass( 'cimke' )
                )
            );
        }
    },
    getSorozatInfo: function() {
        jQuery.ajax( {
            url: this.baseUrl + this.path,
            data: {
                op: 'sorozat'
            },
            dataType: 'JSON',
            success: function( r ) {
                Video.buildPlayer();
                var sorozatlist = jQuery( '<ul></ul>' ).attr( { id: 'sorozatok' } ).css( 'left', Video.scroller.pos + 'px' );
                for( var i = 0; i < r.list.length; i++ ) {
                    var item = r.list[ i ].content_params,
                        img_src = typeof item.video_image == "undefined" ? '' : item.video_image;
                    if( img_src == '' ) {
                        img_src = 'http://files.indavideo.hu/vimages/' + item.video_id.substring( 0, 3 ) + '/' + item.video_id.substring( 3, 6 ) + '/2.jpg';
                    }
                    var list_item = jQuery( '<li></li>' ).append(
                        jQuery( '<a></a>' ).attr( { href: '#', 'data-path': r.list[ i ].path } ).click( function( e ) {
                            e.preventDefault();
                            document.location.href = document.location.href.split( '#' )[ 0 ] + '#' + jQuery( this ).attr( 'data-path' );
                            Video.init();
                        } ).append( jQuery( '<img />' ).attr( {
                            alt: '',
                            src: img_src
                        } ) ).append( jQuery( '<span></span>' ).text( r.list[ i ].cim ) )
                    );
                    if( Video.video.path == r.list[ i ].path ) list_item.addClass( 'selected' );
                    sorozatlist.append( list_item );
                }
                jQuery( '#sorozat_lista' ).append( sorozatlist );
                var selected = sorozatlist.find( '.selected' ),
                    dist = selected.position().left + selected.width() - jQuery( '#sorozat_lista' ).width() + 19;
                if( dist > 0 ) jQuery( '#sorozatok' ).css( 'left', -dist + 'px' );
                else if( selected.position().left < 0 ) jQuery( '#sorozatok' ).css( 'left', '0px' );
                Video.checkControll();
            }
        } )
    },
    checkControll: function() {
        var total_width = this.scroller.elements * this.scroller.element_width;
        if( this.scroller.pos < 0 ) {
            jQuery( '#sorozat_left' ).removeClass( 'disabled' );
            if( this.scroller.pos > -total_width + this.scroller.width && total_width > this.scroller.width ) jQuery( '#sorozat_right' ).removeClass( 'disabled' );
            else jQuery( '#sorozat_right' ).addClass( 'disabled' );
        }
        else jQuery( '#sorozat_left' ).addClass( 'disabled' );
    },
    scroll: function( dir ) {
        var ul = jQuery( '#sorozatok' ),
            pos = parseInt( ul.css( 'left' ) ),
            total_width = this.scroller.elements * this.scroller.element_width;
        if( dir == -1 ) {
            if( pos < 0 ) {
                pos += this.scroller.step;
                ul.css( 'left', Math.min( 0, pos ) + 'px' );
            }
        }
        else {
            if( pos > -total_width && total_width > this.scroller.width ) {
                pos -= this.scroller.step;
                ul.css( 'left', Math.max( -total_width + this.scroller.width, pos ) + 'px' );
            }
        }
        this.scroller.pos = pos;
        this.checkControll();
        if( this.scrolling ) setTimeout( function() { Video.scroll( dir ); }, 40 );
    }
};
jQuery( document ).ready( function() {
    if( jQuery( '#kereso_24ora' ).length )
    {
        autoComplete.bind( 'szerzo' );
        autoComplete.bind( 'cimkek' );
    }
    Video.scroller = {
        step: 10,
        width: jQuery( '#sorozat_lista' ).width() - 45,
        elements: jQuery( '#sorozatok li' ).length,
        element_width: jQuery( '#sorozatok li' ).first().width(),
        pos: 0
    };
    if( jQuery( '#sorozatok' ).length ) {
        jQuery( '#sorozatok li a' ).click( function( e ) {
            e.preventDefault();
            document.location.href = document.location.href.split( '#' )[ 0 ] + jQuery( this ).attr( 'href' );
            Video.init();
        } );
    }
    if( typeof default_video_info != "undefined" ) Video.init();
    jQuery( '#sorozat_left' ).mousedown( function() {
        Video.scrolling = true;
        Video.scroll( -1 );
    } ).mouseup( function() { Video.scrolling = false; } ).click( function( e ) { e.preventDefault(); } );
    jQuery( '#sorozat_right' ).mousedown( function() {
        Video.scrolling = true;
        Video.scroll( 1 );
    } ).mouseup( function() { Video.scrolling = false; } ).click( function( e ) { e.preventDefault(); } );

    // IE9 letűzős kampány
    if ( (window.navigator.userAgent.indexOf('Windows NT 6.1') != -1 || window.navigator.userAgent.indexOf('Windows NT 6.0') != -1 )  &&  document.cookie.toString().indexOf( 'ie9_closed=true' ) == -1 ) {
        var today = new Date();
        var day = today.getDate();
        var month = today.getMonth()+1;
        if  ( ( month==12 && ( day==28 || day==29 )) ||
              ( month==1  && ( day==4 || day==5  || day==6 || day==11 || day==12 || day==17 || day==18 || day==19 || day==24 || day==25 || day==26 ))
            ) {
            //toast
            var _gde_ommlhudjdc = new Image(1,1);
            _gde_ommlhudjdc.src='http://hu.hit.gemius.pl/redot.gif?l=8/tstamp='+(new Date()).getTime()+'/id=bazqH8dD2884X7bb3164eoXDrqyROaeOpYMvQtbqyGz.e7/stparam=ommlhudjdc/fastid=1224979098645695665';
            jQuery( 'body' ).prepend(
                jQuery( '<div></div>' ).attr( 'id', 'ie9notificationtoast' ).append(
                    jQuery( '<a></a>' ).attr( 'href', 'http://hu.hit.gemius.pl/hitredir/id=bazqH8dD2884X7bb3164eoXDrqyROaeOpYMvQtbqyGz.e7/stparam=lndskrnnnx/fastid=1297036692683623601/url=' + encodeURI('http://index.hu/assets/static/ie9/') ),
                    jQuery( '<a></a>' ).attr( 'class', "close" ).attr( 'href', '#' ).click( function( e ) {
                        e.preventDefault();
                        var exdate = new Date();
                        exdate.setDate( exdate.getDate() + 40 );
                        document.cookie = 'ie9_closed=true;expires=' + exdate.toUTCString();
                        jQuery( '#ie9notificationtoast' ).fadeOut();
                    } )
                )
            );
        }
    }
} );


var ____prototype_ae_IE9JumpList = ____prototype_ae_IE9JumpList || {};
(function( jumplist ) {
	if ( !navigator.userAgent.toLowerCase().match(/msie (9|10)(\.?[0-9]*)*/) ) {
		return;
	}

	var options = {

		// Basic site information
		siteName: 'Totalcar', // Site Name
		applicationName: 'Totalcar', // Site Name
		startURL: 'http://totalcar.hu/', // Homepage URL
		shortcutIcon: 'http://ie9pinning.blob.core.windows.net/files/JumpList/634594347343583360/Main-favicon.ico', // Main Site Icon
		tooltip: '',

		// Dynamic jumplist tasks & notifications
		rssFeedURL: 'http://totalcar.hu/24ora/rss/?rovat=magazin%2Fhirek&ie9=true',
		categoryTitle: 'Friss hírek', // Task group name
		defaultTaskIcon: 'http://ie9pinning.blob.core.windows.net/files/JumpList/634594347343583360/GenericTask-favicon.ico', // Generic task icon
		notifications: true,  // Taskbar notifications

		navButtonColor: false,
		latestFeedItemDate: 0,
		pollInterval: 30000,

		// Jumplist tasks { name: Task Label, action: Task URL, icon: Task Icon }
		staticTasks: [{ name: 'Magazin',  action: 'http://totalcar.hu/magazin/hirek?utm_source=tab&utm_medium=ie9&utm_campaign=ie9_letuzes', icon: 'http://ie9pinning.blob.core.windows.net/files/JumpList/634594347343583360/Task4-favicon.ico', target: 'tab' },{ name: 'Népítélet',  action: 'http://nepitelet.hu/autok?utm_source=tab&utm_medium=ie9&utm_campaign=ie9_letuzes', icon: 'http://ie9pinning.blob.core.windows.net/files/JumpList/634594347343583360/Task2-favicon.ico', target: 'tab' },{ name: 'Totalcar Címlap',  action: 'http://totalcar.hu?utm_source=tab&utm_medium=ie9&utm_campaign=ie9_letuzes', icon: 'http://ie9pinning.blob.core.windows.net/files/JumpList/634594347343583360/Task0-favicon.ico', target: 'tab' },{ name: 'TV',  action: 'http://totalcar.hu/tv?utm_source=tab&utm_medium=ie9&utm_campaign=ie9_letuzes', icon: 'http://ie9pinning.blob.core.windows.net/files/JumpList/634594347343583360/Task3-favicon.ico', target: 'tab' },{ name: 'Belsőség',  action: 'http://belsoseg.blog.hu?utm_source=tab&utm_medium=ie9&utm_campaign=ie9_letuzes', icon: 'http://ie9pinning.blob.core.windows.net/files/JumpList/634594347343583360/Task1-favicon.ico', target: 'tab' }],

		// Drag and drop site pinning bar
		prompt: false, // Add a site pinning bar on top of my site pages
		barSiteName: 'Totalcar.hu' // Site name as it should appear on the pinning bar
	};

	var lib = {
		dom: {
			meta: function(name, content) {
				var meta = document.createElement('meta');
				meta.setAttribute('name', name);
				meta.setAttribute('content', content);
				return meta;
			},
			link: function(rel, href) {
				var link = document.createElement('link');
				link.setAttribute('rel', rel);
				link.setAttribute('href', href);
				return link;
			},
			div: function() {
				return document.createElement('div');
			}
		},
		net: {
			getJSONP: function( URL ) {
				var script = document.createElement('script');
				script.type = 'text/javascript';
				script.src = URL + ( URL.indexOf('?') != -1 ? '&' : '?' ) + Date.now();
				var head = document.getElementsByTagName('head')[0];
				head.insertBefore(script, head.firstChild);
			}
		}
	};

	jumplist.parseRSSFeed = function parseRSSFeed( news ) {
		try {
			if ( window.external.msIsSiteMode() ) {
				window.external.msSiteModeClearJumpList();
				window.external.msSiteModeCreateJumpList( options.categoryTitle );

				try {
					// RSS feeds
                    if ( news.rss && news.rss.channel && news.rss.channel.item ) {
					    for ( var items = news.rss.channel.item.slice(0, 10), numItems = items.length, i = numItems-1, task, pubDate, newItems = 0, taskTitle = ''; i >= 0; i-- ) {
						    task = items[i];
						    pubDate = Date.parse( task.pubDate );
						    taskTitle = task.title ? ( typeof task.title == 'string' ? task.title : task.title['#cdata-section'] || '' ) : '';
						    window.external.msSiteModeAddJumpListItem( taskTitle, task.link, options.defaultTaskIcon );

						    if ( pubDate > options.latestFeedItemDate ) {
							    newItems++;
							    options.latestFeedItemDate = pubDate;
						    }
					    }
                    } else if ( news.feed && news.feed.entry ) { // Atom feeds
					    for ( var items = news.feed.entry.slice(0, 10), numItems = items.length, i = numItems-1, task, pubDate, newItems = 0, taskTitle = '', link = {}; i >= 0; i-- ) {
						    task = items[i];
						    pubDate = Date.parse( task.published );
						    taskTitle = task.title ? ( typeof task.title == 'string' ? task.title : (task.title['#cdata-section'] ? task.title['#cdata-section'] : task.title['#text'] || '')) : '';

                            if ( task.link ) {
                                if ( typeof task.link == 'string') {
                                    link['@href'] = task.link || '#';
                                } else if ( Object.prototype.toString.call( task.link ) === '[object Array]') {
                                    link = task.link[0];
                                } else {
                                    link = task.link;
                                }
                            }

						    window.external.msSiteModeAddJumpListItem( taskTitle, link['@href'] || '#', options.defaultTaskIcon );

						    if ( pubDate > options.latestFeedItemDate ) {
							    newItems++;
							    options.latestFeedItemDate = pubDate;
						    }
                        }
                    }

					if ( options.notifications && newItems ) {
						window.external.msSiteModeSetIconOverlay('http://buildmypinnedsite.com/icons/overlays/star-notice.ico', numItems + ' unread items');
					}
				} catch ( ex ) {
				}

				window.external.msSiteModeShowJumpList();
			} else {
			}
		} catch ( ex ) {
		}

		window.setTimeout( ____prototype_ae_IE9JumpList.poll, options.pollInterval );
	}

	// Init code
	document.addEventListener('DOMContentLoaded', function() {

		try {
			document.getElementsByTagName('body')[0].onfocus = function() {
				window.external.msSiteModeClearIconOverlay();
			};
		} catch(err) {
		}

		var head = document.getElementsByTagName('head');

		if ( !head ) {
			return;
		}

		head = head[0];

		var links = document.getElementsByTagName('link'), remove = [];

		for ( var i = 0, rel; i < links.length; i++ ) {
			rel = links[i].getAttribute('rel');
			if ( !rel ) {
				continue;
			}
			rel = rel.toLowerCase().replace(/^\s+|\s+$/g, '').replace(/\s+/g, ' ');
			if ( rel == 'icon' || rel == 'shortcut icon' ) {
				remove.push( links[i] );
			}
		}

		for ( i = 0; i < remove.length; i++ ) {
			head.removeChild( remove[i] );
		}

		if ( options.shortcutIcon ) {
			head.appendChild( lib.dom.link('shortcut icon', options.shortcutIcon) );
		}

		head.appendChild( lib.dom.meta('application-name', options.applicationName) );
		head.appendChild( lib.dom.meta('msapplication-tooltip', options.tooltip) );

		if ( options.navButtonColor ) {
			head.appendChild( lib.dom.meta('msapplication-navbutton-color', options.navButtonColor) );
		}

		if ( options.startURL ) {
			head.appendChild( lib.dom.meta('msapplication-starturl', options.startURL) );
		}

		for ( var i = 0, task; i < options.staticTasks.length; i++ ) {
			task = options.staticTasks[i];
			head.appendChild( lib.dom.meta('msapplication-task', 'name=' + task.name + ';action-uri=' + task.action + ';icon-uri=' + task.icon + ';window-type=' + task.target ) );
		}
		if ( options.prompt && !window.external.msIsSiteMode() && sessionStorage.getItem('hideIE9SitePinningBar') != '1' ) {
			var bar = lib.dom.div();
			var barHTML = '<div style="border: 1px solid #E1E1E1; padding: 5px 9px 2px 9px; background: #fff url(http://buildmypinnedsite.com/PinImages/Bar/bar-background.png) repeat-x scroll 0 100%;"><table cellspacing="0" cellpadding="0" style="width: 100%; border: 0 none; border-collapse: collapse;"><tbody><tr><td><div style="background: transparent url(' + options.shortcutIcon.replace(/\.ico$/, ".png") + ') no-repeat scroll 0 3px; background-size: 20px 20px; width: 260px; padding-left: 26px; min-height: 30px; font-weight: bold; font-size:14px;">Experience ' + (options.barSiteName || options.siteName) + '  as a Pinned Site</div></td><td><div style="display: inline-block;padding-right: 40px; position: relative;text-align: right;"><strong style="font-weight: bold; font-size: 18px;">Drag this icon to your taskbar <img src="http://buildmypinnedsite.com/PinImages/Bar/arrow-icon.png" /></strong><div style="color:#797c85; font-size: 12px;">or, <a href="#" onclick="window.external.msAddSiteMode(); return false" style="color: #6CABBA; text-decoration: underline;">click here</a> to add this site to your start menu </div><div style="position: absolute; right:-120px; top: -13px; width: 164px; height: 143px; background: transparent url(http://buildmypinnedsite.com/PinImages/Bar/drag-icon-placeholder.png) no-repeat scroll 0 0;"><img class="msPinSite" style="position: absolute; top:17px; left:16px;cursor: move; width: 32px; height: 32px;" src="' + options.shortcutIcon.replace(/\.ico$/, ".png") + '" /></div></div></td><td><div style="position: relative; float: right; width: 80px; min-height: 30px; padding-left: 23px; padding-right: 30px; background: transparent url(http://buildmypinnedsite.com/PinImages/Bar/info-icon.png) no-repeat scroll 0 6px;"><a style="font-size: 12px; color: #6CABBA; text-decoration: underline;" href="http://www.beautyoftheweb.com/#/productguide/clean/seamless-with-windows-7" target="_blank">Learn about Site Pinning</a><div onclick="document.getElementById(\'___ie9sitepinning__bar_container\').style.display=\'none\';window.sessionStorage.setItem(\'hideIE9SitePinningBar\', \'1\')" style="background: transparent url(http://buildmypinnedsite.com/PinImages/Bar/close-button.png) no-repeat scroll 0 0;position: absolute;top: 0; right: 0;display: block; width: 18px; height: 18px; cursor: pointer; float: right;"></div></div></td></tbody></table></div>';
			bar.setAttribute('style', "position: absolute; top: 0; left: 20px; width: 95%; margin:0; padding:0; border: 0 none; border-bottom:1px solid #707070; color: #1c1f26; background: transparent none no-repeat scroll 0 0; font-family: 'Segoe UI', Arial, tahoma, sans-serif; line-height: 18px; box-shadow: 0 1px 5px rgba(140,140,140,0.7);");
			bar.id = '___ie9sitepinning__bar_container';
			bar.innerHTML = barHTML;
			document.getElementsByTagName('body')[0].appendChild( bar );
		}

		jumplist.poll = function() {
			lib.net.getJSONP( options.rssFeedURL, jumplist.parseRSSFeed );
		};

		window.setTimeout( jumplist.poll, 3 );
	});
})( ____prototype_ae_IE9JumpList );
