/*
'	$Id: preislib.js 1736 2007-12-11 15:51:11Z bernd $
'	$Date: 2007-12-11 16:51:11 +0100 (Di, 11 Dez 2007) $
'	$HeadURL: svn://server01/01_Fiat_AAG/Lancia/02_DOMAINS/configurator.lancia.de/01_HTML/trunk/include/preislib.js $
'	$Revision: 1736 $
'
'	Name:
'	Funktion:
'
'	Aufruf:
'
'	Projekt:	Lancia: CC-Relaunch 2007
'	Copyright:	(C) 2004 Arc Worldwide Frankfurt
'
'	Autor:		Arc Interactive, Hamburg
'
'	Änderungen:	27.08.2007, CS
'
'
*/
function FormatPrice(price)
{
// Attention no negative prices !!
	if (price > 0)
		{
		euro1000 = parseInt(price / 1000);
		if (euro1000 > 0) 	 
			{	 	
			euro1000 = euro1000 + "."; 
			euro = parseInt(price) - euro1000 * 1000;
			if (euro < 100) { euro = "0" + euro; }
			if (euro < 10)  { euro = "0" + euro; }
			}
		else 			 
			{	
  			euro = parseInt(price);
			euro1000 = ""; 
			}
		cent = Math.round((price % 1) * 100);
		if (cent<10)
			cent = "0" + cent;
		//FormatedPrice = euro1000 +  euro + "," + cent;
		FormatedPrice = euro1000 +  euro + ",-";
		}
	else
		{	
		//FormatedPrice ='0,00';
		FormatedPrice ='0,-';
		}
	return FormatedPrice;
} // END  FormatPrice(price)

function FormatEuro(price)
{
// Attention no negative prices !!
	if (price > 0)
		{
		euro1000 = parseInt(price / 1000);
		if (euro1000 > 0) 	 
			{	 	
			euro1000 = euro1000 + "."; 
			euro = parseInt(price) - euro1000 * 1000;
			if (euro < 100) { euro = "0" + euro; }
			if (euro < 10)  { euro = "0" + euro; }
			}
		else 			 
			{	
  			euro = parseInt(price);
			euro1000 = ""; 
			}
		FormatedPrice = euro1000 +  euro;
		}
	else
		{	
		FormatedPrice ='0';
		}
	return FormatedPrice;
} // END FormatEuro(price)

function WriteLayer(layerID,txt)
{
	txt = txt.replace(/&amp;/g, "&");
	if(document.getElementById)
	{
		document.getElementById(layerID).innerHTML=txt;
	}	
	else if(document.all)
	{
		document.all[layerID].innerHTML=txt;
	}
	else if(document.layers)
	{
		with(document.layers[layerID].document)
		{
			open();
			write(txt);
			close();
		}
	}
} // END WriteLayer(layerID,txt)


function Amount( strText) 
{
strText =  '0' + strText;  // Force it to be a String

	// alle (Tausender-Punkte) wegnehmen
	strText = strText.replace( /\./, "" );

	// Kommata durch Punkte ersetzen
	strText = strText.replace( /\,/, "." );

	return (Number(Math.round(strText)));
} // END Amount( strText) 
/*      end $id: scroll_var_detailansicht.js 1088 2007-08-27 15:49:02z bernd $ end */