    var indexadengineui = Math.round( Math.random() * 10000000 );
    var same = indexadengineui;

    function fix( a ) { a.href = a.href.replace( /NEMSPA_M./g, "" ); return true; }

    function stat( a, b )
    {
        if ( b ) { window.status = a.href.replace( /NEMSPA_M./g, "" ); }
        else { window.status = ""; }
    }

    function Is()
    {
        //browser leválogatás
        agent = navigator.userAgent.toLowerCase();
        this.agent = navigator.userAgent.toLowerCase();
        this.major = parseInt(navigator.appVersion);
        this.minor = parseFloat(navigator.appVersion);
        this.ns = ( ( agent.indexOf( 'mozilla' ) != -1 ) && ( ( agent.indexOf( 'spoofer' ) == -1 ) && ( agent.indexOf( 'compatible' ) == -1 ) ) );
        this.ns4 = ( this.ns && ( this.major <= 4 ) && ( this.minor < 5 ) );
        this.ns6 = ( this.ns && ( this.major >= 5 ) );
        this.opera = ( agent.indexOf( 'opera' ) != -1 );
        this.opera6 = ( this.major >= 6 );
        this.ie = ( agent.indexOf( "msie" ) != -1 );
        this.ie4 = ( this.ie && ( this.major == 4 ) && ( agent.indexOf( "msie 5.0" ) == -1 ) );
        this.ie5 = ( this.ie && ( this.major == 4 ) && ( agent.indexOf( "msie 5" ) != -1 ) );
        this.ie6 = ( this.ie && ( this.major == 4 ) && ( agent.indexOf( "msie 6" ) != -1 ) );
        this.ie7 = ( this.ie && ( this.major == 4 ) && ( agent.indexOf( "msie 7" ) != -1 ) );
        this.iframe = ( this.ie || this.ns6 || this.opera6 );
        this.popup = ( this.ie || this.ns6 || this.opera6 );
        this.layer = ( this.ie || this.ns6 );
    }

    var is = new Is();

    function getCookie(NameOfCookie)
    {
        if (document.cookie.length > 0)
        { 
            begin = document.cookie.indexOf( NameOfCookie + "=" ); 
            if (begin != -1)
            {
                begin += NameOfCookie.length + 1; 
                end = document.cookie.indexOf( ";", begin);
                if ( end == -1 ) { end = document.cookie.length; }
                return document.cookie.substring( begin, end );
            } else { return null; }
        }
    }

    function setCookie( NameOfCookie, expiredays )
    {
        var value = getCookie( NameOfCookie );
        if (!value) { value = 0;}
        if ( parseInt(value) <= maxMegjelenes )
        {
            value = parseInt( value ) + 1;
            var ExpireDate = new Date ();    
            ExpireDate.setTime( ExpireDate.getTime() + ( expiredays * 24 * 3600 * 1000 ) );
            document.cookie = NameOfCookie + "=" + escape( value ) + ";path=/" + ( ( expiredays == null ) ? "" : "; expires=" + ExpireDate.toGMTString() );
        }
        return value;
    }

    function incCookie( NameOfCookie, expirehours )
    {
        var ExpireDate = new Date ();    
        var value = getCookie( NameOfCookie );
        if (!value) { value = 1; } else { value = parseInt( value ) + 1; }
        ExpireDate.setTime( ExpireDate.getTime() + ( expirehours * 3600 * 1000 ) );
        document.cookie = NameOfCookie + "=" + escape( value ) + ( ( expirehours == null ) ? "" : "; expires=" + ExpireDate.toGMTString() );
        return value;
    }
    
    function webaudit( ucm, uct, where, name, auditid )
    {
        document.write( '<img' + ( ( auditid != undefined ) ? ' id="' + auditid + '"' : '' ) + ' class="pixel" src="http://audit.median.hu/cgi-bin/track.cgi?uc=' + ucm + '&amp;dc=' + ( ( where == 'top' ) ? 1 : 2 ) + '&amp;ui=' + audit_same + '" alt="" />' );
//        document.write( '<img class="pixel" src="http://audit.median.hu/cgi-bin/track.cgi?uc=' + ucm + '&amp;dc=' + ( ( where == 'top' ) ? 1 : 2 ) + '&amp;ui=' + same + '" alt="" /><img class="pixel" src="http://traffic.index.hu/cgi-bin/audit/track.cgi?uc=' + uct + '&amp;dc=' + ( ( where == 'top' ) ? 1 : 2 ) + '&amp;ui=' + same + '" alt="" />' );
    }

    function 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://sher.' + document.domain + '/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://sher.index.hu/rd?lc=' + ade_lc + '&ui=' + indexadengineui + '"><img src="http://sher.index.hu/ad?lc=' + ade_lc + '&amp;ui=' + indexadengineui + '" border="0" height="' + height + '" width="' + width + '"></a>' );
            document.write( '</div>' );
        }
    }


    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 real_DoCommand( command, id, click_url )
    {
        switch ( command )
        {
            case 'hide' : document.getElementById( id + '_container' ).style.visibility = 'hidden'; break;
            case 'click' : window.open( 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://sher.' + document.domain + '/get?ad=' + swf_url + '&dl=1&dt=swf&di=1'; }
                    if ( !isNaN( click_url ) ) { click_url = 'http://sher.' + 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://sher.' + 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;
                    }
                }
            }
        }
    }

