$(document).ready(function()
{
	$('#stellen a').fancybox({
		autoDimensions: false,
		width: 600,
		height: 'auto'
	});

	
	$('#pageNews .weiterlesen').click(function() 
	{
		newsId = $(this).parent().find(':first').val();
		loadFullNews(newsId, this);
	});
	
	
});


function loadFullNews(newsId, newsEntry)
{
	$.get("/news/newsajax.html", { id: newsId }, function(data) {
		var parent = $(newsEntry).parent().parent();
		parent.find('.content').html(data);
		parent.find('.downloads').removeClass('hidden');
		parent.find('.weiterlesen').remove();
	});
}


function popup(mypage, myname, w, h, scroll) {
  var wint = (screen.height - h) / 2;
  var winl = (screen.width - w) / 2;
  winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable,menubar';
  win = window.open(mypage, myname, winprops);
  if (win && win.window) { // (kein Fehler in FF bei aktivem Popupblocker und in Opera)
    if (parseInt(navigator.appVersion) >= 4) {
      win.window.focus();
    }
	}
	if (win) {
		return false;
  } else {
    return true;
	}
}
