﻿// Google analytics async tracking
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-15016258-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 
 })(); 

// /01/Default.aspx
$(document).ready(function() {
    var t = 1;
    $("#menu ul.lvl2").hide().each(function() { $(this).attr("id", "sub_" + t++); });

    $("#menu li.lvl1:has(ul.lvl2)").hover(
                                   function() { if ($('ul.lvl2', this)[0].hideTimeout) { clearTimeout($('ul.lvl2', this)[0].hideTimeout); }; $('ul.lvl2', this).removeClass("pleaseremove").show(); },
                                       function() {
                                           $('ul.lvl2', this).addClass("pleaseremove");

                                           var myId = $('ul.lvl2', this).attr("id");

                                           $('ul.lvl2', this)[0].hideTimeout = setTimeout(function() { $('#' + myId).hide(); }, 200);
                                       });

    $("#menu li.lvl1:last").addClass('nostripe');

    $("#news").shuffle();
    $("#news").newsticker();

    var imgs = $("img");

    $.each(imgs, function() {
        if ($(this).attr("title") == "") {
            if ($(this).attr("alt") != "")
                $(this).attr("title", $(this).attr("alt"));
        }
    });
});
