

function setHeaderAudio (on)
{
	var options = { path: '/', expires: 10 };
         
	if (on)
	{
		 $.cookie('headerAudioOff', false, options);
		// alert ('on');
	}
	else
	{
		//alert ('off');
		 $.cookie('headerAudioOff', true, options);
	}
}

function applyShadowBox (elemArr)
{
	for (i in elemArr)
	{
		var elem = elemArr [i];
		
		$("" + elem + " img").each (
			function ()
			{
				
				
				var aTag = $(this).parent ();
				var link = aTag.attr ("href");
				
				var onclickAttr = "" + aTag.attr ("onclick");
				
				aTag.removeAttr ("onclick");
				aTag.removeAttr ("target");
				
				var substr = "" + onclickAttr.match (/[^&]width.*/);
				
				substr = "" + substr.match (/width=.*height=[0-9]*/, "");
				
				if (substr != null)
				{
					var valArr = substr.split (",");
					
					var width = ("" + valArr[0]).split ("=") [1];
					var height = ("" + valArr[1]).split ("=") [1];
					
					if (width > 0 && height > 0)
					{
						var attr = "shadowbox[page_pics];width=" + width + ";height=" + height + ";"
						aTag.attr ("rel", attr);
					}
				}
			}
		);
	}
}

function sifrActivation ()
{
	var corporate = { src: 'fileadmin/tmpl/fonts/flash/corporate.swf' };
	var new_aster = { src: 'fileadmin/tmpl/fonts/flash/new_aster.swf' };
	sIFR.activate(corporate,new_aster);

	sIFR.replace(new_aster, {
		  selector: 'h1,h1.span',
		  wmode: 'transparent',
		  css: [ '.sIFR-root{color: #777776;font-weight: normal; text-transform: lowercase;font-style: italic;}',
		         '.ein {color: #689bb6;}',
		         '.verstanden {color: #689bb6;font-weight: bold;}',
		       ]
	});

	sIFR.replace(new_aster, {
		  selector: 'h2',
		  wmode: 'transparent',
		  css: [ '.sIFR-root{color: #777776;font-weight: normal; text-transform: lowercase;font-style: italic;}',
		       ]
	});
}

function shadowBoxActivation ()
{
	Shadowbox.init({
		displayNav: true,
		continuous: true,
		language: "de-DE",
		players:  ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv']
	});
}

function hyphenatorActivation ()
{
	var isIe6 = ($.browser.msie && ($.browser.version <= 6));
	if (!isIe6) {
		var hyphenatorConfig = {
			minwordlength: 8,
			donthyphenateclassname : 'noHyphenation'
		};
		Hyphenator.config (hyphenatorConfig);
		Hyphenator.run();
	}
}

$.fn.flash.update = function(htmlOptions) 
{
	var url = String(location).split('?');
	url.splice(1,0,'?hasFlash=true&');
	url = url.join('');
	var msg = '<div class="flashWarning"><p>F&uuml;r die Darstellung dieses Inhaltes wird der Flash-Player 10 ben&ouml;tigt.</p>';
	msg += '<p>Sie k&ouml;nnen diesen hier downloaden: <a href="http://www.adobe.com/go/getflashplayer" target="_blank">Download Flash Player</a>.</p>';
	msg += '<p>Sie haben den Flash Player 10 bereits installiert? <a href="'+url+'">Hier klicken.</a></p></div>';
	this.innerHTML = '<span class="alt">'+this.innerHTML+'</span>';
	jQuery(this)
		.addClass('flash-update')
		.prepend(msg);
};

$(document).ready (
	function ()
	{
		$(".spmMailAt").html ("@");
		
		$('h1').prepend("<span class='ein'>ein</span><span class='verstanden'>verstanden:&nbsp;</span>");
		
		
		
		$('div#content-inner-container').jScrollPane({showArrows:true,scrollbarWidth:8,scrollbarMargin:10});
		
		if (!$.browser.msie)
		{
			applyShadowBox (new Array (".csc-textpic", ".news-single-item"));
		}
		
		$('h1,h2').addClass ("noHyphenation");
		

		
		
		//$(document).pngFix(); 
	}
);

sifrActivation ();
shadowBoxActivation ();
//hyphenatorActivation ();







