//#### BEGIN THEMANAVIGATION (INSIDE VISUAL CORPORATE HOMEPAGE) FUNCTIONS ####//

  $(document).ready(function(){

     // find all the labels
     $(".themanav_label").each(function(){

      var label = $(this);															
      var data = eval("(" + label.children()[1].innerHTML + ")");
   
      //mouseover label change
      label.mouseover(function(){

        label.css({
          "background-image": "none"
        });
      });

      //mouseout label change
      label.mouseout(function(){

        label.css({
          "background-image": "url(" + data.labelImg + ")"
        });
      });

     });
  });

//#### END THEMANAVIGATION (INSIDE VISUAL CORPORATE HOMEPAGE) FUNCTIONS ####//


//#### BEGIN "Dropdown linkmodule" FUNCTIONS ####//

  $(document).ready(function(){

    // find linkmodules which need to be transformed into dropdown lists
    $(".linkmodule").filter(".dropdown").each(function(){     
      
      //get JSON array for the dropdown options
      var linkmodule = $(this);      
      var data = eval("(" + linkmodule.children()[0].innerHTML + ")");
      
      var dropdownOptions = "";
      
      //build options
      for(i in data){
      
        dropdownOptions += "<option value=\"" + data[i].value + "\" title=\"" + data[i].title + "\">" + data[i].label + "</option>";
      }

      if(dropdownOptions != ""){
        
        //add select field to linkmodule
        $(this).append("<select>" + dropdownOptions + "</select>");
        var dropdown = $("select",this);

        //add onchange event
        dropdown.bind("change", function(){
          document.location.href = dropdown.attr("value");
        });
      }
    });
  });

//#### END "Dropdown linkmodule" FUNCTIONS ####//



//#### BEGIN DROPDOWN MENU FUNCTIONS ####//

  $(document).ready(function(){

    //this function is required for IE6
    if(($.browser.msie)&&($.browser.version.substr(0,1) <= 6)){

      // only get objects inside topmenu
      $("#topmenu").each(function(){  
      
        //each list item
        $(".parent",this).each(function(){  

          var item = $(this);
        
          //on mouseover show child UL
          item.mouseover(function(){
 
            $("ul",this).css({
              "visibility": "visible",
              "overflow": "visible"
            });

            $(this).addClass("hover");
          });

          //on mousout hide child UL
          item.mouseout(function(){

            $("ul",this).css({
              "visibility": "hidden",
              "overflow": "hidden"
            });

            $(this).removeClass("hover");
          });
        });
      });
    }
  });

//#### END DROPDOWN MENU FUNCTIONS ####//
