﻿$(function () {

    $('body.timetable #col-2 select').selectBox();

    if($(".current a").length > 0) {
        var $el, leftPos, newWidth;
        $mainNav2 = $("#nav ul");

        $mainNav2.append("<li id='magic-line-two'></li>");

        var $magicLineTwo = $("#magic-line-two");

        $magicLineTwo
            .width($(".current").width())
            .height($mainNav2.height() - 16)
            .css("left", $(".current a").position().left)
            .data("origLeft", $(".current a").position().left)
            .data("origWidth", $magicLineTwo.width())
            .data("origColor", $(".current a").attr("rel"));

        $("#nav a").hover(function () {
            $el = $(this);
            leftPos = $el.position().left - 1;
            newWidth = $el.parent().width();
            $magicLineTwo.stop().animate({
                left: leftPos,
                width: newWidth,
                backgroundColor: $el.attr("rel")
            })
        }, function () {
            $magicLineTwo.stop().animate({
                left: $magicLineTwo.data("origLeft") - 1,
                width: $magicLineTwo.data("origWidth"),
                backgroundColor: $magicLineTwo.data("origColor")
            });
        });
    }
    /* Kick IE into gear */
    $(".current a").mouseover();
//    
    $('#search, #pf_Email').labelize();
    
    
    $('body.home #strap img').imghover({suffix: '-hover'}); 
        
    $('body.home #reservation div.error a').live('click', function() {
        $('body.home #reservation div.error').fadeOut('fast');
        return false;
    });
    
    $('.labelize').labelize();
    
});


