function	MyElemID	(elemID)
{
	/*****************************
	 * V 1.0.0 31/12/2004 By Bit *
	 * V 1.0.1 01/01/2006 By Bit *
	 *****************************/
	 
	var obj
	
	if (document.all)
	{
		obj = document.all(elemID)
	}
	else if (document.getElementById)
	{
		obj = document.getElementById(elemID)
	}
	else if (document.layers)
	{
		obj = document.layers[elemID]
	}
	return (obj);
}
	
function	Number_Format		(Num,NumDecimal,DecPoint,ThousandsSep)
{
	/*****************************
	 * V 1.0.0 15/10/2005 By Bit *
	 *****************************/
	
	Num =  (Math.round (Num * Math.pow (10,NumDecimal)) / Math.pow(10,NumDecimal)).toString ();
	
	var DecPosition = Num.indexOf (".");	
	if (DecPosition == -1)
	{
		Num += ".00";
	}
	else
	{
		var	DecLocation = Num.substring (DecPosition,Num.length);
		if (DecLocation.length == 2)
		{
			Num += "0";
		}
	}
	Num = Num.replace (".",DecPoint);
	
	var DecPosition = Num.indexOf (",");	
	var	IntPart = Num.substring (0,DecPosition);
	var	FloatPart = Num.substring (DecPosition,Num.length);
	
	if (IntPart.length > 3)
	{
		var NewIntPart = "";
		var	DCnnt = 0;
		
		for (var i = IntPart.length;i >= 0;i--)
		{
			NewIntPart += IntPart.charAt (i);
			++DCnnt;
			if (DCnnt == 4)
			{
				NewIntPart += ThousandsSep;
				DCnnt = 0;
			}
		}
		
		var DefNum = "";
		for (var i = NewIntPart.length;i >= 0;i--)
		{
			DefNum += NewIntPart.charAt (i);
		}
		Num = DefNum + FloatPart;
	}
	
	return (Num);
}

function	AnimateImgButton	(ButtId)
{
	/*****************************
	 * V 1.0.0 01/01/2006 By Bit *
	 * V 1.0.1 01/03/2006 By Bit *
	 *****************************/
	 
	var	ObjRef = MyElemID (ButtId);
	
	ObjRef.onmouseout = AnimateImgButtonHandler;
	ObjRef.onmouseover = AnimateImgButtonHandler;
	
	if (AnimateImgButton.arguments.length > 1)
	{
		ObjRef.onclick = AnimateImgButton.arguments[1];
	}
}

function AnimateImgButtonHandler (EvtNfo)
{
	/*****************************
	 * V 1.0.0 01/01/2006 By Bit *
	 * V 1.0.1 05/07/2006 By Bit *
	 *****************************/

	var EventType = null;
	var EventSource = null;

	if (window.event == undefined)
	{ // Firefox
		EventType = EvtNfo.type;
		EventSource = EvtNfo.target;  
	}
	else
	{ // IE
		EventType = window.event.type;
		EventSource = window.event.srcElement;
	}

	switch (EventType)
	{
		case "mouseover":
			EventSource.src = EventSource.src.replace ("Normal","Over");
			break;
		case "mouseout":
			EventSource.src = EventSource.src.replace ("Over","Normal");
			break;
	}
}

function imgSwap(oImg)
{
   var strOver  = "_on"    // image to be used with mouse over
   var strOff = "_off"     // normal image
   var strImg = oImg.src
   if (strImg.indexOf(strOver) != -1)
      oImg.src = strImg.replace(strOver,strOff)
   else
      oImg.src = strImg.replace(strOff,strOver)
}


