/**
*	�ffnet ein PopUp mit den Frormatierungshinweisen
*/

function openFor(){
   formatierung = window.open('../content/general/formatierung.php', 'formatierung2', 'resizeable=no, scrollbars=no, width=350, height=250, left=300, top=50');
   formatierung.focus();
}

function goTo(url){
	document.location=url;
}

function show(id) {
	var d = document.getElementById(id);
		for (var i = 1; i<=15; i++) {
			if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
		}
	if (d) {
		d.style.display='inline';
	}
}

function impressum(){ 
	impressum = window.open('./content/general/impressum.php', 'impressum2', 'resizeable=no, scrollbars=no, width=350, height=500, left=300, top=100,');
	impressum.focus();
}
  
function openPerson(id){
	edit = window.open('./content/general/showPerson.php?id='+id, 'edit2', 'resizeable=no, scrollbars=no, width=350, height=200, left=300, top=150,');
	edit.focus();		
}

function siteMap(){
	siteMap = window.open('./content/general/siteMap.php', 'siteMap2', 'resizeable=no, scrollbars=no, width=350, height=550, left=300, top=50,');
	siteMap.focus();
}

/**
*  Tabellen formatierung. Wenn keine Klasse fürs Anklicken angeben wird
*  so gibt es nur den "Rollover"-Effekt
*/
function highlightTableRow()
{
	var tableObj = this.parentNode;
	if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

	if(this!=activeRow){
		this.setAttribute('origCl',this.className);
		this.origCl = this.className;
	}
	this.className = arrayOfRolloverClasses[tableObj.id];
	
	activeRow = this;
	
}

function clickOnTableRow()
{
	var tableObj = this.parentNode;
	if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;		
	
	if(activeRowClickArray[tableObj.id] && this!=activeRowClickArray[tableObj.id]){
		if(activeRowClickArray[tableObj.id].rowIndex % 2 != 0){
			activeRowClickArray[tableObj.id].className='grau';
		} else {
			activeRowClickArray[tableObj.id].className='hellGrau';
		}
	}
	this.className = arrayOfClickClasses[tableObj.id];
	activeRowClickArray[tableObj.id] = this;
			

}

function resetRowStyle()
{
	var tableObj = this.parentNode;
	if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

	if(activeRowClickArray[tableObj.id] && this==activeRowClickArray[tableObj.id]){
		this.className = arrayOfClickClasses[tableObj.id];
		return;	
	}
	
	var origCl = this.getAttribute('origCl');
	if(!origCl)origCl = this.origCl;
	this.className=origCl;
	
}
	
function addTableRolloverEffect(tableId,whichClass,whichClassOnClick)
{
	arrayOfRolloverClasses[tableId] = whichClass;
	arrayOfClickClasses[tableId] = whichClassOnClick;
	
	var tableObj = document.getElementById(tableId);
	var tBody = tableObj.getElementsByTagName('TBODY');
	if(tBody){
		var rows = tBody[0].getElementsByTagName('TR');
	}else{
		var rows = tableObj.getElementsByTagName('TR');
	}
	for(var no=0;no<rows.length;no++){
		rows[no].onmouseover = highlightTableRow;
		rows[no].onmouseout = resetRowStyle;
		
		if(whichClassOnClick){
			rows[no].onclick = clickOnTableRow;	
		}
	}
	
}

// Bilder
	function selectImage(element){
		selectAlbum = window.open('/admin/content/ageneral/selectImage.php?element='+element, 'selectImage', 'resizeable=no, scrollbars=yes, width=900, height=600, left=100, top=50');
		selectAlbum.focus();
	}
