
function round(number,dec) {
		// rounds number to X decimal places, defaults to 2
		dec = (!dec ? 2 : dec);
		return Math.round(number*Math.pow(10,dec))/Math.pow(10,dec);
}

function trim(str) {
	return str.replace(/^\s+/,'').replace(/\s+$/,'');
}

function setContent(id,content) {
	if (document.all) document.all[id].innerHTML=content ;
	else if (document.getElementById) {
		if (el = document.getElementById(id)) {
			rng = document.createRange();
			rng.setStartBefore(el);
			htmlFrag = rng.createContextualFragment(content);
			while (el.hasChildNodes())
				el.removeChild(el.lastChild);
			el.appendChild(htmlFrag);
		}
	}
}

function getElement(elname) {
	if (document.all) {
		return document.all[elname];
	}
	if (document.getElementById) {
		return document.getElementById(elname) ;
	}

	return null ; 
}

function hideElement(name) {
	if ((el = getElement(name))!=null) {
		if (el.style) {
			//el.style.visibility = 'hidden';
			el.style.display = 'none';
		} else {
			if (el.display)
			  el.display='none';
			// if (el.visibility) el.visibility = 'hidden';
		}
	}
}

function showElement(name) {
	if ((el = getElement(name))!=null) {
		if (el.style) {
			el.style.display = '';
			//el.style.visibility = 'visible';
		} else {
			if (el.display) el.display='';
			// if (el.visibility)  el.visibility = 'visible';
		}
	}
}

function setRowClass(idRow,style) {
 	if ((theRow = getElement(idRow)) != null) {
		if (typeof(theRow.cells) != 'undefined') {
			theCells = theRow.cells;
			for(c=0;c<theCells.length;c++) {
				theCells[c].className=style;	
			}
		}

	}
}

var marked_row = new Array() ;

function toString(vl) {
	return vl + '';
}

function jsGo(loc) {
	document.location=loc ;
}
