var d = document;
var isIE = document.all ? true : false;

function g(id) {
	/*
	Saves one from having to type
	'd.getElementById' every time
	*/
	return d.getElementById(id);
}

// Global var, required for the recursive function below
var objPropertyValue;
function getCSSProperty(obj, property) {
	/*
	Expects: ojb is an element id, property is the name of the property
	whose value you want to get.
	
	Returns: the value of a CSS property of an unmodified object.
	Ie. This funciton can be used to read a CSS value as it is
	set in an embedded, linked or imported stylesheet.
	
	The branching is because IE and W3C standards don't expose stylesheet-set
	style object properties in the same way.
	
	This function returns values 'as is'. Eg. a width property
	might be returned as '100px', it's up to you to parseInt() the 'px'
	off it if you need to do any calculations with the value.
	
	This function requires the declaration of a global variable objPropertyValue
	to track what's going on with the property string during the hyphen
	removal process.
	
	To _set_ a CSS property of an object, use getElementById(object).style.aProperty = 'aValue';
	*/
	if(isIE){
		var elem = g(obj);
		var hyphen = property.indexOf('-');
		if(hyphen != -1) {
			// construct a mixed case property name so that hypens don't break the code
			var nextHyphen = property.lastIndexOf('-');
			var newPropertyName = property.slice(0, nextHyphen);
			var nextCap = property.slice(nextHyphen+1, nextHyphen+2);
			newPropertyName += nextCap.toUpperCase();
			newPropertyName += property.slice(nextHyphen+2);
			property = newPropertyName;
		}
		hyphen = property.indexOf('-');
		if(hyphen != -1)
			getCSSProperty(obj, property);
		else
			eval('objPropertyValue = elem.currentStyle.' + property);
	}
	else {
		var elem = g(obj);
		var dv = d.defaultView;
		var currentStyle = dv.getComputedStyle(elem,'');
		objPropertyValue = eval('currentStyle.getPropertyValue("'+ property + '")');
	}
	return objPropertyValue;
}

function show(id) {
	// Show the object
	g(id).style.display = 'inline';
}

function hide(id) {
	// Hide the object
	g(id).style.display = 'none';
}

function showHide(id) {
	// Show the object if it's hidden, hide it if it's visible
	getCSSProperty(id,'display') == 'none' ? show(id) : hide(id);
}