function toggleHT() {
	var $NewsBoxContent = $('#NewsBoxContent')
 if ($NewsBoxContent.height() == 30) {
  $NewsBoxContent.animate({"width" : "268px"},{
   queue:false,
   duration:450,
   easing: 'easeOutQuint',
   complete: function(){
	$NewsBoxContent.animate({"height" : "446px"},{queue:false, duration:750, easing: 'easeOutQuint'});
	$('#ht_title_title span').fadeIn('normal');
	$('#ht_title .x_close').fadeIn('normal');
	$('#ht_arrow').attr('src', './img/arrows/button_grau.png');
	$('#ht_arrow').css('cursor', 'default');
	$('#ht_arrow').unbind();
   }
  });
 } else {
  $NewsBoxContent.animate({"height" : "30px"},{
   queue:false,
   duration:750,
   easing: 'easeOutQuint',
   complete: function(){
	$NewsBoxContent.animate({"width" : "33px"},{queue:false, duration:450, easing: 'easeOutQuint'});
	$('#ht_title_title span').fadeOut('fast');
	$('#ht_title .x_close').fadeOut('fast');
	$('#ht_arrow').attr('src', './img/arrows/button_grau_up.png');
	$('#ht_arrow').css('cursor', 'pointer');
	$('#ht_arrow').bind('click', function(){
	toggleHT();
	})
   }
  });
 }
}

$(function(){
	$('#NewsBoxContent').animate({"height" : "446px"},{queue:false, duration:750, easing: 'easeOutQuint'});
	
		$("body").append("<div id='glayLayer'></div><div id='overLayer'></div>");
	
	$("#glayLayer").click(function(){
		$(this).hide()
		$("#overLayer").hide();
	});
	$("#overLayer").click(function(){
		$(this).hide()
		$("#glayLayer").hide();
	});
	
	$("a.popup").click(function(){
		$("#glayLayer").show();
		$("#overLayer").show().html("<img src='"+$(this).attr("href")+"' />");
		return false;
	});
	
	if($.browser.msie && $.browser.version<7){
		$(window).scroll(function(){
			$("#glayLayer").css('top',$(document).scrollTop());
			$("#overLayer").css('top',($(document).scrollTop()+$(window).height()/2) +"px");
		});
	}

});

