

function ge(what){
	return document.getElementById(what);
}

$(document).ready(function(){
	
	// $('a[href="http://www.southfilms.com/"]').parent().remove();
	$('.banner_image').css('display', 'block !important');
	$('.subnav').bgiframe();
	
	
	$('#db_saerch_detail p').each(function()
	{
	   var desc_text =$(this).text();
	   desc_text = desc_text.replace(/\n/g,'<br>');
	   desc_text = desc_text.replace(/<br><br><br><br>/g,'');
	   
	   $(this).html(desc_text);
	});
	
	
	
	$('#content, #logo, #search, #top_nav, #projekteportal_start').mouseover(function(){hide_navigation()});
	
	if ($('#top_article').size() > 0)
	{
	 
	 $("#top_article").accordion({
					header: '.top_title',
					active: 0,
           				event: 'mouseover',
           				navigation: true
				});

		
	}
	
	if ($('#FIELD_WFQBE_BEDARF_MIN_1').size() > 0)
	{
		
		$('#FIELD_WFQBE_BEDARF_MIN_1').attr('value', '1');
		$('#FIELD_WFQBE_BEDARF_MAX_2').attr('value', 0);
	
	}
	
	
	
	
	
	
	if ($('#mailformProjekteName').size() > 0)
	{
		
		var text = $('#result_headline_wq').html();
		var text2 = $('#result_headline2_wq').text()+' - '+text;
		$('#mailformProjekteName').attr('value', text2)	
		//$('#mailformProjekteName').attr('disabled', 'disabled')	
	
	}
	
	
	if ($('.ppd_summ').size() > 0)
	{
		$('.ppd_summ').each(function(i){
			
			if($(this).html() == '0')
			{
				$(this).parent().html('') ;
			
			}
			else
			{
				$(this).html(tausender_trenner($(this).html())+ ',- €');
				
			
			}
		
		});

	
	}
	
	
	if ($('.ppd_text_box').size() > 0)
	{
		$('.ppd_text_box').each(function(){
			
			
			if($(this).html() == '')
			{
				$(this).parent().html('') ;
			
			}
			
			
		
		});

	
	}
	
});


var SubNav = undefined  // var fuer die Subnavi
var ActiveSubNav ='';
var active_timer = null;
var active_navigation = null;
var main_nav = null;


function tausender_trenner(number) {
number = '' + number;
if (number.length > 3) {
var mod = number.length % 3;
var output = (mod > 0 ? (number.substring(0,mod)) : '');
for (i=0 ; i < Math.floor(number.length / 3); i++) {
if ((mod == 0) && (i == 0))
output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
else
// hier wird das Trennzeichen festgelegt mit '.'
output+= '.' + number.substring(mod + 3 * i, mod + 3 * i + 3);
}
return (output);
}
else return number;
}




function show_navigation2(nav, menu) 
{
	hide_navigation_total();
	
	if (nav.parentNode.lastChild != nav)
	{
		active_navigation = nav.parentNode.lastChild;
		$(active_navigation).bgiframe();
		$(active_navigation).show();
	}
	

	
}



function hide_navigation(nav) {
    active_timer = window.setTimeout("hide_navigation_total()",0);
}

function hide_navigation_total() {
     if (active_navigation != null)
     {
         $(active_navigation).hide();
     }
}

function keep_navigation(menu) {
    window.clearTimeout(active_timer);
    $(menu).show();
}






function add_hover(dies){
    $(dies).parent().addClass("hover");
    
    
}

function remove_hover(dies){
   $(dies).parent().removeClass('hover'); 
}








