


function activateElement (id) {

	var element = document.getElementById(id);
	
	if (element) {
		element.style.display = 'block';
	}
}

function deactivateElement (id) {

	var element = document.getElementById(id);
	
	if (element) {
		element.style.display = 'none';
	}
}

function clickElement (id) {

	var element = $(id);
	
	//alert(Element.inspect(element));
	
	if (element) {
		for (var a = 0; a < element.attributes.length; a ++) {
		
			var attribute = element.attributes[a];
			
			if (attribute.nodeName == 'onclick' || attribute.nodeName == 'onClick') {
				
				// strip off 'javascript:' from the start (for Safari)
				if (attribute.nodeValue.substr(0,11) == 'javascript:') {
					attribute.nodeValue = attribute.nodeValue.substr(11, attribute.nodeValue.length);
				}
				//alert(attribute.nodeValue);
				
				eval(attribute.nodeValue);
				
				// exit loop
				a = element.attributes.length;
			}
		}
	
		// old way (did not work in Safari)
		/*var fn = element.onclick;
		fn();*/
	}
	
	//element.click();
}
