
/* Erweiterung AHA für PNG Transparenz */
var blank = new Image();
blank.src = "/_img/site/transparent.gif";

$(document).ready(function() {
	fixImages();
});

function fixImages() {
var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
if (badBrowser) {
	// get all pngs on page
	$('.png_fix').each(function() { // Nur Bilder mit fiximage Klasse korrigieren, fuer alle PNGs: img[src$=.png]
		if (!this.complete) {
			this.onload = function() { fixPng(this) };
		} else {
			fixPng(this);
		}
	});
	}
}

function fixPng(png) {
	// get src
	var src = png.src;		   
	// set width and height
	if (!png.style.width) { png.style.width = $(png).width(); }
	if (!png.style.height) { png.style.height = $(png).height(); }
	// replace by blank image
	png.onload = function() { };
	png.src = blank.src;
	// set filter (display original image)
	png.runtimeStyle.filter ="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
}
/* ENDE Erweiterung AHA für PNG Transparenz */

// START - Setzt auf das umgebene div eines Bildes mit Bildunterschrift die Breite des Bildes
$(window).load(function() { // nicht $(document).ready(function()
	$('.img_box').each(function(){
		var bildbreite = $(this).find('img').width();
		var bildbreite = bildbreite;
		$(this).css('width',bildbreite);
		//alert(bildbreite);
	});
});
// ENDE - Setzt auf das umgebene div eines Bildes mit Bildunterschrift die Breite des Bildes

// START - Tabellen Styling -> Round Corners fuer flexible Tabelle
$(document).ready(function(){
	$('table.des thead tr:first-child th:last-child').addClass('t_ro');
	$('table.des tbody tr:last-child td:last-child').addClass('t_ru');
	$('table.des tbody tr:last-child td:first-child').addClass('t_lu');
	$('table.des thead tr:first-child th:first-child').addClass('t_lo');
	$('table.des tr th:first-child').addClass('t_one');
	$('table.des tr td:first-child').addClass('t_one');
});
// ENDE - Tabellen Styling -> Round Corners fuer flexible Tabelle

// START - Marginal-Spalten Box auf Inhalt testen und Boxhoehe berechnen
$(document).ready(function(){
		if ($('span-13 .box:empty').length > 0 ){
			$('.span-13 .box').css('display', 'none');
		} else {
			var h_cont = $('#container_content').height();
			var h_box = h_cont - 402;
			$('.span-13 .box').height(h_box);
		}
	});
// ENDE - Marginal-Spalten Box auf Inhalt testen und Boxhoehe berechnen