function changeInputType(oldObject, oType) {
	var newObject = document.createElement('input');
	newObject.type = oType;
	if(oldObject.size) newObject.size = oldObject.size;
	//if(oldObject.value) newObject.value = oldObject.value;
	if(oldObject.name) newObject.name = oldObject.name;
	if(oldObject.id) newObject.id = oldObject.id;
	if(oldObject.className) newObject.className = oldObject.className;
	oldObject.parentNode.replaceChild(newObject,oldObject);
	newObject.focus();
	return newObject;
}
function clearInput(inputObject) {
	if (inputObject.value != '') {
		inputObject.value = '';
	}
}
function swapTableUnits(originalBlock,newBlock) {
	var ot = document.getElementById(originalBlock);
	var nt = document.getElementById(newBlock);
	
	if (ot.style.display == 'none') {
		ot.style.display = 'block';
		nt.style.display = 'none';
	} else {
		ot.style.display = 'none';
		nt.style.display = 'block';
	}
	
}
function switchToggle(block) {
	var bl = document.getElementById(block);
	var im = document.getElementById("image_"+block);
	if (bl.style.display == 'none') {
		bl.style.display = '';
		im.src = '../images/template/icon_contract.gif';
	} else {
		bl.style.display = 'none';
		im.src = '../images/template/icon_expand.gif';
	}
}
function switchToggleTemplate(block) {
	var bl = document.getElementById(block);
	var im = document.getElementById("image_"+block);
	if (bl.style.display == 'none') {
		bl.style.display = '';
		im.src = 'images/template/icon_contract.gif';
	} else {
		bl.style.display = 'none';
		im.src = 'images/template/icon_expand.gif';
	}
}


function toggleHelp(block) {
	var bl = document.getElementById(block);
	var im = document.getElementById("help_"+block);
	if (bl.style.display == 'none') {
		bl.style.display = '';
		im.src = 'images/help_icon_on.png';
	} else {
		bl.style.display = 'none';
		im.src = 'images/help_icon_off.png';
	}
}

function rollOver(id) {
	document.getElementById(id).style.backgroundColor = '#DDDDDD';
}
	
function rollOut(id) {
	document.getElementById(id).style.backgroundColor = '#EEEEEE';
}
