var winInst = null; 


// Does not reopen the window if already opened or minimized. No Param test!
function onOpenWindow(prmUrl,prmTarget,prmStyle)
{ 
   if (winInst && !winInst.closed) { 
	 check = confirm("Das Editor-Fenster ist bereits geöffnet. Nicht gespeicherte Daten gehen verloren. Wollen Sie trotzdem fortfahren?");
     if(check == true) {
        winInst.location.href = prmUrl; 
	 }
   } else { 
     winInst = window.open(prmUrl,prmTarget,prmStyle); 
	 winInst.focus(); 
   }
}



// Leerstellen eines Strings (links und rechts) entfernen
function trim(str)
{
	var i, beg, end, result
	
	beg = -1
	for (i = 0; i < str.length; i++) {
		if (str.charCodeAt(i) != 0x20) {
			beg = i
			break
		}
	}
	end = -1
	for (i = str.length - 1; i >= 0; i--) {
		if (str.charCodeAt(i) != 0x20) {
			end = i
			break
		}
	}
	//alert('beg=' + beg + ', end=' + end);
	if (end >= beg)
		result = str.substring(beg,end+1)
	else
		result = ""
	//alert("<" + result + "> " + result.length)
	return result
}

