<? $mini_version = isset($mini_version) ? $mini_version : false; ?>
<? if ($mini_version) { ?>
<script type="text/javascript" src="<? echo $static_url ?>/r<? echo $mini_version ?>/js/base.min.js"></script>
<? } else { ?>
<script type="text/javascript" src="<? echo $static_url ?>/js/jquery.min.js"></script>
<script type="text/javascript" src="<? echo $static_url ?>/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="<? echo $static_url ?>/js/jquery.form.min.js"></script>
<script type="text/javascript" src="<? echo $static_url ?>/js/jquery.jcarousellite.min.js"></script>
<script type="text/javascript" src="<? echo $static_url ?>/js/jquery.autocomplete.min.js"></script>

<script type="text/javascript" src="<? echo $static_url ?>/js/core.js"></script>
<script type="text/javascript" src="<? echo $static_url ?>/js/swiper.min.js"></script>
<script type="text/javascript" src="<? echo $static_url ?>/js/markerclusterer_compiled.js"></script>
<script type="text/javascript" src="<? echo $static_url ?>/js/main.js"></script>
<script type="text/javascript" src="<? echo $static_url ?>/js/map.js"></script>
<script type="text/javascript" src="<? echo $static_url ?>/js/rating.js"></script>
<script type="text/javascript" src="<? echo $static_url ?>/js/fit_calculator.js"></script>
<? } ?>
<script type="text/javascript">
    function load_poll(url) {
        $.ajax({
            url: url,
            success: function(html) {
                $('#poll_widget').html(html).find('a').click(function() {
                    load_poll($(this).attr('href'));
                    return false;
                });
                $('#poll_widget form[name=forum_poll]').ajaxForm({
                  success: function(html) {
                    $('#poll').html(html).find('a').click(function() {
                      load_poll($(this).attr('href'));
                      return false;
                    });
                  }
                });
            }
        });
    }

    if ($('#poll_widget').length > 0) {
        load_poll("<? echo $main_site_url . '/cgi-bin/poll.cgi' ?>");
    }

    /* load editor's threads pick */
    if ($('.widget-threads').length > 0) {
        $('.widget-threads').each(function() {
            var container = $(this).find('.list');
            $.ajax({
               url: "<%config.db_cgi_url%>/threads.cgi?id=" + container.attr('data'),
               success: function(html) {
                   container.html(html);
               }
            })
        });
    }
    
    $(document).ready(function() {
        $('#roadshow-btn').click(function() {
            $('#appform').dialog({
                resizable: 'auto',
                height: 600,
                width: 620,
                modal: true
            })
            return false;
        })
    })
</script>
<script type="text/javascript">
    setTimeout(
      function() {
        AdvertInteractiveRegistry.forEach(
          function(el){if (el.tagId === 'WallpaperAd'){el.finishViewableTimeTracking()}}
        );
        var wallpaper = document.getElementById('WallpaperAd');
        if (wallpaper) { wallpaper.parentNode.parentNode.removeChild(wallpaper.parentNode); }
        var shim = document.getElementById('WallpaperShim');
        if (shim) { document.body.removeChild(shim); }
        var pushdown = document.getElementById('WallpaperPushdown');
        if (pushdown) { document.body.removeChild(pushdown); }
        _avp.push({ tagid: 'avp_zid_106', alias: '/', type: 'wallpaper', zid: 106, pid: 0, secure: true });
        AVP.load();
      },
      30000
    );
</script>