function fncSelCmb_all(form,feld){ 
	for(i=0;i<document[form][feld].length;++i){ 
  	document[form][feld].options[i].selected = true;
   }
 }

function fncSelCmb_one(form,feld)
{ wert=new Array();
  for(i=0;i<document[form][feld].length;++i)
    if(document[form][feld].options[i].selected == true)
	  { wert["text"]=document[form][feld].options[i].text;
 	    wert["value"]=document[form][feld].options[i].value;
      wert["index"]=i;
    }
    return wert;
}

function fncCmb2Cmb(form_s,feld_s,form_t,feld_t,msg)
{ for(e=0;e<document[form_s][feld_s].length;++e)
	{	if (document[form_s][feld_s].options[e].selected == true)
		s=1;
	}
	if(s==1)	
	{	V= new Array();
		I= new Array();
	  for(y=0;y<document[form_s][feld_s].length;++y)
		{	if (document[form_s][feld_s].options[y].selected == true)
		 	{ V[1]=(document[form_s][feld_s].options[y].value);
				V[0]=(document[form_s][feld_s].options[y].text);
				V[2]=1;
				I[I.length]=V.join("|");
			}
	  }
	  var s=I.join(";");
		var a=Array(), o=Array();ex=0
	  a=s.split(";");
	  for(i=0;i<a.length;++i)
	  { ex=0;
			o=a[i].split("|");
			for(j=0;j<document[form_t][feld_t].length;++j)
			{	if(document[form_t][feld_t].options[j].value == o[1])
				{ alert(document[form_t][feld_t].options[j].text+" "+msg);
					ex=1;
				}
			}
			if (ex==0)
			{	item_new = new Option(o[0]);
			  document[form_t][feld_t].options[document[form_t][feld_t].length] = item_new;
			  item_new.value=o[1];
			}
		} 
	}
}

function fncDelSelItemCmb(form,feld)
{ for(i=document[form][feld].length-1;i>-1;--i)
  { if(document[form][feld].options[i].selected == true)
    document[form][feld].options[i] = null;
  }
}

function fncDelItemCmb(form,feld)
{ fncSelCmb_all(form,feld);
  for(i=document[form][feld].length-1;i>-1;--i)
  { if(document[form][feld].options[i].selected == true)
    document[form][feld].options[i] = null;
  }
}

function fncCmbAll2String(form,feld)
{ var Werte= new Array();
  for(i=0;i<document[form][feld].length;++i)
    Werte[i]=document[form][feld].options[i].value;
  return Werte.join("|");
}

function fncCmbSel2String(form,feld)
{ Werte= new Array();
  for(i=0;i<document[form][feld].length;++i)
   { if (document[form][feld].options[i].selected == true)
       Werte[Werte.length]=(document[form][feld].options[i].value);
   }
  return Werte.join("|");
}

/*************************************************************************************************/

function fncShowHideLayer(Lay,x,y,v)
{	var v;
	if (document.layers)	
	{	if (x && y)
		{	document[Lay].left=x;
			document[Lay].top=y;
		}
		if (v=="show" && document[Lay].visibility!="hide")
		{	document[Lay].visibility="hide";
		}
		else if (v=="show" && document[Lay].visibility!="show")
		{	document[Lay].visibility="show";
		}
		else if (v=="hide" && document[Lay].visibility!="hide")
		{	document[Lay].visibility="hide";
		}
		else if (v=="hide" && document[Lay].visibility!="show")
		{	document[Lay].visibility="show";
		}
	}
	if (document.all)
	{	if (x && y)
		{	document.all[Lay].style.setAttribute("position" ,"absolute",false);
			document.all[Lay].style.setAttribute("left", x, false);
			document.all[Lay].style.setAttribute("top", y, false);
		}
		if (v=="show" && document.all[Lay].style.getAttribute("visibility",false)!="hidden")
		{	document.all[Lay].style.setAttribute("visibility","hidden",false);
		}
		else if (v=="show" && document.all[Lay].style.getAttribute("visibility",false)!="visible")
		{	document.all[Lay].style.setAttribute("visibility","visible",false);
		}
		else if (v=="hide" && document.all[Lay].style.getAttribute("visibility",false)!="hidden")
		{	document.all[Lay].style.setAttribute("visibility","hidden",false);
		}
		else if (v=="hide" && document.all[Lay].style.getAttribute("visibility",false)!="visible")
		{	document.all[Lay].style.setAttribute("visibility","visible",false);
		}
	}
}   

function fncPrintIt()
{	if (window.print) 
	{	window.print();
	}  
	else if (document.all)
	{	var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
	 	document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
	  WebBrowser1.ExecWB(6, 1);// 1=dialogbox 2 keine dialogbox  
	}
}

function fncAbortPrintSend()
{ document.bewerb.action="bwerb_neu.php3";
	document.bewerb.submit();
	return true;
}

function fncShakeIt(n) 
{	if (parent.moveBy) 
	{	for (i = 10; i > 0; i--) 
		{	for (j = n; j > 0; j--) 
			{	parent.moveBy(0,i);
				parent.moveBy(i,0);
				parent.moveBy(0,-i);
				parent.moveBy(-i,0);
        }
      }
   	}
}

function fncCopy()
{	window.document.einheit_neu.einh_namelist.value = window.document.einheit_neu.einh_name.value;
}

function printHaedline()
{	if (document.suche.headline2.value)
	{und=" und ";
	}
	else
	{ und="";
	}
	headlinetext="Suche "+document.suche.headline1.value + und + document.suche.headline2.value;
	if(document.layers)
	{	document.write(headlinetext);
		
	}
	else document.all.headline.innerText=headlinetext;
}

function bew_cancel()
{	if(document.suche_detail)
	{	document.bew_send.lnrString.value=document.suche_detail.lnrString.value;
		document.bew_send.navback.value=document.suche_detail.navback.value;
		document.bew_send.navtop.value=document.suche_detail.navtop.value;
	}
	if(document.suchedetailtext)
	{	document.bew_send.lnrString.value=document.suchedetailtext.lnrString.value;
		document.bew_send.navback.value=document.suchedetailtext.navback.value;
		document.bew_send.navtop.value=document.suchedetailtext.navtop.value;
	}
	if(document.suchedetailneuzugang)
	{	document.bew_send.lnrString.value=document.suchedetailneuzugang.lnrString.value;
		document.bew_send.navback.value=document.suchedetailneuzugang.action;
		document.bew_send.navtop.value=document.suchedetailneuzugang.navtop.value;
		
	}
	if(document.content)
	{	document.bew_send.lnrString.value=document.content.lnrString.value;
		document.bew_send.navback.value=document.content.action;
	}
}

