
// Dynamic CSS functions based on complete DOM traversal:
// HMA 2009.08.11

function fctChangeLanguage(txtLabel) {

	var objRootNode = document.documentElement;

	fctProcessNode(objRootNode, txtLabel);
	
	document.body.strLan = txtLabel
	
	return;

} 

function fctProcessNode(objNode, txtLabel) {
	// Sets CSS display property of the given node and its descendants.
	// Requirements: strLan property of the documents BODY element should be set like this:
	// <body strLan="Lan-SV">
	// NOTE: This setting must match display settings of the CSS document.

	//alert("Processing node: " + objNode.tagName);
	
	if (objNode.style == null) {
		return;
	}
	
	if (objNode.className == document.body.strLan) {
		objNode.style.display = "none"
	}

	if (objNode.className == txtLabel) {
		if (objNode.tagName == "SPAN") {
			objNode.style.display = "inline";
		}
		else {
			objNode.style.display = "block";
		}
	}
	
	var colChildren = objNode.childNodes;
	
	for (var i=0; i<colChildren.length; i++) {
		fctProcessNode(colChildren(i), txtLabel);
	}
	
	return;

} 

