﻿$(document).ready(function() {
	$('#no_js_warning').hide();
	if($.browser.msie){
		$('body').css({'background-color': '#48b'});
		$('#wrapper').css({'background-color': '#48b'});
		warning = '<strong>Achtung:</strong> Sie benutzen den Microsoft Internet Explorer. Diese Seite ist optimiert für die Browser';
		warning += ' <a href="http://www.mozilla.com/" style="color: #000;">Firefox</a>, ';
		warning += '<a href="http://www.opera.com/" style="color: #000;">Opera</a>, ';
		warning += '<a href="http://www.apple.com/safari/" style="color: #000;">Safari</a> und ';
		warning += '<a href="http://www.google.com/chrome/" style="color: #000;">Chrome</a>.';
		divStyle = 'background-color: #fff; padding: 0 10px; position: absolute; top: 0; width: 100%; z-index: 1;';
		pStyle = 'color: #000; font-family: Verdana, sans-serif; font-size: 0.8em;';
		$('body').append('<div style="'+ divStyle +'"><p style="'+ pStyle +'">'+ warning +'</p></div>');
	}
	if($.browser.opera){
		$('body').css({'background-color': '#48b'});
		$('#wrapper').css({'background-color': '#48b'});
	}
	$('h2').each(function() {
		$(this).css('cursor', 'pointer');
		$(this).click(function() {
			postID = $(this).attr('id').substr(4);
			$('#teaser p').first().html('');
			$('#teaser p').first().hide();
			$('#teaser').css('background-position', 'center center');
			$.ajax({
				url: 'includes/loadPostContent.php?id='+ postID,
				dataType: 'html',
				success: function(response){
					$('#teaser p').first().html(response);
					$('#teaser p').first().fadeIn();
					$('#teaser').css('background-position', '-10000px -10000px');
				}
			});
			$('h2').each(function() {
				$(this).removeClass('active');
			});
			$(this).addClass('active');
		});
	});
});
