function ReplaceTag(tagType, tagToBeReplacedID, newTagID, newTagText, containerTag, newTagStyle, newTagClass)
{	
	//reference to contatiner
	container = document.getElementById(containerTag);
	
	//reference to tagtobereplaced
	tagToBeReplaced = document.getElementById(tagToBeReplacedID);
	
	//remove tagtobereplaced
	container.removeChild(tagToBeReplaced);

	//create new tag and new tag text node
	var newTag = document.createElement(tagType);
	var newTagTextNode = document.createTextNode(newTagText);
	
	//process tag params
	newTag.setAttribute('style', newTagStyle);
	
	newTag.setAttribute('class', newTagClass);
	document.getElementById('replaced').className = newTagClass;
	newTag.setAttribute('id', newTagID);

	//append textnode to new tag
	newTag.appendChild(newTagTextNode);
	
	//append new tag to container
	container.appendChild(newTag);
}

function ReplaceText(containerTag, newText)
{
	container = document.getElementById(containerTag);
	newNode = document.createTextNode(newText);
	container.replaceChild( newNode, container.lastChild);
}