/**
 * @author Diana Muigg (dianimation)
 */

$(document).ready(function () {


  $('#hg')
		.animate({ opacity: 0.0}, 0 )
		.animate({ opacity: 1.0}, 2000 )
});  	

$(function(){
  $('#navigation a')
		.css( {backgroundPosition: "-110px 0px"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-10px 0px)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(-110px 0px)"}, {duration:100})
		})
		.click(function(){
		  var URI = this.href
		  this.href = '#'
      $(this)
        .css( {background: "url(../xcss/grafik/hg_menuchosen.jpg) no-repeat 110px 0px"} )
        .css( {color: "#003399"} )
        .stop().animate({backgroundPosition:"(0px 0px)"}, {duration:500})
        .mouseout(function(){
			    $(this).stop().animate({backgroundPosition:"(0px 0px)"}, {duration:10})
		    })
      $('ul#navigation li a.chosen')
        .css( {background: "url(../xcss/grafik/hg_menu.jpg) no-repeat 0 0"} )
        .css( {color: "#FFFFFF"} )
        .stop().animate({backgroundPosition:"(-110px 0px)"}, {duration:100})      
      $('#hg').fadeOut('slow',function(){
        window.open(URI,'_self')
        return false
      })
		})
  $('ul#navigation li a.chosen')
    .css( {backgroundPosition: "0px 0px"})
    .mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0px 0px)"}, {duration:100})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0px 0px)"}, {duration:100})
		})
});