
    function printfire()
    {
        if (document.createEvent)
        {
            printfire.args = arguments;
            var ev = document.createEvent("Events");
            ev.initEvent("printfire", false, true);
            dispatchEvent(ev);
        }
    }


    if ( document.location.href.indexOf( 'totalcar.hu' ) > -1 ) { document.domain = 'totalcar.hu'; }
    else
    {
        if ( document.location.href.indexOf( 'totalbike.hu' ) > -1 )
        {
          if ( document.location.href.indexOf( 'szerk.totalbike.hu' ) > -1 ) { document.domain = 'szerk.totalbike.hu'; }
          else { document.domain = 'totalbike.hu'; }
        }
//        if ( document.location.href.indexOf( 'nepitelet.hu' ) > -1 ) { document.domain = 'nepitelet.hu'; }
//        if ( document.location.href.indexOf( 'karotta.hu' ) > -1 ) {}
//        else if ( document.location.href.indexOf( 'forum.index.hu' ) <= -1 ) { document.domain = 'index.hu'; }
    }

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

    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 );
        obj = null
        try { obj = new ActiveXObject("microsoft.XMLHTTP"); } catch(e) {}
        this.notie = ( obj == null );
    }

    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 )
    {
        document.write( '<img class="pixel" src="http://audit.median.hu/cgi-bin/track.cgi?uc=' + ucm + '&amp;dc=' + ( ( where == 'top' ) ? 1 : 2 ) + '&amp;ui=' + audit_same + '" alt="" />' );
        if ( uct )
        {
            var params = new Array();
            params.push( 'uc='+ uct );
            params.push( 'sd='+ screen.width +'x'+ screen.height );
            if ( screen.colorDepth != 'undefined' ) { params.push( 'cd='+ screen.colorDepth ); }
            var referrer = encodeURIComponent ? encodeURIComponent( document.referrer ) : escape( document.referrer );
            if ( referrer != '' ) { params.push( 'rp='+ referrer ); }
            params.push( 'ui='+ same );
            document.write( '<img class="pixel" src="http://pixel.' + document.domain + '/12g?' + params.join( '&amp;' ) + '" alt="" />' );
        }
    }

    function banner( ade_lc, bhely_id, width, height, margin_top, margin_bottom, co )
    {
        if ( co == undefined ) { co = 1; }
        document.write( '<div style="margin-top: ' + margin_top + 'px; margin-bottom: ' + margin_bottom + 'px;">' );
        if ( is.iframe )
        {
            document.write( '<iframe name="indexadengineframe' + same + '" src="http://' + adshost + '.' + 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>' );
        } else {
            document.write( '<a target="_top" href="http://' + adshost + '.index.hu/rd?lc=' + ade_lc + '&ui=' + indexadengineui + '"><img src="http://' + adshost + '.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, 'TotalCarKepek', 'scrollbars=no,resizable=yes,menu=no,width=900,height=700' );
        return false;
    }

    function huge( o )
    {
        window.open( o.href + '&currpic=' + o.childNodes[0].src, 'TotalCarKepek', 'scrollbars=no,resizable=no,menu=no,width=1024,height=768' );
        return false;
    }

    function select_redirect( o )
    {
        if ( o.value != '' ) { document.location.href = o.value; }
    }

    suckerfish4prez = function()
    {
        text_node = document.getElementById("text");
        if ( text_node != null )
        {
            var sfEls = text_node.getElementsByTagName("a");
            for (var i=0; i<sfEls.length; i++)
            {
                sfEls[i].onmouseover=function() { this.className+=" hover"; }
                sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" hover\\b"), ""); }
            }
        }
    }

    if (window.attachEvent) window.attachEvent("onload", suckerfish4prez);

    function getXMLHTTP()
    {
        ver = navigator.appVersion;
        app = navigator.appName;
        isNS = Boolean(navigator.productSub)
        isIE = (ver.indexOf("MSIE 5") != -1 || ver.indexOf("MSIE 6") != -1) ? 1 : 0;
        obj = null;

        try { obj = new ActiveXObject("microsoft.XMLHTTP"); }
        catch(e) { try { obj = new XMLHttpRequest(); } catch(e) {} }

        return obj;
    }

    function load( destid, url, host )
    {
        xmlhttp = new xmlRequest();
        xmlhttp.getURL( url, destid, host );
    }

    function xmlRequest()
    {
        if ( !this.http ) { this.http = getXMLHTTP(); this.xmlhttp = 1; }
        if ( !this.http )
        {
            this.http = document.createElement( 'iframe' );
            this.http.style.width = 0;
            this.http.style.height = 0;
            this.http.style.visibility = 'hidden';
            document.getElementsByTagName( "body" ).item( 0 ).appendChild( this.http );
            this.xmlhttp = 0;
        }

        this.getURL = function getURL( url, destid, host )
        {
            this.destid = destid;
            this.prepare( url, host );
            this.send();
        }

        this.prepare = function prepare( url, host )
        {
            this.url = url;
            if ( this.xmlhttp )
            {
                var myRequest = this;

//                this.url = 'http://' + ( is.notie ? document.domain : host ) + this.url;
                this.http.open( "GET", this.url, true );
                this.http.onreadystatechange = function ()
                {
                    if (myRequest.http.readyState === 4)
                    {
                        document.getElementById( myRequest.destid ).innerHTML = myRequest.http.responseText;
                    }
                }
            }
            else { this.http.setAttribute( 'name', this.destid ); }
        }

        this.send = function send()
        {
            if ( this.xmlhttp ) { this.http.send( '' ); }
            else { this.http.src = this.url + '&destid=' + this.destid; this.http.style.display = 'none'; }
        }
    }

    function receive( destid, data )
    {
        document.getElementById( destid ).innerHTML = data;
    }

    window.onload = function initsticky()
    {
        sticky = document.getElementById('sticky');
        if ( sticky != null )
        {
            topa = ( (window.innerHeight) ? window.innerHeight : document.documentElement.clientHeight ) - bannerheight;
            if ( window.innerHeight && window.innerWidth < 970 ) { topa = topa - 16; }
            sticky.style.top = topa  + 'px';
            sticky.style.display = '';
            temp = setTimeout('movesticky()', 10);
        }
    }

    if (window.attachEvent) window.attachEvent("onload", suckerfish4prez);

    var theTop;
    var sticky;
    var bannerheight = 50;

    function movesticky()
    {
        if ( window.pageYOffset != undefined ) { scrollpos = window.pageYOffset; }
        else if ( document.compatMode == 'BackCompat' ) { scrollpos = document.body.scrollTop; }
        else { scrollpos = document.documentElement.scrollTop; }
        if ( sticky.style.position == "absolute" )
        {
            topa = ( window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ) - bannerheight + scrollpos;
            if ( window.innerHeight && window.innerWidth < 970 ) { topa = topa - 16; }
            sticky.style.top = topa  + 'px';
        }
        else
        {
            topa = ( (window.innerHeight) ? window.innerHeight : document.documentElement.clientHeight ) - bannerheight;
            if ( window.innerHeight && window.innerWidth < 970 ) { topa = topa - 16; }
            sticky.style.top = topa + 'px';
        }
        temp = setTimeout('movesticky()', 0);
    }

    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 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 sh( o )
    {
        o.style.display = o.style.display == 'none' ? '' : 'none';
    }


    var menuTimeout = 0;
    function display_menu( elementname, aktiva )
    {
        tbmenu_ul = document.getElementById("tbmenu");
        almenu_div = document.getElementById("almenu");
        if ( aktiva != null || aktiva == 'cimlap' )
        {
          document.getElementById( 'ma'+ elementname ).className = '';
          document.getElementById( 'am'+ elementname ).style.display = 'none';
          if ( aktiva != 'cimlap' && aktiva != '' )
          {
            document.getElementById( 'am'+ aktiva ).style.display = 'block';
            document.getElementById( 'ma'+ aktiva ).className = 'active';
          }
        }
        else
        {
          if ( menuTimeout )
          {
            clearTimeout( menuTimeout );
          }
        }

        if ( ( tbmenu_ul != null && aktiva == null ) || ( tbmenu_ul != null && aktiva == '' ) )
        {
            var menu_items = tbmenu_ul.getElementsByTagName("a");
            var almenu_items = almenu_div.getElementsByTagName("a");
            for (var i=0; i<menu_items.length; i++)
            {
              if ( elementname != menu_items[i].name )
              {
                document.getElementById( 'ma'+ menu_items[i].name ).className = '';
                document.getElementById( 'am'+ menu_items[i].name ).style.display = 'none';
              }
              else
              {
                document.getElementById( 'am'+ menu_items[i].name ).style.display = 'block';
                document.getElementById( 'ma'+ menu_items[i].name ).className = 'active';
              }
            }
        }
    }

    function confirmDelete( delUrl ) {
      if (confirm("Biztos törlöd?")) {
        window.open( delUrl,'KepekDel', 'scrollbars=yes,resizable=yes,menu=no,width=640,height=480');
      }
      else
      {
      return false;
      }
    }

   function event_attach( event , func )
   {
     if ( window.attachEvent )
     {
       window.attachEvent( event , func );
     }
     else
     {
       if ( ( typeof( func ) ).toLowerCase() != 'function' )
       {
         return;
       }
       if ( ( typeof( document.event_handlers ) ).toLowerCase() == 'undefined' )
       {
         document.event_handlers = new Array();
       }
       if ( ( typeof( document.event_handlers[ event ] ) ).toLowerCase() == 'undefined' )
       {
         document.event_handlers[ event ] = new Array();
       }
       if ( ( typeof( eval( 'window.' + event ) ) ).toLowerCase() != 'function' )
       {
         eval( 'window.' + event + ' = function () { if ( ( typeof( document.event_handlers[ \'' + event + '\' ] ) ).toLowerCase() != \'undefined\' ) { for ( var i = document.event_handlers[ \'' + event + '\' ].length - 1 ; i >= 0  ; i-- ) { document.event_handlers[ \'' + event + '\' ][ i ](); } } } ' );
       }
       document.event_handlers[ event ][ document.event_handlers[ event ].length ] = func;
     }
   }

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

	WEBAUDIT=function() {
	    
	  this.WACID=null;
	  this.WACIDName="WACID";
	  
	  
	  this.getCookie=function(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;
	  }
	  
	  this.setCookie=function(name,value,topDomain) {
	    var date = new Date(2020,12,31,23,59,59);
	    var expires = "; expires="+date.toGMTString();
	    document.cookie = name+"="+value+expires+"; path=/; domain=" + topDomain;  
	  }
	  
	  this.generateID=function(splitter) {
	    var sp=(splitter) ? splitter : 'A';
	    var now=new Date();
	    return Date.parse(now.toGMTString()) + sp + Math.floor(Math.random()*1000000000);
	  }
	  
	  this.getTopDomain=function(fullDomain) {
	    var darabok=fullDomain.split('.');
	    return darabok[(darabok.length-2)] + '.' + darabok[(darabok.length-1)];
	  }
	  
	  this.getDomain=function(url) {
	    var urlDarabok=url.split('/');
	    return urlDarabok[2];
	  }
	  
	  this.WACID=this.getCookie(this.WACIDName);
	}	

    var wa=new WEBAUDIT();
    var felbontas = "";
    var audit_same =  Math.floor(Math.random()*1000000);
    var wa_url = "@u=";
    var wa_referrer = "@r=";

    if(wa.WACID==null)
    {
      wa.WACID=wa.generateID('A');
      wa.setCookie(wa.WACIDName,wa.WACID,wa.getTopDomain(wa.getDomain(document.URL)));
    }

    audit_same = audit_same + "@c=" + wa.WACID;
    if(screen) felbontas='@s='+screen.width+'x'+screen.height;
    if(document.referrer) wa_referrer=wa_referrer+document.referrer;
    if(document.URL) wa_url=wa_url+document.URL;
    audit_same = audit_same + felbontas + wa_url + wa_referrer;
