/// <reference path="jquery-1.3.1-vsdoc.js" />
/// <reference path="swfobject-vsdoc.js" />
/// <reference path="sifr-vsdoc.js" />


$(document).ready(function() {


//$("#menu_level1").corner("10px 10px 10px 10px");


    $('.menu_top_item', this).hover(
      function() {
        $(".left_menu_top_item", this).css({ backgroundPosition: "0px" });
        $(".right_menu_top_item", this).css({ backgroundPosition: "0px" });
        $(".center_menu_top_item", this).css({ background: "#f7d806" });
      }
      ,
      function() {
        $(".left_menu_top_item", this).css({ backgroundPosition: "-200px" });
        $(".right_menu_top_item", this).css({ backgroundPosition: "-200px" });
        $(".center_menu_top_item", this).css({ background: "" });
      }
    );

      $('.menu_level1_div', this).hover(
      function() {
      $('.leftMenuImage', this).attr('src', 'text_images/menu_left_on_' + $('.leftMenuImage', this).attr("id"));
      //alert($('.leftMenuImage', this).attr("id"));
      }
      ,
      function() {
      $('.leftMenuImage', this).attr('src', 'text_images/menu_left_' + $('.leftMenuImage', this).attr("id"));
      }
    );








    //Set height of right_snarveier
    /*var main_height = $("#div_middle_center").height();
    var right_height = $("#right_doc_list").height();

    var prod_height = $("#prod_item").height();

    if (main_height != null && right_height != null && main_height > right_height) {
        document.getElementById('right_doc_list').style.height = main_height + 'px';
        document.getElementById('div_snarveier').style.height = main_height + 'px';
    }

    else if (prod_height != null && right_height != null && prod_height < right_height) {
        document.getElementById('prod_item').style.height = right_height + 'px';
        document.getElementById('div_middle_center').style.height = right_height + 'px';
    }


    var thisImg = "";
    var thisImg2 = "";*/


      //drop down right menu
    /*
    $('.btn-slide').bind("click", function() {
        $(".menu_" + this.id).slideToggle(300);

    });
    */

    // show/hide 'send forespørsel'
    /*
    $('.div_prodspes_top').bind("click", function() {
        $(".div_sendFor").slideToggle(300);

        if (($('.sendForButton').hasClass('sendForButton_on'))) {
            $('.sendForButton').removeClass('sendForButton_on');
            $('.div_prodspes_top').addClass('div_prodspes_top_on');
        }
        else {
            $('.sendForButton').addClass('sendForButton_on');
            $('.div_prodspes_top').removeClass('div_prodspes_top_on');
        }
    });

    myObject = null;
    */

    // drop down top menu ul
    /*
    $('.dropdown-menu', this).hover(
      function() {
      */



          // if ul is down
        /*
          if (($('.down-list', this).hasClass('isdown') || $('.topMenuImage', this).hasClass('showred')) && (myObject == this)) {

          }

          else {

              myObject = this;
              */

              // Make level 1 link red if not active
              //var img = $('.topMenuImage', this).attr("src");

              // store imagepath for mouse out
              //thisImg = img;

              // if not active
              /*
              if (img.indexOf("_on_") == -1) {

                  img = thisImg.replace(/0/g, "");
                  img = img.replace(/1/g, "");
                  img = img.replace(/2/g, "");
                  img = img.replace(/3/g, "");
                  img = img.replace(/4/g, "");
                  img = img.replace(/5/g, "");
                  img = img.replace(/6/g, "");
                  img = img.replace(/7/g, "");
                  img = img.replace(/8/g, "");
                  img = img.replace(/9/g, "");

                  img = img.substring(0, (img.length - 6));

                  var imageOn = img + "on_" + thisImg.substring(img.length, thisImg.length);

                  $('.topMenuImage', this).attr('src', imageOn);
              }


              $('.topMenuImage', this).addClass('showred');
              $('.down-list', this).addClass('isdown');
                */


              // if folder is set to drop down
              /*
              if (this.id == "dropdown") {
                  $('.down-list', this).slideDown(100);
              }
          }
      },
        function() {

            if ($('.down-list', this).hasClass('isdown') && $('.topMenuImage', this).hasClass('showred')) {

                testObj = $('.down-list', this);
                testObj2 = $('.topMenuImage', this);

                if (this.id == "dropdown") {
                    $('.down-list', this).slideUp(100);
                }

                if (thisImg != '') {
                    $('.topMenuImage', this).attr('src', thisImg);
                }

                thisImg = "";

*/
                // small pause
  /*              setTimeout("testObj.removeClass('isdown')", 100);
                setTimeout("testObj2.removeClass('showred')", 100);
            }
        }
    );
*/
      // li (level 2 link)
    /*
    $(".menuItem").hover(
        function() {

            var img = $('.topMenuImage2', this).attr("src");


            thisImg2 = img;

            if (img.indexOf("_on_") == -1) {


                img = thisImg2.replace(/0/g, "");
                img = img.replace(/1/g, "");
                img = img.replace(/2/g, "");
                img = img.replace(/3/g, "");
                img = img.replace(/4/g, "");
                img = img.replace(/5/g, "");
                img = img.replace(/6/g, "");
                img = img.replace(/7/g, "");
                img = img.replace(/8/g, "");
                img = img.replace(/9/g, "");


                img = img.substring(0, (img.length - 6));


                var imageOn = img + "on_" + thisImg2.substring(img.length, thisImg2.length);

                $('.topMenuImage2', this).attr('src', imageOn);
            }
        }
        ,
        function() {

            $('.topMenuImage2', this).attr('src', thisImg2);
        }
    );
    */
});