function popup(link, name, w, h) {
    var winHeight = Math.round((screen.availHeight - h)  / 2);
    var winWidth = Math.round((screen.availWidth - w)  / 2);
    var winSize = 'width=' + w + ',height=' + h + ',top=' + winHeight + ',left=' + winWidth;
    var myWindow = window.open(link, name, winSize + ',scrollbars=yes, statusbar=no, location=no, menubar=no, resizable=yes, toolbar=no');
    myWindow.focus();

}


// fügt Pfad in Textfield "src" ein
// benötigt bei image.htm, a_newmsg.php
function insertSrc(path) {
	document.getElementById('src').value = path;
}

// fügt Pfad in Textfield "href" ein
// benötigt bei link.htm
function insertHref(path) {
	document.getElementById('href').value = path;
}




function switchDisplay(id) {
// zeigt div an oder nicht (nach ID)
    if (document.getElementById(id).style.display=='none') {
        document.getElementById(id).style.display='block';
    }
    else {
        document.getElementById('tools').style.display='none';
    }
}

// FUNKTIONEN FÜR ALTERNATIVE TOOLLEISTE

// gibt selectierten text zurück (drei Methoden werden geprüft)
/*function replaceSelectedText () {
	if (window.getSelection) {
		// Add Tags um Selektion
			window.getSelection() = 'test' + window.getSelection() + 'test';
    	//return window.getSelection();
  	}
  	else if (document.getSelection) {
    	//return document.getSelection();
    	document.getSelection() = 'test2' + document.getSelection() + 'test2';
	}
	else if (document.selection) {
    	//return document.selection.createRange().text;
    	document.selection.createRange().text = 'test3' + document.selection.createRange().text + 'test3';
  	}
}

*/
