function inspect(elm)
{
var str = "";
for (var i in elm)
	{str += i + elm.getAttribute(i)+ "     ";}
alert(str);
}

function convertToInteger(string){
	var int1=0;
	int1 = parseFloat (string);
	int1 = Math.round (int1);
	if (isNaN(int1)) 
		int1=0;
	return int1;
}

function convertToNum(string){
	var int2=0;
	int2= parseFloat(string);
	if (isNaN(int2)) 
		int2=0;

	return int2;
}

//Function to set a number to a fixed length after the decimal point this results in a string value
function convertToFixed(num1,prec){
	
	factor=Math.pow(10,prec);
	num1=Math.round(num1*factor);
	num1=num1/factor;
	
	str1=num1.toString();
	// Now find decimal point and append 0 if required,
	for (y=0;y<str1.length;y++){
		a = str1.substr(y,1);
		if (a =="."){
			for (z=1;z<prec;z++){
				sufix=str1.substr(y+1,prec)
				if (sufix.length<prec){
					str1=str1.concat("0")
				}
			}
			
		}
	}
	return str1
}

