function ShowGlossaryItem(div_id, desc, block) {

	//var width = (width) ? width : 250;
	var width = '250px';
	var oldDiv = document.getElementById(div_id);
	//var html = '<span>' + desc + '</span>';
	
	//if(oldDiv.style.display != 'none') {
	//	HideGlossaryItem(div_id);
	//	return;
	//}

	newDiv = document.createElement(oldDiv.tagName);
	newDiv.id = oldDiv.id;
	//newDiv.className = oldDiv.className;
	
	if(block) {
		desc = '<div style="float: right;"><a href="javascript: HideGlossaryItem(\''+div_id+'\'); void 0;">Close [X]</a></div>' + desc;
		newDiv.style.display = 'block';
		newDiv.style.position = 'relative';
		newDiv.style.width = '50%';	
	} else {
		newDiv.style.display = 'inline';
		newDiv.style.position = 'absolute';
		newDiv.style.width = '250px';		
	}
	
	newDiv.className = 'glosarryDefenition';
	newDiv.style.fontStyle = 'normal';
	
	newDiv.style.backgroundColor = 'lightyellow';
	newDiv.style.border = 'solid 1px black';
	newDiv.style.padding = '3px 7px';
	newDiv.style.color = '#000000';
	newDiv.style.fontSize = '12px';
	newDiv.style.fontWeight = 'normal';		
	
	newDiv.innerHTML = desc;
	oldDiv.parentNode.replaceChild(newDiv, oldDiv);
	
	//newDiv.addEventListener('click',HideGlossaryItem(newDiv.id),false);
}

function HideGlossaryItem(div_id) {
	var div = document.getElementById(div_id);
	div.style.display = 'none';
}

function ToogleGlossaryItem(div_id, desc, block) {
	
}


/*
function glossaryHideAll() {
	$(document).ready(function() {
		var f = document.getElementById('kbp_article_body');
	
		$("document.body").click(function() {
		///$(".glosarryDefenition", f).bind("mouseout", function(e){
		//$("p").bind("click", function(e){
			alert("Hello world!");
			//event.preventDefault();
			//$(this).hide("slow");
			//$(".glosarryDefenition", f).css("display","block");
		//	$(".glosarryItem", f).css("display","none");
		});


		$(".glosarryDefenition", f).mouseout(function(){
			//$("p:first",this).text("mouse out");
			alert("Hello world!");
		}).mouseover(function(){
			//$("p:first",this).text("mouse over");
			alert("Hello world!");
		});
	
	
	});
}
*/

/*
$("p").bind("click", function(e){
      var str = "( " + e.pageX + ", " + e.pageY + " )";
      $("span").text("Click happened! " + str);
    });

*/

/*function ShowGlossaryItem(div_id, desc, block) {

	//var width = (width) ? width : 250;
	var width = '250px';
	var div = document.getElementById(div_id);
	//var html = '<span>' + desc + '</span>';
	
	if(div.style.display != 'none') {
		HideGlossaryItem(div_id);
		return;
	}
	
	if(block) {
		desc = '<div style="float: right;"><a href="javascript: HideGlossaryItem(\''+div_id+'\'); void 0;">Close [X]</a></div>' + desc;
		div.style.display = 'block';
		div.style.position = 'relative';
		div.style.width = '50%';	
	} else {
		div.style.display = 'inline';
		div.style.position = 'absolute';
		div.style.width = '250px';		
	}
	
	div.className = 'glosarryItem';
	
	div.style.fontWeight = 'normal';
	div.style.fontStyle = 'normal';
	
	div.style.backgroundColor = 'lightyellow';
	div.style.border = 'solid 1px black';
	div.style.padding = '3px 7px';
	div.style.color = '#000000';
	div.style.fontSize = '12px';
	div.style.fontWeight = 'normal';
	div.innerHTML = desc;
}*/


/*
http://piecesofrakesh.blogspot.com/2007/02/ies-unknown-runtime-error-when-using.html
someHtml = 'Some Html Text';

oldDiv = document.getElementById('oldDivId');

newDiv = document.createElement(oldDiv.tagName);

newDiv.id = oldDiv.id;
newDiv.className = oldDiv.className;
newDiv.innerHTML = someHtml;

oldDiv.parentNode.replaceChild(newDiv, oldDiv);
*/
