var __subtoolbar = null;
function onsubtoolbar_goto(sAli)
{
	submitParamForm(new Array("alias", sAli, "invalidatesession", "false"));
	return false;
}
function onsubtoolbar_close(e)
{
	__subtoolbar.style.display	= "none";
	return false;
}
function onsubtoolbar(e, a)
{
	var s = "<table id='subtoolbar_table'><tr><td width='100%' colspan='2' class='subtoolbarHeader'><table width='100%'><tr><td class='lamelle2'>Bereiche</td><td align=right><a href='#' class='subnavLink' onclick='return onsubtoolbar_close(this);'>X</a></td></tr></table></td></tr>";
	for(var i=0;i<a.length;i++)
	{
		var asub = a[i];if(asub.length < 3)continue;	//ali,title,img
		var ss = "<tr><td width='16'><img src='"+asub[2]+"'/></td><td><a href='#' class='treeitemmouseout span_treeitem' onclick=\"return onsubtoolbar_goto('"+asub[0]+"');\">"+asub[1]+"</a></td></tr>";
		s += ss;
	}
	s += "</table>";
	
	{
		if(!__subtoolbar)
		{
			__subtoolbar = document.createElement("div");
			__subtoolbar.style.position        = "absolute";
			__subtoolbar.style.backgroundColor = "#efefef";
			__subtoolbar.style.border          = "solid 1px #BBBFC2";
			document.getElementsByTagName("div")[0].appendChild(__subtoolbar);
		}
		__subtoolbar.innerHTML = s;

		var left = getPosLeft(e)+ e.offsetWidth;
		var top  = getPosTop(e) + e.offsetHeight;
		
		__subtoolbar.style.pixelLeft= left;
		__subtoolbar.style.pixelTop = top;
		__subtoolbar.style.left 	= left+"px";
		__subtoolbar.style.top 		= top +"px";
		__subtoolbar.style.display	= "block";
	}
	return false;
}
function on_nutzerprofil(product, un)
{
	var myurl = getpath(removeparams(self.location.href));
	var url = "http://www.produktregistrierung.de/meinboac?produkt="+product+"&un="+un+"&url="+myurl;
	self.location.href = url;
	return false;
}
function printdirect()
{
	// BB specific skirmish 
	var dociframe = frames['documentwindow'];
	if(!dociframe)
	{
		dbg(iERR, "printdirect\n!dociframe");
		return false;
	}
	{
		var src = g_sCurrentSrc;
		if((src != null) && (src.indexOf("_scaffold.htm") > 2))
		{
			var sOnlyAnchor = frames['documentwindow'].window.location.hash.toLowerCase().replace(/#/, "");
			frames['documentwindow'].window.scaffold_printdoc(sOnlyAnchor,sOnlyAnchor,0);
			return false;
		}
	}

	printDoc();
	
	return false;
}
function add2outputman(oLnk,sBeanName, sAli, bReloadAfterOK)
{
	if((sAli == null) || (sAli == "") && (__scaffoledlnk_clicked_ali != null))
	{
		sAli = __scaffoledlnk_clicked_ali;
	}
	
    var s="jsessionid="+sessionid;
    
	var sParams = "object="+sBeanName+"&invalidatesession=false&ajaxcall=1&alias="+sAli+"&onlydoc=1&action=add2outputman&tmpstmp="+(new Date()).getMilliseconds();
    var sUrl 	= getpath(removeparams(self.location.href))+"/standard/jsp/shiajaxcommunicator.jsp;"+s+"?"+sParams;
    var sContent= s + "&" + sParams;
    var myreq 	= getHTTPObject();
	
    if (myreq == null)
    {
        dbg(iERR, "add2outputman\n!myreq");
        return false;
    }
    if(true)
    {
        function add2outputman_response()
        {
            if(myreq == null)
            {
                dbg(iERR, "add2outputman_response\n!myreq");
                return false;
            }
            if (myreq.readyState    != 4)           //4 == "Complete" in ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
                return;
            if (!responseIsSuccess(myreq))
                return;
            var sAnswer = trim(myreq.responseText);
			if (sAnswer.length != 1)
			{
				dbg(iERR, "add2outputman_response\n!sAnswer:'"+sAnswer+"'");
				return false;
			}
			if(sAnswer == "2")
			{
				msgbox(oLnk,"Das Dokument ist bereits im Ausgabemanager.", sBeanName, false, false, true, 'Ausgabemanager');
				return false;
			}
			if(sAnswer == "1")
			{
				msgbox(oLnk,"Das Dokument wurde im Ausgabemanager hinzugefügt.", sBeanName, bReloadAfterOK, false, true, 'Ausgabemanager');
				return false;
				//alert("Das Dokument wurde im Ausgabemanager hinzugefügt.");
				try
				{
					reloadmypage(sBeanName);
				}
				catch(e)
				{
					try
					{
						reloadmypage("dummybean");
					}
					catch(e2) {}
				}
				return false;
			}
			
			alert("Bitte, wählen Sie ein gültiges Dokument!");
            return false;
        }
    }
    myreq.onreadystatechange = add2outputman_response;
    myreq.open("POST", sUrl, true);
    myreq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    if (window.XMLHttpRequest)
    {
        myreq.send(sContent);
    }
    else if (window.ActiveXObject)  // branch for IE/Windows ActiveX version
    {
       myreq.send(sContent);
    }	
	return false;	
}
 function limitedSearchPopUp(popId,framepopId,start)
 { 
 	var popupDiv 		= document.getElementById(popId);
	var popupDivIframe 	= document.getElementById(framepopId);
    if(!popupDiv || !popupDivIframe)
	{
		//alert(popupDivIframe+"\n"+popupDiv+"\n"+popId+"\n"+framepopId);
    	return;
	}
     var topPos = getPosTop(start);
     
     popupDiv.style.top 	= topPos +18+"px";
     popupDiv.style.left 	= getPosLeft(start)+"px";
     popupDivIframe.style.top	= getPosTop(start)+18+"px";
     popupDivIframe.style.left	= getPosLeft(start)+"px";
     
     var pos = 500;
     
     if(popupDiv.style.display=='none')
	 {
         dojo.lfx.explode(start,framepopId, pos).play();
         dojo.lfx.explode(start,popId, pos).play();
     }
     else
	 {
         dojo.lfx.implode(popId, start, pos).play();
         dojo.lfx.implode(framepopId, start, pos).play();
     }
 }
 
var g_onfocushitlistdropdown_checked = false;
function onfocushitlistdropdown(select, sBeanName)
{
	if(g_onfocushitlistdropdown_checked)
		return;
	g_onfocushitlistdropdown_checked = true;
	
	if(select.options.length > 2)
	{
		return;
	}
	if(select.options.length == 2)
	{
		if(select.options[1].value != "")
		{
			return;
		}
	}
    var s="jsessionid="+sessionid;
	var sParams = "object="+sBeanName+"&invalidatesession=false&ajaxcall=1&action=getFilterOptionsAsList&tmpstmp="+(new Date()).getMilliseconds();
    var sUrl 	= getpath(removeparams(self.location.href))+"/standard/jsp/shiajaxcommunicator.jsp;"+s+"?"+sParams;
    var sContent= s + "&" + sParams;
    var myreq 	= getHTTPObject();
	
    if (myreq == null)
    {
        dbg(iERR, "onfocushitlistdropdown\n!myreq");
        return false;
    }
    if(true)
    {
        function onfocushitlistdropdown_response()
        {
            if(myreq == null)
            {
                dbg(iERR, "onfocushitlistdropdown_response\n!myreq");
                return false;
            }
            if (myreq.readyState    != 4)           //4 == "Complete" in ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
                return;
            if (!responseIsSuccess(myreq))
                return;
            var sAnswer = trim(myreq.responseText);
			if (sAnswer.length < 1)
			{
				dbg(iERR, "onfocushitlistdropdown_response\n!sAnswer:'"+sAnswer+"'");
				return false;
			}
			
			var aAnswer 		= sAnswer.split("</option>");
			var iValueBegin 	= "<option value=\"".length;
			var iValidEntries 	= 0;
			for(var i=0; i < aAnswer.length; i++)
			{
				if(trim(aAnswer[i]) == "") continue;
				if(iValidEntries < 1)
				{
					iValidEntries++;
					continue;	//"Suche eingrenzen" can be let unchanged
				}
				var iValueEnd = aAnswer[i].indexOf('\"', iValueBegin);
				var sValue 	  = aAnswer[i].substring(iValueBegin, iValueEnd);
				var sLabel 	  = aAnswer[i].substring(aAnswer[i].indexOf('>', iValueEnd)+1);
				var sStyle 	  = "";//"margin-left:0em";

				var sLastSl = "";
				if(true)
				{
					for(var iS=0; iS < sLabel.length; iS++)
					{
						if(sLabel.charAt(iS) != String.fromCharCode(160))break;
						sLastSl += (String.fromCharCode(160) + String.fromCharCode(160));
					}
					if(sLastSl.length > 0)
					{
						//sLabel = sLastSl + sLabel.substring(sLastSl.length() * "&nbsp;".length);
						//sStyle = "margin-left:"+(sLastSl.length/4)+"em";
					}
				}
				/*
				if(true)
				{
					var iStyle 	  = aAnswer[i].indexOf(" style=\"");
					if (iStyle > 1)
						sStyle = aAnswer[i].substring(iStyle + " style=\"".length, aAnswer[i].indexOf('\"', iStyle + " style=\"".length+ 1));
				}
				*/
				if(iValidEntries < 2)
				{
					select.options[select.options.length-1] = new Option(sLabel,sValue,false,false);
					iValidEntries++;
					continue;
				}
				var o = new Option(sLabel,sValue,false,false);
				if(sStyle != "")
				{
					o.setAttribute("style",sStyle);
				}
				select.options[select.options.length] = o;
				iValidEntries++;
			}
			//ie: how to open select again?
            return false;
        }
    }
    myreq.onreadystatechange = onfocushitlistdropdown_response;
    myreq.open("POST", sUrl, true);
    myreq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    if (window.XMLHttpRequest)
    {
        myreq.send(sContent);
    }
    else if (window.ActiveXObject)  // branch for IE/Windows ActiveX version
    {
       myreq.send(sContent);
    }
	return false;
}
function onchangehitlistdropdown_ajax(select, sBeanName, sAli)
{
    var s="jsessionid="+sessionid;
	var sParams = "object="+sBeanName+"&invalidatesession=false&alias="+sAli+"&ajaxcall=1&action=onChangeFilter&tmpstmp="+(new Date()).getMilliseconds();
    var sUrl 	= getpath(removeparams(self.location.href))+"/standard/jsp/shiajaxcommunicator.jsp;"+s+"?"+sParams;
    var sContent= s + "&" + sParams;
    var myreq 	= getHTTPObject();
	
    if (myreq == null)
    {
        dbg(iERR, "onchangehitlistdropdown_ajax\n!myreq");
        return false;
    }
    if(true)
    {
        function onchangehitlistdropdown_ajax_response()
        {
            if(myreq == null)
            {
                dbg(iERR, "onchangehitlistdropdown_ajax_response\n!myreq");
                return false;
            }
            if (myreq.readyState    != 4)           //4 == "Complete" in ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
                return;
            if (!responseIsSuccess(myreq))
                return;
            self.location.href = "./index.jsf?from=onChangeFilter&selecttab=1&tmpstmp="+(new Date()).getMilliseconds();
            return false;
        }
    }
    myreq.onreadystatechange = onchangehitlistdropdown_ajax_response;
    myreq.open("POST", sUrl, true);
    myreq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    if (window.XMLHttpRequest)
    {
        myreq.send(sContent);
    }
    else if (window.ActiveXObject)  // branch for IE/Windows ActiveX version
    {
       myreq.send(sContent);
    }
	return false;
}
function onchangehitlistdropdown_form(select, sBeanName, sAli)
{
	document.getElementById("hitlist_hitlistdropdown_selected_alias").value = sAli;
	document.getElementById("hitlistdropdownform").submit();
	return false;
}
function onchangehitlistdropdown(select, sBeanName)
{
	var sAli = select.options[select.selectedIndex].value;
	
	if(typeof submitParamForm == "undefined" ||
			   !submitParamForm(new Array(sBeanName+"_hitlistdropdown_selected_alias", sAli,
					                      "invalidatesession" , "false",
					                      "beanname"          , sBeanName)))
	{
	    var s=";jsessionid="+sessionid;
	    self.location.href = "./"+getfilename(self.location.href)+s+"?"+sBeanName+"_hitlistdropdown_selected_alias="+sAli+"&invalidatesession=false&beanname="+sBeanName+"&t="+(new Date()).getMilliseconds();
	}	
    return false;
}
function onNewSearch(btn, sFormIDPart)
{
    var frm = null;
    while(btn)
    {
        if(btn.tagName && (btn.tagName.toLowerCase() == "form"))
        {
            frm = btn;
            break;
        }
        btn = btn.parentNode;
    }
    if(!frm)
    {
        dbg(iERR, "onNewSearch\nE1");
        return false;
    }
	for(var i=0; i < frm.elements.length; i++)
	{
		if(frm.elements[i].type == "text")
		{
			frm.elements[i].value = "";
			continue;
		}
		if(frm.elements[i].type == "select-one")
		{
			frm.elements[i].value = "";
			continue;
		}
		//alert("id:"+btn.form.elements[i].id+"\ntype:"+btn.form.elements[i].type+"\nvalue:"+btn.form.elements[i].value);
	}
	return false;
}

function msgbox(ele, sTxt, sBeanName, bReloadAfterOK, bPopupRights)
{
	msgbox(ele, sTxt, sBeanName, bReloadAfterOK, bPopupRights, true);
	return false;
}

function msgbox(ele, sTxt, sBeanName, bReloadAfterOK, bPopupRights, bAsDlg)
{
	msgbox(ele, sTxt, sBeanName, bReloadAfterOK, bPopupRights, bAsDlg, 'Nachricht');
	return false;
}

function msgbox(ele, sTxt, sBeanName, bReloadAfterOK, bPopupRights, bAsDlg, sTitle)
{	
	if(typeof(ele) == "string")
	{
		ele = document.getElementById(ele);
	}
	var odiv = document.createElement("div");
	var divid = (new Date()).getMilliseconds();
	odiv.id = divid;
	odiv.style.zIndex 		   = 1100;
	odiv.style.position        = "absolute";
	odiv.style.display 		   = "block";
	odiv.style.width 		   = "200px";
	odiv.style.visibility 	   = "visible";
	odiv.style.backgroundColor = "#efefef";
	odiv.style.border          = "solid 1px #BBBFC2";
	

	//document.getElementsByTagName("body")[0].appendChild(odiv);	//changes scrollpos in iframe in ie6 sometimes!
	document.getElementsByTagName("div")[0].appendChild(odiv);

	var sOnClick = "document.getElementById('"+divid+"').style.border='0px';document.getElementById('"+divid+"').innerHTML='';" + (bReloadAfterOK ? "reloadmypage('"+sBeanName+"');" : "");
	if (bAsDlg) 
		odiv.innerHTML = "<form class='formDiv'><div class='flyoutHeader'><span style='float:left; font-weight:bold; margin-left:10px; margin-top:8px; vertical-align:middle;'>" + sTitle + "</span></div><div style='padding:10px;'>" + sTxt + "</div><div class='flyoutFooter'><input type=button title='OK' value='OK' onclick=\"" + sOnClick + "\" class='expandedFormopt lamelle2' style='width:80px;margin-right:10px;margin-top:5px;margin-bottom:5px;font-weight:bold;font-family:arial;background:transparent url(./boorberg/images/htg/button.gif)' /></div></form>";
	else 
	{
		odiv.innerHTML = "<div>" + sTxt + "</div>";
	}
	
	var left= 0;
	var top	= 0;
	
	if(!ele || ((ele.offsetHeight < 2) && (ele.offsetWidth < 2)))
	{
		var iWinWidth = document.all ? (document.documentElement.clientWidth  ? document.documentElement.clientWidth  : document.body.clientWidth)  : window.innerWidth;
		var iWinHeight= document.all ? (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight) : window.innerHeight;
		left= iWinWidth/2;
		top	= iWinHeight/2;
	}
	else
	{
		if (!bPopupRights) 
		{
			left = getPosLeft(ele) - odiv.offsetWidth + ele.offsetWidth;
		}
		else
		{
			left = getPosLeft(ele) + ele.offsetWidth;
		}
		top	= getPosTop(ele) + ele.offsetHeight;
	}
	odiv.style.pixelLeft= left;
	odiv.style.pixelTop = top;
	odiv.style.left 	= left+"px";
	odiv.style.top 		= top+"px";
	return odiv;
}
function bblogout()
{
	self.location.href = "j_spring_security_logout?url="+window.location.pathname+"&t="+(new Date()).getMilliseconds();
	return false;
	self.location.href = "./standard/jsp/logout.jsp?tmpstmp="+(new Date()).getMilliseconds();
	return false;
}
function bblogin(sUrl, sParam)
{
	self.location.href = "./boorberg/static/makrolog.protected.jsp?t="+(new Date()).getMilliseconds();
	return false;
}
function dogoto(frm, sBeanName)
{
	var sGoToPara = null;
	
	if (frm['gotopara'] != null)
		sGoToPara = frm['gotopara'].value;
	if((sGoToPara == null) && (frm('gotopara') != null))
		sGoToPara = frm('gotopara').value;
	if((sGoToPara == null) || (sGoToPara == "") || (sGoToPara == " "))
	{
		return false;
	}
	var s=";jsessionid="+sessionid;
	self.location.href = "./"+getfilename(self.location.href)+s+"?"+sBeanName+"_dogoto_para="+sGoToPara+"&invalidatesession=false&beanname="+sBeanName;
	return false;
}
function gotosite(iSite, sBeanName)
{
	if(typeof submitParamForm == "undefined" ||
			   !submitParamForm(new Array(sBeanName+"_hitlistdropdown_navigation", iSite,
					                      "invalidatesession" , "false",
					                      "beanname"          , sBeanName)))
	{
	    var s=";jsessionid="+sessionid;
	    self.location.href = "./"+getfilename(self.location.href)+s+"?"+sBeanName+"_hitlistdropdown_navigation="+iSite+"&invalidatesession=false&beanname="+sBeanName+"&t="+(new Date()).getMilliseconds();
	}
    return false;	
}
function onClickedVersion(sId, sFN, sAli)
{
	IPDoLinkFS("./bbdisplay.jsp?file="+sFN);
	return false;
	var s=";jsessionid="+sessionid;
    self.location.href = "./"+getfilename(self.location.href)+s+"?gotoversion=1&VersId="+sId+"&fn="+sFN+"&doc="+sFN+"&invalidatesession=false&beanname=BBParaVer&t="+(new Date()).getMilliseconds();
    return false;
}
function onClickedContext(sId, sFN, sAli)
{
	IPDoLinkFS("./bbdisplay.jsp?file="+sFN);
	return false;
	var s=";jsessionid="+sessionid;
    self.location.href = "./"+getfilename(self.location.href)+s+"?gotocontext=1&contexttargetId="+sId+"&invalidatesession=false&beanname=BBBrowseDocs&t="+(new Date()).getMilliseconds();
    return false;
}

var __hintele = null;
function showHint(e, sHint,bRights)
{
	__hintele = msgbox(e, sHint, "sBeanName", false/*!reloadafterok*/, bRights, false/*!asdlg*/);
}
function hideHint(e, sHint)
{
	if(!__hintele)return;
	__hintele.style.visibility 	= "hidden";
}

function linksourcetabchange(iClicked)
{
	var i=0;
	while(true)
	{
		i++;
		//var elsc1 = document.getElementById("linksourcecomment1_"+i);
		//var elsc2 = document.getElementById("linksourcecomment2_"+i);
		var elsi  = document.getElementById("linksourceicon_"+i);
		if(!elsi)break;
		var elst  = document.getElementById("linksourcetext_"+i);
		var elstb = document.getElementById("linksourcetable_"+i);
		
		//elsc1.className =  ((i == iClicked) ? "" : "op");
		//elsc2.className =  ((i == iClicked) ? "" : "op");
		elsi.className =   ((i == iClicked) ? "" : "op");
		elst.className =   ((i == iClicked) ? "" : "op");
		elstb.className =  ((i == iClicked) ? "" : "op");
		
		document.getElementById("linksourcelist_"+i).style.display = ((i == iClicked) ? "inline" : "none");
		
		elstb.parentNode.style.borderBottomWidth = ((i == iClicked) ? "0px" : "1px");
	}
	return false;
}

/**
 * browser independent solution for submit search from input window with enter keypress.
 * @author mf
 * @param event of document window context
 * @param formId html form id
 * @param submitButtonId the absolute id of the commandlink
 * @return 
 */
function submitSearch(event,formId,submitButtonId) {
	
	if (ie4) {
        if (window.event && window.event.keyCode == 13) {
        	oamSubmitForm(formId,submitButtonId);
        	return false;
        }
        else
            return true;
    } else if (event && event.which == 13) {
    	try {
    		oamSubmitForm(formId,submitButtonId);
    		return false
    	} catch(e) {}
        return false;
    } else {
    	return true;
    }
}

/**
 * Oefnnet einen Layer
 * @param popId
 * @param framepopId
 * @param start
 * @param startDistance, Abstand von start Element
 */
function bbPopUp(popId,framepopId,start,startDistance,posLeft) {
 	//Letze geöffnete Fenster schliessen
 	if (lastPopUpFrame != null && lastPopUp != null && lastStart != null)
 	{
 	  if (lastPopUpFrame != framepopId && lastPopUp != popId )
 	  {
 	        dojo.lfx.implode(lastPopUp, lastStart, 500).play();
            dojo.lfx.implode(lastPopUpFrame, lastStart, 500).play();
            //shiFadeElementIn('documentwindow');<-- macht Probleme bei der PDF anzeige
      }
 	} 
   
    var newLeftPosition;
    var popDivElement = document.getElementById(popId);
    var popupDivIframeS = document.getElementById(framepopId);
    var windowWidth = getWindowWidth();
    var newTopPosition = getPosTop(start) + startDistance+"px"
    var popDivElementWidth = popDivElement.style.width.replace("px","");
    var iPosLeftStart = getPosLeft(start);
    
    if (iPosLeftStart < 1)
    	iPosLeftStart = document.all ? (document.documentElement.clientWidth  ? document.documentElement.clientWidth  : document.body.clientWidth)  : window.innerWidth;

    if (posLeft == 'r')
    {
//       posLeft = windowWidth - iPosLeftStart - popDivElementWidth;
//       newLeftPosition = (iPosLeftStart + posLeft - 10) + "px";
       popDivElement.style.right = "8px";
       popupDivIframeS.style.right = "8px";
    }
    else if (posLeft == 'c')
    {
    	// centered
    	newLeftPosition = ((windowWidth - popDivElementWidth)/2) + "px";

        popDivElement.style.left = newLeftPosition;
    	popupDivIframeS.style.left= newLeftPosition;
    }
    else
    {
       newLeftPosition = iPosLeftStart - posLeft + "px";

       popDivElement.style.left = newLeftPosition;
   	   popupDivIframeS.style.left= newLeftPosition;
    }
    
	popDivElement.style.top  = newTopPosition;
	popupDivIframeS.style.top = newTopPosition;
	
	if(popDivElement.style.display=='none')
	{
            dojo.lfx.explode(start,framepopId, 500).play();
            dojo.lfx.explode(start,popId, 500).play();
            //shiFadeElementOut('documentwindow');<-- macht Probleme bei der PDF anzeige
            lastStart=start;
            lastPopUpFrame=framepopId;
            lastPopUp=popId;
	}
	else
	{
            implode(popId,framepopId,start);
            lastStart=null;
    		lastPopUpFrame=null;
    		lastPopUp=null;
	}
}

function doAddToFavorites()
{
	var sAli = g_sCurrentAlias;
	if(sAli == "")
	{
		alert("Wählen Sie ein Dokument im Baum aus!");
		return;
	}
  
	var sTopLoc = top.location.href.replace(/\?.*/, "");
	if(sTopLoc.indexOf('?') > 1)
		sTopLoc = sTopLoc+"&alias="+sAli;
	else
		sTopLoc = sTopLoc+"?alias="+sAli;

	var sGesetz = "Gesetz";
	var dociframe = frames['documentwindow'];
	if(dociframe)
		sGesetz = dociframe.document.title;
  
	if(sGesetz=="")
		sGesetz = "Gesetz";

	var sTxt = window.prompt("Geben Sie den Namen für den Favoriten-Eintrag an", sGesetz);
	if(sTxt == null)
		return;
	if(sTxt == "")
		sTxt = "Gesetz";

	if(sTxt.length > 189)
		sTxt = (sTxt.substring(0, 185) + "...");

	if(document.all)
		top.window.external.AddFavorite(sTopLoc, sTxt);
	else if(window.sidebar)
		top.window.sidebar.addPanel(sTxt, sTopLoc,'');
}

