// Basisdaten
var STR_submenu = 'untermenu';

// Inhalt einer Box verstecken
function foldBox(STR_box_id)
{
	// Inhalt ausblenden
	$('#' + STR_box_id + ' > .' + STR_submenu).slideUp('fast');
	$('#' + STR_box_id + ' div.minimize').hide();
	$('#' + STR_box_id + ' div.maximize').show();
	
} // end function foldBox


// Inhalt einer Box zeigen
function unfoldBox(STR_box_id)
{
	// Inhalt ausblenden
	$('#' + STR_box_id + ' > .' + STR_submenu).slideDown('fast');
	$('#' + STR_box_id + '  div.minimize').show();
	$('#' + STR_box_id + '  div.maximize').hide();
	
} // end function unfoldBox	


/* CHW / 12-08-2009 / Statisikzaehlung */

// Zaehlpixel fuer Impressions einbauen
function setImpression(INT_ct, INT_c, STR_target_id)
{
	var INT_rnd = Math.random()*10000000000000000;
	$('#' + STR_target_id).append('<img class="countpix" src="/count/impression/' + INT_ct + '/' + INT_c + '?rnd=' + INT_rnd + '" alt="" style="height:1px;width:1px;" />');
} // end function setImpression

//Zaehlpixel fuer Visit einbauen
function setVisit(INT_ct, INT_c, STR_target_id)
{
	var INT_rnd = Math.random()*10000000000000000;
	$('#' + STR_target_id).append('<img class="countpix" src="/count/visit/' + INT_ct + '/' + INT_c + '?rnd=' + INT_rnd + '" alt="" style="height:1px;width:1px;" />');
} // end function setVisit

//Zaehlpixel fuer Kontakt einbauen
function setContact(INT_ct, INT_c, STR_target_id)
{
	var INT_rnd = Math.random()*10000000000000000;
	$('#' + STR_target_id).append('<img class="countpix" src="/count/contact/' + INT_ct + '/' + INT_c + '?rnd=' + INT_rnd + '" alt="" style="height:1px;width:1px;" />');
} // end function setContact


// Autonomy
function mmb_search_changeSubFilter(value)
{
	$('.fieldvalues').hide();
	$('.fieldvalues').attr("name","");
	$('#'+value).show();
	$('#'+value).attr("name","fieldvalue");	
}


// Preise formatieren
function formatPrice(FLO_number) 
{
	// Summe auf 2 Stellen runden
	FLO_number = parseInt(FLO_number * 100);
	FLO_number = FLO_number / 100;
	FLO_number = FLO_number.toFixed(2);
	FLO_number = FLO_number.replace(/\./,",");
	while(FLO_number.match(/^(\d+)(\d{3}\b)/)) 
	{
		FLO_number = FLO_number.replace(/^(\d+)(\d{3}\b)/, RegExp.$1 + '.' + RegExp.$2);		
	}
	
	// Summe + EUR-Zeichen
	return FLO_number + " &euro;";
	
} // end function


$(document).ready(function()
{
	
	// Info-/Hilfeboxen einblenden
	$('span.info').hover(function()
	{
		$(this).children('span').show();
	},function()
	{
		$(this).children('span').hide();
	});	
	
});
