function OpenTeaser(url)
{
	var win = window.open(url,'Vorschau','top=100,left=200,toolbar=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=700, height=600');
	win.focus();
}
			

function OpenWindowReturn( url,width,height,lposition,tposition,title,isfullscreen)	{
	var parameters = 'toolbar=no,status=no,menubar=no,resizable=no,scrollbars=yes';
	if (isfullscreen==true) {
		parameters = parameters + ',fullscreen=yes';
	}
	var win = window.open(url,'Vorschau','top=' + tposition + ',left=' + lposition + ','+parameters+',width=' + width + ', height=' + height);
	win.focus();
	return( win )
}
			
function OpenWindow(url,width,height,lposition,tposition,title)
{
	OpenWindowReturn(url,width,height,lposition,tposition,title,false)
}			

function OpenWindowDruck(url,width,height,lposition,tposition,title)
{
		var win = OpenWindowReturn(url,width,height,lposition,tposition,title,false);
		win.print();
}

function OpenWindowSimple(url,width,height,lposition,tposition,title)
{
	var win = window.open(url,title,'top=' + tposition + ',left=' + lposition + ',toolbar=no,status=no,menubar=no,resizable=no,scrollbars=no,width=' + width + ', height=' + height);
	win.focus();
}			


function OpenWindowDown(url,width,height,lposition,tposition,title)
{
	var win = window.open(url,'Vorschau','top=' + tposition + ',left=' + lposition + ',toolbar=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=' + width + ', height=' + height);
	window.focus();
}	

function LoeschAbfrage( aurl, atext ) {
	if (confirm('Möchten Sie den Eintrag "' + atext + '" wirklich löschen?')==true)
	{
		location.href= aurl;
	}		
}

//Parameter::::
//aLoesche bestimmt, ob der Eintrag in der VON-Listbox geloescht werden soll
//und ob in der NACH-Listbox der Eintrag hinzugefuegt werden soll
function selektiere( avon, anach, aloesche ) {
	if (avon.selectedIndex != -1 ) {
		Gewaehlt = avon.options[avon.selectedIndex]
		if (!aloesche) {
			NeuerEintrag = new Option(Gewaehlt.text, Gewaehlt.value, false, true);
			anach.options[anach.options.length] = NeuerEintrag;				
		} else {
			avon.options[avon.selectedIndex] = null;
		}
	} else {
		alert('Bitte wählen Sie einen Eintrag aus!');
	}
}

//Parameter
//anachoben = true, aktiver Eintrag nach oben
//anachoben = false, aktiver Eintrag nach unten
function verschiebeListboxeintrag( alistbox, anachoben ) {
	if (alistbox.selectedIndex != -1 ) {
		index = alistbox.selectedIndex;
		if (anachoben) {
			if (index != 0 ) {
				value = alistbox.options[index].value;
				text = alistbox.options[index].text;
				alistbox.options[index].value = alistbox.options[index-1].value;
				alistbox.options[index].text = alistbox.options[index-1].text;
				alistbox.options[index-1].value = value;
				alistbox.options[index-1].text = text;
				alistbox.selectedIndex = index -1;
			}
		} else {
			if (index != alistbox.options.length-1 ) {
				value = alistbox.options[index].value;
				text = alistbox.options[index].text;
				alistbox.options[index].value = alistbox.options[index+1].value;
				alistbox.options[index].text = alistbox.options[index+1].text;
				alistbox.options[index+1].value = value;
				alistbox.options[index+1].text = text;
				alistbox.selectedIndex = index +1;
			}
		}		
	}
}

function kopiereListboxinTextfeld( anach, anachtextfeld ) {
	anachtextfeld.value = ''
	
	for (i=0;i<anach.options.length;i++) {
		anachtextfeld.value = anachtextfeld.value + anach.options[i].value + ";";
	}
	
	//alert(document.Form1.textfield.value);
}



function sucheFormelement( aname ) {
	//Durchlaufe alle Einträge		
	
	for(var i=0;i<document.Form1.elements.length; i++){				
		controlname = Form1.elements[i].name;
		laenge = controlname.length;
		if (controlname.substr( laenge-aname.length,aname.length)==aname) {
			return( Form1.elements[i]);
		}			
	}		
}

function sucheFormelementID( aid) {
	//Durchlaufe alle Einträge		
	
	for(var i=0;i<document.Form1.elements.length; i++){				
		controlname = Form1.elements[i].id;
		laenge = controlname.length;
		if (controlname.substr( laenge-aid.length,aid.length)==aid ) {
			return( Form1.elements[i]);
		}			
	}		
}

function sucheListbox( aname ) {
	return ( sucheFormelement( aname ));
}

function auswaehlenRadio( acontrol ) {
	acontrol.checked = true;
}

function statuswechsel( aid ) {
	if (document.getElementById(aid).style.display != 'none') {
		document.getElementById(aid).style.display = 'none';
	} else {
		document.getElementById(aid).style.display = 'block';
	}
}

function statuswechselimg( aid, aid_button ) {
	if (document.getElementById(aid).style.display != 'none') {
		document.getElementById(aid).style.display = 'none';
		document.getElementById(aid_button).src='images/button/box_min.gif';
	} else {
		document.getElementById(aid).style.display = 'block';
		document.getElementById(aid_button).src='images/button/box_max.gif';
	}
}

//Zeigt eine Fehlermeldung an, wenn versucht wird,
//auf einem Bild einen Rechtsklick zu machen.
function rklickBild(e) {
	var msg = "Dieses Bild ist urheberrechtlich geschützt.";
	if (navigator.appName == 'Netscape' && e.which == 3) {
		alert(msg);
		return false;
	}
	if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
		alert(msg);
		return false;
	}
	else return true;
}

//Setzt einen entsprechenden Image-Handler bei allen Bilder
//Muss im onload des Body aufgerufen werden
function verhindereRechtsKlick() 
  {
  if(document.images)
    {
    for(i=0;i<document.images.length;i++)
      {
	if (document.all) {
	      document.images[i].onmousedown = rklickBild;
	      document.images[i].onmouseup = rklickBild;
	} else {
	      document.images[i].oncontextmenu = rklickBild;
	}
      }
    }
  }