$(document).ready(function(){
  $(".tn").hover(
    function () {
	  var img = $(this).css("background-image");
	  imgnew = img.replace(/.gif/,"a.gif");
	  $(this).css({backgroundImage:imgnew});
	}, 
    function () {
	  var img = $(this).css("background-image");
	  imgnew = img.replace(/a.gif/,".gif");
	  $(this).css({backgroundImage:imgnew});
	}
  );
  
  $(".tn").click(
    function() {
	  var idpart = $(this).attr("id").replace(/tn_/,"");
	  location.href = $("#tnl_"+idpart).attr("href");
	}
  );
  
  $(".navleft2").click(
    function() {
	  var idpart = $(this).attr("id").replace(/xxn/,"");
	  location.href = $("#lxn_"+idpart).attr("href");
	}
  );
  
  $(".navleft").click(
    function() {
	  var idpart = $(this).attr("id").replace(/xxn/,"");
	  location.href = $("#lxn_"+idpart).attr("href");
	}
  );
  
  $(".nnews").hover(
    function () {
	  var id = $(this).attr("id");
	  idpic = "e"+id;
	  $("#"+idpic).attr("src","/fileadmin/images/eye_3.gif");
	}, 
    function () {
	  var id = $(this).attr("id");
	  idpic = "e"+id;
	  $("#"+idpic).attr("src","/fileadmin/images/eye_1.gif");
	}
  );
  
  $(".standard").hover(
    function () {
	  var id = $(this).attr("id");
	  idpic = id.replace(/n/,"p");
	  $("#"+idpic).attr("src","/fileadmin/images/eye_3.gif");
	}, 
    function () {
	  var id = $(this).attr("id");
	  idpic = id.replace(/n/,"p");
	  $("#"+idpic).attr("src","/fileadmin/images/eye_1.gif");
	}
  );
  
  $(".navtuete").hover(
    function () {
	  $(this).attr("src","/fileadmin/images/navtuete2.gif");
	}, 
    function () {
      $(this).attr("src","/fileadmin/images/navtuete.gif");
	}
  );
  
  $(".navleft").hover(
    function () {
	  $(this).css({backgroundImage:"url(/fileadmin/images/navtuete.gif)"});
	}, 
    function () {
      $(this).css({backgroundImage:"url(/fileadmin/images/0.gif)"});
	}
  );
  
  $("#topgo").hover(
    function () {
	  $("#timg").attr("src","/fileadmin/images/totop2.gif");
	}, 
    function () {
      $("#timg").attr("src","/fileadmin/images/totop.gif");
	}
  );
  
  /*
  $(".tstart").hover(
    function () {
	  var id = $(this).attr("id").replace(/H_/,"");
	  var img = $("#IMG_"+id).attr("src");
	  img = img.replace(/1/,"2");
	  $("#IMG_"+id).attr("src",img);
	}, 
    function () {
	  var id = $(this).attr("id").replace(/H_/,"");
	  var img = $("#IMG_"+id).attr("src");
	  img = img.replace(/2/,"1");
	  $("#IMG_"+id).attr("src",img);
	}
  );
  
    $(".tstart").click(
    function () {
	  var id = $(this).attr("id").replace(/H_/,"");
	  var img = $("#IMG_"+id).attr("src");
	  if(img.indexOf("down") != -1) {
	    $('#I_'+id).show();
		img = img.replace(/down/,"up");
		$("#IMG_"+id).attr("src",img);
	  }
	  else {
	    $('#I_'+id).hide();
		img = img.replace(/up/,"down");
		$("#IMG_"+id).attr("src",img);
	  }
	}
  );
  */
  
  $("#scontent").css({width:"755px"});

  checkheight();
  
});

function checkheight() {
  var lwidth   = 228;
  var lheight  = parseInt($("#right").css("top"));
  var myHeight = 0, myWidth = 0;
  
  //Non-IE
  if( typeof( window.innerWidth ) == 'number' ) {
    myWidth  = document.documentElement.clientWidth-lwidth;
    myHeight = window.innerHeight-lheight; }
  
  //IE 6+ in 'standards compliant mode'
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    myWidth  = document.documentElement.clientWidth-lwidth;
    myHeight = document.documentElement.clientHeight-lheight;
  }
  
  //IE 4 compatible
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    myWidth  = document.body.clientWidth-lwidth;
    myHeight = document.body.clientHeight-lheight;
  }
  $('#right').css({width : myWidth+"px"});
  $('#right').css({height : myHeight+"px"});
}
window.onresize = checkheight;

function showEnlargehint() {
  $('#enlarge').show();
  $('#right').css({top:"170px"});
  checkheight();
}
