//<script>
var Page_Glossary;
function CLMC_Glossary() {
	this.img_path="/images/";
	this.prev_width=0;
	this.prev_height=0;
	this.container=document.getElementById('CLMC_glossary_container');
	window.obj=this;
	this.current_elm=null;
	this.initialized=false;
	this.init=function(){
		if (!this.container) {
			this.container=document.body.appendChild(document.createElement("DIV"));
			this.container.className="glossary_container";
			this.container.id='CLMC_glossary_container';
			this.container.style.cssText="z-index:98;position:absolute;display:none;width:250px;";
			var A=this.container.appendChild(document.createElement("TABLE"));
				A.width="100%";
				A.border="0";
				A.cellPadding="0";
				A.cellSpacing="0";
				A.className="no_space_table";
			var B=A.insertRow(-1);
				B=B.insertCell(-1);
				B.width="10";
			var C=B.appendChild(document.createElement("IMG"));
				C.src=this.img_path+"top_left.png";
				C.width=C.height="10";
			B=B.parentNode.insertCell(-1);
			C=B.appendChild(document.createElement("IMG"));
			C.src=this.img_path+"top.png";
			C.width="215";
			C.height="10";
			B=B.parentNode.insertCell(-1);
			B.height="100%";
			B.width="25";
			C=B.appendChild(document.createElement("IMG"));
			C.src=this.img_path+"top_right.png";
			C.width="25";
			C.height="10";
			B=A.insertRow(-1);
			B=B.insertCell(-1);
			B.width="10";
			var C=B.appendChild(document.createElement("IMG"));
			C.src=this.img_path+"left.png";
			C.width="10";
			C.height="150";
			B=B.parentNode.insertCell(-1);
			B.className="content_cell";
			B.id="CLMC_glossary_content";

			C=B.appendChild(document.createElement("DIV"));
			/*C.className="glossary_logo";
			C=C.appendChild(document.createElement("IMG"));
			C.src=this.img_path+"logo.gif";
			C.width="23";
			C.height="22";
			C.border="0";*/
			this.container.title_obj=B.appendChild(document.createElement("DIV"));
			this.container.text_obj=B.appendChild(document.createElement("DIV"));
			C=B.appendChild(document.createElement("DIV"));
			C.className="close_div";
			C.align="right";
			C.innerHTML="<a href=\"javascript:void(0);\" onclick=\"Page_Glossary.hide();Page_Glossary.complete_hide();\">Close</a>";
			
			C=this.container.related_link=B.appendChild(document.createElement("DIV"));
			C.id="CLMC_glossary_related";
			
			/*this.container.new_feature=C=B.appendChild(document.createElement("div"));
			C.className=C.id="new_feature";
			C.innerHTML="New Feature: &nbsp;<a href=\"/tools/feedback.asp?subject=Glossary+Feedback\" target=\"_blank\">Help us improve!</a>";
			this.container.new_feature=this.container.new_feature.firstChild.nextSibling;*/
			this.container.new_feature=""
			
			B=B.parentNode.insertCell(-1);
			B.height="100%";
			B.width="25";
			C=B.appendChild(document.createElement("IMG"));
			C.src=this.img_path+"right_top.png";
			C.width="25";
			C.style.height="10";
			C=B.appendChild(document.createElement("IMG"));
			C.src=this.img_path+"right.png";
			C.width="25";
			C.height="140";
			
			B=A.insertRow(-1);
			B=B.insertCell(-1);
			B.width="10";
			C=B.appendChild(document.createElement("IMG"));
			C.src=this.img_path+"bottom_left.png";
			C.width="10";
			C.height="25";
			B=B.parentNode.insertCell(-1);
			C=B.appendChild(document.createElement("IMG"));
			C.src=this.img_path+"left_bottom.png";
			C.width="10";
			C.height="25";
			C=B.appendChild(document.createElement("IMG"));
			C.src=this.img_path+"bottom.png";
			C.height="25";
			C.width="205";
			B=B.parentNode.insertCell(-1);
			B.width="25";
			C=B.appendChild(document.createElement("IMG"));
			C.src=this.img_path+"bottom_right.png";
			C.width=C.height="25";
			
			/*this.container.title_obj=B.insertCell(-1);*/
			this.container.title_obj.id="CLMC_glossary_title";
			this.container.title_obj.className="title1";
			this.container.title_obj=this.container.title_obj.appendChild(document.createElement("A"));
			this.container.title_obj.href="#";
			/*B=A.insertRow(-1);this.container.text_obj=B.insertCell(-1);*/
			this.container.text_obj.id="CLMC_glossary_text";
			this.container.text_obj.className="text1";
		}
		else {
			this.container.title_obj=this.container.firstChild.rows(1).cells(1).firstChild;
			if (this.container.title_obj.firstChild) this.container.title_obj=this.container.title_obj.firstChild;
			this.container.text_obj=this.container.firstChild.rows(1).cells(1).firstChild.nextSibling;
		}
		this.container.obj=this;
		this.container.onmouseover=this.cancel_hide;
		this.container.onmouseout=this.hide;
		this.initialized=true;
	}
	this.show=this.Show=function(elm) {
		if (!this.page_load_init()) return;
		this.cancel_show();
		this.cancel_hide();
		this.current_elm=elm;
		this.action="show";
		this.show_timer=window.setTimeout(this.timer_call, 500);
	};
	this.timer_call=function() {
		if (this.obj) obj=this.obj;
		else obj=this;
			switch(obj.action){
				case "show":obj.complete_show();
				break;
				case "hide":obj.complete_hide();
				break;
			}
		}
	this.complete_show=function(elm) {
		if (!this.container)return;
		if(!this.current_elm)this.current_elm=elm;
		var title_text=this.current_elm.innerHTML;
		this.current_item=this.current_elm.getAttribute("glossary_item");
		var obj=this.current_obj=glossary_items["g_"+this.current_item];
		this.container.title_obj.innerHTML=obj.word;
		/*this.container.new_feature.href="/tools/feedback.asp?subject=Glossary+Feedback&comment=RE:+Entry+for+"+obj.word+"+";*/
		if (typeof(obj.text)=="object") {
			/*multiple definitions */
			this.container.title_obj.removeAttribute("href");
			obj.text=this.format_text(obj);
			/*this.container.new_feature.href+="("+obj.kid[0]+")";*/
		} 
		/*else if (obj.article_count>0) {
			this.container.title_obj.href="/search/keyword.asp?kid="+obj.kid;
			this.container.new_feature.href+="("+obj.kid+")";
		} */
		else {
			this.container.title_obj.removeAttribute("href");
			/*this.container.new_feature.href+="("+obj.kid+")";*/
		}
		this.container.text_obj.innerHTML=obj.text;
		if (obj.article_count>0) {
			/*this.container.related_link.innerHTML="<a href=\"/search/keyword.asp?kid="+obj.kid+"\">See "+obj.article_count+" Related Articles</a>";
			this.container.related_link.style.visibility="visible";*/
		}
		else {
			this.container.related_link.style.visibility="hidden";
		}
		
		var pixel_top=(this.get_top(this.current_elm)-(this.prev_height-10));
			if (pixel_top<0)pixel_top=0;
		var pixel_left=((this.get_left(this.current_elm)-this.prev_width)/*just add 30 pixels instead*/+50/*removed because of multiline-glossary items - it would move the layer to extreme right||| +elm.offsetWidth*/);
			if (pixel_left<0)pixel_left=0;
		this.container.style.top=pixel_top+"px";
		this.container.style.left=pixel_left+"px";
		
		this.container.style.display="";
		pixel_top=(this.get_top(this.current_elm)-(this.container.clientHeight-10));
			if (pixel_top<0)pixel_top=0;
		pixel_left=((this.get_left(this.current_elm)-this.container.clientWidth)/*just add 30 pixels instead*/+50/*removed because of multiline-glossary items - it would move the layer to extreme right||| +elm.offsetWidth*/);
			if (pixel_left<0)pixel_left=0;
		this.container.style.top=pixel_top+"px";
		this.container.style.left=pixel_left+"px";
		this.prev_width=this.container.clientWidth;
		this.prev_height=this.container.clientHeight;
	}
	
	this.cancel_show=function(){
		window.clearTimeout(this.show_timer);
	}
	this.hide=this.Hide=function() {
		if (this.obj) obj=this.obj;
		else obj=this;
		if (!obj.page_load_init()) return;
		obj.cancel_show();
		obj.action="hide";
		obj.hide_timer=window.setTimeout(obj.timer_call, 500);
	}
	this.complete_hide=function() {
		if (this.obj)obj=this.obj;
		else obj=this;
		obj.container.style.display="none";
	}
	this.cancel_hide=function() {
		if (this.obj) window.clearTimeout(this.obj.hide_timer);
		else window.clearTimeout(this.hide_timer);
	}
	this.page_load_init=function() {
		if (this.initialized) return true;
		if (document.all&&document.readyState!="complete") return false;
		this.init();
		return true;
	}
	this.get_left=function(elm) {
		var left=elm.offsetLeft;
		while((elm=elm.offsetParent)!=null) left+=elm.offsetLeft;
			return left;
		};
	this.get_top=function(elm) {
		var top=elm.offsetTop;
			while((elm=elm.offsetParent)!=null)	top+=elm.offsetTop;
				return top;
			}
	this.format_text=function(o) {
		var s_text="";
			for (var i=0;i<o.text.length;i++) {
				s_text+="<div class=\"text_mult\">"+String.fromCharCode(i+97)+") " + o.text[i]+(o.article_count[i]>0?" (<a href=\"/search/keyword.asp?kid="+o.kid[i]+"\">See "+o.article_count[i]+" related articles</a>)</div>":"</div>");
			}
			return s_text;
		}
};
function show_glossary(elm) {
	if (typeof(Page_Glossary)=='undefined') Page_Glossary=new CLMC_Glossary();
	if (!elm) elm=this;
	Page_Glossary.show(elm);}
//	if (typeof(window.onload)=='function') {func=window.onload;window.onload=function(){func();Page_Glossary=new CLMC_Glossary();}} else window.onload=function(){Page_Glossary=new CLMC_Glossary();}
//</script>
