$j(function() {

    //    $j('#phcontent_0_phmaincolumn_0_txtQuery').keyup(function(event) {
    //        if (event.keyCode == '13') {
    //            event.preventDefault();
    //            if ($j("#phcontent_0_phmaincolumn_0_txtQuery").attr("value") !== null)
    //                location.href = "/sok.aspx?q=" + $j("#phcontent_0_phmaincolumn_0_txtQuery").attr("value");
    //            return false;
    //        }
    //    });

    $j("#searchbuttonfront").click(function() {
        location.href = "/sok.aspx?q=" + $j("#searchboxfront").attr("value");
        return false;
    });

    $j('#sokeordQandA').keyup(function(event) {
        if (event.keyCode == '13') {
            event.preventDefault();
            location.href = "/sok.aspx?q=" + this.value;
        }
    });


    $j('#searchbox').keyup(function(event) {
        if (event.keyCode == '13') {
            event.preventDefault();
            location.href = "/sok.aspx?q=" + this.value;
            return false;
        }
    });

    $j("#searchbutton").click(function() {
        location.href = "/sok.aspx?q=" + $j("#searchbox").attr("value");
        return false;
    });

    $j('#searchboxfront').keyup(function(event) {
        if (event.keyCode == '13') {
            event.preventDefault();
            location.href = "/sok.aspx?q=" + this.value;
            return false;
        }
    })

    $j('#sokeordsubmitQandA').click(function() {
        location.href = "/sok.aspx?q=" + $j("#sokeordQandA").attr("value");
        return false;
    });

    $j(function() {
        $j(".effect-button").each(function() {
            $j(this).etpButtonHover("effect-button-hover");
        });
    });

    $j(".EmployeeMail").click(function() {
        alert("hei");
    });

    $j(function() {
        $j('span.mailme').each(function() {
//            var spt = $j('span.mailme');
            var at = / at /;
            var dot = / dot /g;
            var addr = $j(this).text().replace(at, "@").replace(dot, ".");
            $j(this).after('<a href="mailto:' + addr + '" title="Send an email">' + addr + '</a>').hover(function() { window.status = "Send a letter!"; }, function() {
                window.status = "";
            });
            $j(this).remove();
        });
    });

});


(function($) {

    var classToToggle = "c_bluebuttonhover";

    // Visitnorway, button - hover
    $.fn.etpButtonHover = function(className) {
        if (className) { classToToggle = className; }

        $(this)
      .mouseover(function() { $(this).etpToogleClass(classToToggle); })
      .mouseout(function() { $(this).etpToogleClass(classToToggle); });
    }

    $.fn.etpToogleClass = function(className) {
        if (className) { classToToggle = className; }
        $(this).toggleClass(classToToggle);
    }

    // IE6 - dropdown
    $.fn.etpIE6DropDownMenu = function() {
        $("ul > li", $(this)).each(function() {
            $(this)
      .mouseover(function() { $(this).addClass("sfhover"); })
      .mouseout(function() { $(this).removeClass("sfhover"); });
        });
    }

    $.fn.test = function() { alert("testfunc"); }

})(jQuery);


