			var positionaaaaaaaabbbcbccc = new Array();
			var dictStrings=new Array();
			var visible=0;
			var regi = document.onmousemove;
			var glossaryEnabled = null;
			var glossaryWordFound = false;
			var glossaryLocMessage = null;
			var glossarySwitched;
			if (!document.all) {
				document.captureEvents(Event.MOUSEMOVE);
			}

			function setSwitchTo(switcher, locmessage) {
				switch (switcher) {
					case 1 :
						glossaryEnabled = true;
						break;
					default :
						glossaryEnabled = false;
						break;
				}
				glossaryLocMessage = locmessage;
			}
			
			function switchGlossary(){
				req=ponte.Services.AjaxService.createRequest(urlprefix+'?ajaxrequest=GlossaryAction&changePref=change&now='+glossarySwitched,reloadPage,null,'GET',null);
				req.makeRequest();
			}
			function reloadPage(a){
				window.location.reload();
			}
			function showGlossarySwitch() {
				var cfelement = document.getElementById("ContentFunction");
				if( cfelement != undefined ) {
					if( (glossaryEnabled && glossaryWordFound) || !glossaryEnabled ) {
						gselement = document.createElement("span");
						gselement.setAttribute("id","GlossarySwitcher");
						gselement.setAttribute("class","GlossarySwitcher");
						imgelement = document.createElement("img");
						aelement = document.createElement("a");
						if( glossaryEnabled ) {
							imgelement.setAttribute("src","/sites/bet/images/glossaryswitch_on.gif");
						}else
						{
							imgelement.setAttribute("src","/sites/bet/images/glossaryswitch_off.gif");
						}
						aelement.setAttribute("title",glossaryLocMessage);
						aelement.setAttribute("href","javascript:switchGlossary()");
						aelement.appendChild(imgelement);
						gselement.appendChild(aelement);
						cfchildren = cfelement.getElementsByTagName("span");
						if( cfchildren != undefined ) {
							for( i in cfchildren ) {
								if( cfchildren[i].className == "Minus" ) {
									ipelement = cfchildren[i];
									break;
								}
							}
						}
						if( ipelement != undefined ) {
							cfelement.insertBefore(gselement, ipelement);
						}else
						{
							cfelement.appendChild(gselement);
						}
					}
				}
			}
			function setDictWords() {
				glossarySwitched="on";
				document.onmousemove=getMouseXY;
				try{
					var cikk=document.getElementsByTagName('table');
					for(var i=0;i<cikk.length;i++){
						if(cikk[i].className=='ContentViewPortlet'){
							cikk=cikk[i];
							break;
						}
					}
					cikk=cikk.getElementsByTagName('div');
					for(var i=0;i<cikk.length;i++){
						if(cikk[i].className=='Body'){
							cikk=cikk[i];
							break;
						}
					}
					var originalString = ""+cikk.innerHTML;
					var className = "glossarySelection";
					for( var i = 0; i < dictWords.length; i++ ) {
						var regex = new RegExp('((<(!--|b|img|li|p|span|u|ul)(?! class=\"'+className+'\")[^>]*>([^<>]*<\/(b|span|u)[^>]*>)?)[^<>]*)('+dictWords[i]+')([^<]*(<\/(b|li|p|span|u|ul)>|<(b|span|u)[^>]*>|<a|<!--))','i');
						var firstFoundIndex = originalString.search(regex);
						if( firstFoundIndex != -1 ) {
						    if( !glossaryWordFound ) { glossaryWordFound = true; }
						    originalStringFirstPart = originalString.substring(0,firstFoundIndex);
						    originalStringFoundPart = originalString.substring(firstFoundIndex);
						    originalString = originalStringFirstPart + originalStringFoundPart.replace(new RegExp('('+dictWords[i]+')','i'),'<span class="'+className+'" onmouseover="javascript: showDictInfo(\''+dictWords[i]+'\')\;" onmouseout="javascript:hideDictInfo()\;">$1<!--matched--></span>');
						}
//						originalString = originalString.replace(regex,'$1<span class="'+className+'" onmouseover="javascript: showDictInfo(\''+dictWords[i]+'\')\;" onmouseout="javascript:hideDictInfo()\;">$6<!--matched--></span>$7');
					}
					cikk.innerHTML = originalString;
				}catch(e){
//					alert(e);
				}
			}
			function getDictString(dictWord) {
				return dictStrings[dictWord];
			}
			function queryAjaxGet(dictWord){
				req=ponte.Services.AjaxService.createRequest(urlprefix+"?ajaxrequest=GlossaryAction&word="+dictWord,answerCall,null,"GET",null);
				req.makeRequest(dictWord);
			}
			function showDictString(dictWord,magyarazo){
				if(visible==1){
							var myWidth = 0, myHeight = 0;
							  if( typeof( window.innerWidth ) == 'number' ) {
							    //Non-IE
							    myWidth = window.innerWidth;
							    myHeight = window.innerHeight;
							  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
							    //IE 6+ in 'standards compliant mode'
							    myWidth = document.documentElement.clientWidth;
							    myHeight = document.documentElement.clientHeight;
							  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
							    //IE 4 compatible
							    myWidth = document.body.clientWidth;
							    myHeight = document.body.clientHeight;
			  				}
			  		
					var dictPopupElement = document.getElementById('dictPopup');
					dictPopupElement.innerHTML = '<h1>'+dictWord+'</h1><p>'+magyarazo+'</p></div>';
					dictPopupElement.style.left = positionaaaaaaaabbbcbccc['x']-((screen.availWidth-990)/2)+'px';
					dictPopupElement.style.top = positionaaaaaaaabbbcbccc['y']+'px';
					dictPopupElement.style.visibility = 'visible';
				}
			}
			function showDictInfo(dictWord) {
				visible=1;
				if(dictStrings[dictWord]==null) queryAjaxGet(dictWord);
				else showDictString(dictWord,getDictString(dictWord));
			}
			function hideDictInfo() {
				visible=0;
				document.getElementById('dictPopup').style.visibility = 'hidden';
			}
			function getMouseXY(e) {
	
				if (document.all) {
					positionaaaaaaaabbbcbccc['x'] = event.clientX + document.documentElement.scrollLeft;
					positionaaaaaaaabbbcbccc['y'] = event.clientY + document.documentElement.scrollTop;
				}else
				{
					positionaaaaaaaabbbcbccc['x'] = e.pageX;
					positionaaaaaaaabbbcbccc['y'] = e.pageY;
				}
				//console.log('x:'+positionaaaaaaaabbbcbccc['x']+' y:'+positionaaaaaaaabbbcbccc['y']);
				//console.log(regi);
				if(regi!=undefined) regi(e);

			}
			function switchOffDictWordService() {
				var date = new Date();
				date.setTime(date.getTime()+(365*24*60*60*1000));
				alert('dictWordService=off; expires= '+date.toGMTString()+'; path=/');
			}
			
			
			
			function answerCall(httpRequest,dictWord)
			{
				dictStrings[dictWord]=httpRequest.responseXML.getElementsByTagName('dictWord')[0].firstChild.nodeValue;
				showDictString(dictWord,dictStrings[dictWord]);
			}
