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
}

function OpenFormWin(str,typ,titel,email)
{
	filename="cmsformular/kontakt.asp?typ="+typ+"&parameter="+str+"&titel="+titel+"&email="+email;
	//alert(filename);
	window.open(filename, "Form","directories=no,menubar=no,resizable=no,scrollbars=no,toolbars=no,status=no,location=no,width=530,height=720,left=100,top=50");
}


function OpenPrintWin(str,contentId)
{
	filename="cmstools/print.asp?contentId="+contentId;
    //alert(filename);
	window.open(filename, "Print","directories=no,menubar=no,resizable=no,scrollbars=yes,toolbars=no,status=no,location=no,height=700,width=650,left=100,top=30");
}


