﻿/*
	Function will parse the total as euro (currency) format.
*/
function Euroformat(obj) 
{	
	var num = obj.value; 
	if (num.length > 0)
	{   
		num = num.toString().replace(/\$|\./g,'');    
	    
		var numSplit = num.split(',');    
		num = numSplit[0];    
	    
		var cents = '';
		if (numSplit.length > 1)
		{
			if (numSplit > 0)
			{
				if (numSplit[1] < 10)
					cents = ', ' + (10 * numSplit[1]).toString();
				else
					cents = ', ' + numSplit[1].toString();
			}
		}
	    
		for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
			num = num.substring(0,num.length-(4*i+3))+'.'+num.substring(num.length-(4*i+3));
	    
		obj.value = num + cents;    
    }
}
