// DOM / GET PROPERTY
// original code from http://www.alistapart.com/
//
// NOTES:	given an id and a property (as strings), return the given property of that id.
// WORKS:	ie5+, ns6+, opera5+

function getIdProperty(id,property) {
	var styleObject = document.getElementById( id );
	if (styleObject != null) {
		styleObject = styleObject.style;
			if (styleObject[property]) {
				return styleObject[ property ];
			}
		}
	return (styleObject != null) ?
	styleObject[property] :
	null;
}

// DOM / SET PROPERTY
// original code from http://www.alistapart.com/
//
// NOTES:	given an id and a property (as strings), set the given property of that id to the value provided.
// WORKS:	ie5+, ns6+, opera5+

function setIdProperty(id,property,value) {
	var styleObject = document.getElementById( id );
	if (styleObject != null) {
		styleObject = styleObject.style;
		styleObject[ property ] = value;
	}
}

// HIDE AND SHOW LAYERS (ON THE SAME PAGE)
// USAGE:	show('layername'); hide('layername');
// WORKS:	ie4+, ns4+, opera

	function hide(id) {
		if (b.dom) {
			setIdProperty(id,"visibility","hidden");
		}
		else {
			if (b.ns) { document.layers[id].visibility = "hide"; }
			else { document.all[id].style.visibility = "hidden"; }
		}
	}

	function show(id) {
		if (b.dom) {
			setIdProperty(id,"visibility","visible");
		}
		else {
			if (b.ns) { document.layers[id].visibility = "show"; }
			else { document.all[id].style.visibility = "visible"; }
		}
	}
	
	// cookie functions grabbed from ghtml.com.
	function setCookie(c_name,c_value){
		document.cookie = c_name + "=" + c_value + "; expires=Sun, 13-Oct-04 00:00:01 GMT;path=/;";
	}
		
	// Reads the cookie names "ghtml_playing_with_cookies" and returns the value
	function getCookie(c_name){
		var pos = document.cookie.indexOf(c_name); //count between " & "
		if(pos != -1){
			var start = pos+c_name.length; //change this number to what you counted to above [eg. 'ghtml' is 6 (yes, SIX) characthers because of the "="
			var end = document.cookie.indexOf(";",start);
			if(end == -1)
				end = document.cookie.length;
			var cookieValue = document.cookie.substring(start, end);
			return unescape(cookieValue);
		}
		return null;
	}	