function init() {
  fixTargets();
} /*init*/
//==============================================================================
//
//==============================================================================
/**
 * This function fires when the user clicks
 * a sub menu header. It will collapse the
 * current submenu section, and expand
 * the new one.
 * @author patsko, webbstudion
 * @param {Object} el The header.
 */
function colapseMenu(el) {
  var _items = $('li > strong');
  _items.each( function(i) {
    if( _items[i] != el ) {
      $(_items[i]).next().slideUp("fast");
    }
  });
  $(el).next().slideToggle('fast');
} /*colapseMenu*/
//==============================================================================
//
//==============================================================================
/**
 * This method will fix all the targets of forms
 * and anchor-tags. This is to keep the documents
 * XHTML 1.0 strict valid. Because the target-
 * attribute is not used in Strict.
 * @author patsko, webbstudion
 */
function fixTargets() {
  var _anchors = document.getElementsByTagName("a");
  var _forms   = document.getElementsByTagName("form");
  var i = 0;

  for( i=_anchors.length-1; i>=0; i--) {
    if ( _anchors[i].name === "blank" ) {
      _anchors[i].target = "_blank";
    }
  }

  delete _anchors;
  delete _forms;
} /*fixTargets*/

// Fulhakk för att IE6 är en sån jävla svettig cpbrowser
$(document).ready(function(){
  if( ($.browser.msie) && ($.browser.version == 6) ) {
    $('div#layoutMenu').bind("click", function(e){
      var x       = e.pageX;
      var y       = e.pageY;
      var el      = $('div#layoutMenu');
      var offset  = el.offset();
      x = x - offset.left;

      if (((x >= 43)  && (x <= 137)) && ((y >= 122) && (y <= 150))){window.location.href = "/sport.asp";}
      if (((x >= 142) && (x <= 235)) && ((y >= 122) && (y <= 150))){window.location.href = "/sundbyholm.asp";}
      if (((x >= 240) && (x <= 363)) && ((y >= 122) && (y <= 150))){window.location.href = "/intresse.asp";}
      if (((x >= 367) && (x <= 471)) && ((y >= 122) && (y <= 150))){window.location.href = "/arrangemang.asp";}
      if (((x >= 475) && (x <= 579)) && ((y >= 122) && (y <= 150))){window.location.href = "/restauranger.asp";}
      if (((x >= 583) && (x <= 651)) && ((y >= 122) && (y <= 150))){window.location.href = "/kontakt.asp";}
      if (((x >= 655) && (x <= 753)) && ((y >= 122) && (y <= 150))){window.location.href = "/start.asp";}
    });
  }
});
