﻿$(document).ready(function(){

    // Designfix för Fx2
    if( $.browser.version == "1.8.1.14" && $.browser.mozilla )
        $("#AreaTop ul li a").css({ padding: "6px 3px 9px 0px" });
        
        
    // Designfix för Safari
    if( $.browser.safari )
    {
        $("#AreaTop ul li a").css({ padding: "7px 3px 11px 0px" });
        $("body").css({ fontSize: "10px" });
        $("#AreaBottom span").css({ marginTop: "-12px" });
    }
    
    // Designfix för Fx på Mac
    var isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false; 
    if( $.browser.mozilla && isMac )
    {
        $("#AreaTop ul li a").css({ padding: "7px 3px 9px 0px" });
    }
});

// Textscroll till förstasidan
var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline = 0;

$(document).ready(function(){
  headline_count = $("div.headline").size();
  $("div.headline:eq("+current_headline+")").css('top', '5px');
  headline_interval = setInterval(headline_rotate,5000);
  $('#scrollup').hover(function() {
    clearInterval(headline_interval);
  }, function() {
    headline_interval = setInterval(headline_rotate,5000);
    headline_rotate();
  });
});
function headline_rotate() {
  current_headline = (old_headline + 1) % headline_count;
  $("div.headline:eq(" + old_headline + ")")
    .animate({top: -20},"slow", function() {
      $(this).css('top', '20px');
    });
  $("div.headline:eq(" + current_headline + ")")
    .animate({top: 5},"slow");
  old_headline = current_headline;
}

// Popupfönster med fast storlek
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

//Jumpmenu på förstasidan
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
// -->