﻿$(document).ready(function() {

    // PNG fix
    $(document).pngFix();

    // Suckerfish
    $(".navigation").Suckerfish();

    // Banner innerfade
    $('ul#banner').innerfade({
        speed: 1000,
        timeout: 5000,
        type: 'sequence',
        containerheight: '238px'
    });

    $(".nav_bottom ul ul").each(function() {
        var itemcount = 0;

        $(this).find("li").hover(function() {
            itemcount = $(this).children("ul").children("li").length;
            $(this).children("ul").css("top", "-" + ((itemcount - 1) * 26) + "px");
        });
    });

    // Set the li width according to the parents width
    // $(".navigation li").hover(function(){
    //   var ParentWidth = $(this).find("ul").parents("li").width();
    //   if(ParentWidth)
    //  {            
    //      $(this).find("ul").find("li").width(ParentWidth);            
    //   }
    //});

    // Cut text
    //$(".navigation").each(function(){	    	    
    //    var Element = "<span>" + $(this).find("a").text() + "</span>";
    //    $(this).append(Element);
    //    
    //    var TextWidth = $(this).find("span").width();
    //    
    //    alert(TextWidth);
    //}); 
});

