        $('.accordion1').hSlides({
            totalWidth: 780,
            totalHeight: 130,
            minPanelWidth: 90,
            maxPanelWidth: 290,
            midPanelWidth: 130,
            eventHandler: 'hover',
            activeClass: 'faceactive'
          , onEnter: function(){ $(this).css('background-color', '#ffffff').addClass("faceactive"); }
          , onLeave: function(){ setTimeout("$('#" + $(this).attr("id") + "').css('background-color', 'transparent')", 500); }
        });

    // Fix heights for IE 6 ( Before document.ready() )
    if ($('#ie6').length) {
        var content = $('#content');
        if (!content.length) { content = $('#homecontent'); }
        if (content.length) {
            var minheight = parseInt($('#menu').css('min-height')) || 445;
            content.height(Math.max(content.height(), minheight));
            $('#menu').height(Math.max(content.height() + 4, minheight));
        }
    }

    function setActiveStyleSheet(title) {
        var i, a, main;
        for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
            if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
                a.disabled = true;
                if (a.getAttribute("title") == title) a.disabled = false;
            }
        }
    }

    function getActiveStyleSheet() {
        var i, a;
        for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
            if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
        }
        return null;
    }

    function getPreferredStyleSheet() {
        var i, a;
        for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
            if (a.getAttribute("rel").indexOf("style") != -1
     && a.getAttribute("rel").indexOf("alt") == -1
     && a.getAttribute("title")
     ) return a.getAttribute("title");
        }
        return null;
    }

    function createCookie(name, value, days) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
            var expires = "; expires=" + date.toGMTString();
        }
        else expires = "";
        document.cookie = name + "=" + value + expires + "; path=/";
    }

    function readCookie(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;
    }

    function pipeMenu(id, nameUrlArray, activeurl) {
      menuScript(id, nameUrlArray, activeurl, '|');
    }
  
    function breadcrumb(id, nameUrlArray, activeurl) {
      menuScript(id, nameUrlArray, activeurl, '>');
    }

    function menuScript(id, nameUrlArray, activeurl, separator) {
        // Set menu
        var menu = $("#" + id);
        if (menu.length) {
            var code = "";
            var first = true;
            for (var item in nameUrlArray) {
                if (!first) {
                    code += "&nbsp;" + separator + "&nbsp;";
                } else {
                    first = false;
                }
                code += "<a ";
                if (nameUrlArray[item][0] == activeurl) {
                    code += " class=\"active\"";
                }
                code += "href=\"" + nameUrlArray[item][0] + "\" title=\"" + nameUrlArray[item][1] + "\">" + nameUrlArray[item][1] + "</a>";
            }
            menu.html(code);
        }
    }
 
  // nameUrlArray = [[DisplayName],[url],[Optional colorcode]]
    function menuListScript(id, nameUrlArray, activeurl, separator) {
        // Set menu
        var menu = $("#" + id);
        if (menu.length) {
            var code = "<ul>";
            var first = true;
            for (var item in nameUrlArray) {
                if (!first && separator) {
                  code += "<li>" + separator + "</li>";
                } else {
                    first = false;
                }
                code += "<li><a ";
                if (nameUrlArray[item][0] == activeurl) {
                    code += " class=\"active\"";
                }
                if (nameUrlArray[item][2]) {
                  code += " style=\"color:#"+nameUrlArray[item][2]+"\"";
                }
                code += "href=\"" + nameUrlArray[item][0] + "\" title=\"" + nameUrlArray[item][1] + "\">" + nameUrlArray[item][1] + "</a></li>";
            }
          code += "<ul>";
            menu.html(code);
        }
    }
 
  function infoClick(idBox, idTo) {
    // Reset active menu item
    $("#infoboxes li").removeClass("active");
    // Set active infobox
    $(idBox).addClass("active");
    $('#content').html($(idTo).html());
    $('#movie').change();
    return false;
  }
    
  function openLink(url, title){
    if (title.length > 0) // new window
      window.open(url, title.replace(/\W*/g, ""));
    else // current window
      window.location = url;
  }


  window.onload = function (e) {
      var cookie = readCookie("style");
      var title = cookie ? cookie : getPreferredStyleSheet();
      setActiveStyleSheet(title);
  }

  window.onunload = function (e) {
      var title = getActiveStyleSheet();
      createCookie("style", title, 365);
  }

  $(document).ready(function () {

      // Retrieve font size from cookie
      var cookie = readCookie("style");
      var title = cookie ? cookie : getPreferredStyleSheet();
      setActiveStyleSheet(title);

      // IE 6, 7 and 8 fixes
      if ($.browser.msie) {
          // IE 7 (and 8?) do not understand :last-child.
          $('.accordion1 li:last-child, .accordion1 li:last-child div', $('#header'))
              .css('border-radius', '0 25px 25px 0')
              .css('behavior', 'url(/css/PIE.htc)');

          if ($('#ie6').length) {
              $('.accordion1 li:first-child, .accordion1 li:first-child div', $('#header'))
                  .css('border-radius', '25px 0 0 2px')
                  .css('behavior', 'url(/css/PIE.htc)');
      }
    }

    $('#menu > ul > li').hoverIntent({
      over: function(){
          if ($(this).attr('class') != 'active'){
              $('ul', this).slideDown('slow');
          }
      },
    out: function(){}
    });
});

