var flversion = swfobject.getFlashPlayerVersion().major; 
$(document).ready(function() {
  // head display manipulation
   //$("#header").css({"background":"none"});
   //$("#border").css({"display":"none"});
    // Formularfelder
	if(typeof $('form.loginform input').toggleVal == 'function') { 
		$('form.loginform input').toggleVal();
	}
	/*if($('.referenzen_wrapper').length) {
		$('.newsBlock div span:empty').hide();
	} */
	// init flash
	var xml_url;
	if($(document).getUrlParam('id') == null) {
		xml_url = '/generate_xml2.php?id=1';
	} else {
		xml_url = '/generate_xml2.php?id='+$(document).getUrlParam('id');
	}
	
	// var xml_url = 'http://jules/isidesign-thekenbau/generate_xml.php?path='+location;
	if($(document).getUrlParam('L') == null) {
		xml_url = xml_url;
	} else {
		xml_url = xml_url+'_'+$(document).getUrlParam('L');
	}
	//alert(xml_url);
	
	swfobject.embedSWF('fileadmin/isinger-merz/flash/head.swf', 'border', '100%', '100%', '8.0.0','fileadmin/isidesign-thekenbau/flash/expressInstall.swf', {xmlpath: xml_url}, {menu: false, wmode: 'opaque' },{name: 'border'});
	
    $("div#header").mouseout(function(){
		if(window.border) {
			window.document["border"].SetVariable("myMouse", "false");
		}
		if(document.border) {
			document.border.SetVariable("myMouse", "false");
		}
    })
    .mouseover(function(){ 
      if(window.border) window.document["border"].SetVariable("myMouse", "true");
	    if(document.border) document.border.SetVariable("myMouse", "true");
    });
	
	if($('div.csc-mailform-field').length > 0) {
		$('input.csc-mailform-check').siblings('label').css('width','12em');
	}
	
	/*if($(document).getUrlParam('cat') != null) {
		var cat = $(document).getUrlParam('cat');
		
		if((cat!='') && (cat.match(/^\d+$/)) && ($('div.referenzen_wrapper[title*='+cat+']').length>0)) {
			$('div.referenzen_wrapper').hide();
			$('div.referenzen_wrapper[title*='+cat+']').show();
		}
	}*/
	
	$('h1,h2,h3,h4,h5,h6').each(function(){
		//$(this).text($(this).text().replace(/\u00AE/g,'&reg;'));
		$(this).html($(this).html().replace(/\u00AE/g,'<sup>®</sup>'));
	});
	
	$('#mailformAnredeHerr').siblings().andSelf().css('float','left');
	$('label[for=mailformAnredeFrau]').after('<br class="clear"/>');
	
});