Reveal=function(){}

Reveal.load=function(node){
	var links;

	links=DOM.getElementsByClassName("reveal",node);
	Reveal.link_open(links);
}
Reveal.link_open=function(links){
	var url=window.location.href;
	var id=url.substring(url.indexOf("#"));

	var link;
	var link_url;

	for(var i=0;i<links.length;i++){
		link=links[i];
		link.onclick=Reveal.open;

		link_url=link.href.substring(link.href.indexOf("#"));

		if(link_url==id){
			link.onclick();
		}
	}
}
Reveal.open=function(node){
	if(node==null || node.nodeType!=1){
		var id=DOM.get_href_anchor(this);

		if(id!=null){
			node=DOM.getElementById(id);
		}
	}

	if(node!=null){
		var close=DOM.getElementByClassName("close",node);

		if(close==null){
			close=DOM.createElement("div","close");
			close.className="close small button";
			close.onclick=Reveal.close;

			node.appendChild(close);
		}

		node.style.display="block";

		return false;
	}

	return true;
}
Reveal.close=function(){
	this.parentNode.style.display="none";

	this.parentNode.removeChild(this);
}
