function SL_Minimize(cID, uImage)
{
	var cPath, cZusatz="", oObjekt;

	SL_SetObjectVisible(SL_FindObject("Body_"+cID), 0);
	if(uImage)
	{
		if(!uImage.length)
		{
			oObject=uImage;
			cZusatz='", this);';
		}
		else
		{
			oObject=SL_FindObject(uImage, 0);
			cZusatz='", "'+uImage+'");';
			if(oObject&&oObject.Status=="Min")
				{SL_Maximize(cID, uImage);oObject=0;}
		}
		if(oObject)
		{
			cPath=SL_GetPath(oObject.src);
			if(cPath.length>0)
				oObject.src=cPath+"window_max.gif";
			oObject.Status="Min";
		}
	}
}

function SL_Maximize(cID, uImage)
{
	var cPath, cZusatz="", oObjekt;

	SL_SetObjectVisible(SL_FindObject("Body_"+cID), 1);
	if(uImage)
	{
		if(!uImage.length)
		{
			oObject=uImage;
			cZusatz='", this);';
		}
		else
		{
			oObject=SL_FindObject(uImage, 0);
			cZusatz='", "'+uImage+'");'
		}
		if(oObject)
		{
			cPath=SL_GetPath(oObject.src);
			if(cPath.length>0)
				oObject.src=cPath+"window_min.gif";
			oObject.Status="Max";
		}
	}
}

function SL_MinimizeStart(cID){SL_Minimize(cID, SL_FindObject("MIN_"+cID));}
function SL_GetPath(cBild){var iLen=cBild.length, lFound=0, cResult="", cZeichen="";for(var iZ=iLen;iZ>0;iZ--){if(cBild.charAt(iZ)=="/"){lFound=1;break;}if(cBild.charAt(iZ)=="\\"){lFound=1;break;}}if(lFound){cResult=cBild.substring(0,iZ);}cZeichen=cResult.charAt(cResult.length);if(cZeichen!="\\"||cZeichen!="/"){cResult+="/";}return cResult;}
function SL_FindObject(x, lOpenForEditable){var oResult=0, aoTemp;if(document.all&&window.document.all[x]&&lOpenForEditable==0){oResult=document.all[x];}else{if(lOpenForEditable&&window[x]){oResult=window[x];}else{oResult=document.getElementById(x);if(!oResult){aoTemp=document.getElementsByName(x);if(aoTemp.length==1){oResult=aoTemp[0];}}}}return(oResult);}
function SL_SetObjectVisible(oObject, lVisible){if(oObject){if(lVisible==1){oObject.style.visibility="";oObject.style.position="";}if(lVisible==0){oObject.style.visibility="hidden";oObject.style.position="absolute";}}}

function SL_WriteWindow(cID, cCaption, cWidth, cImagePath, cCaptionBackground, cBorderColor, cBorderWidth)
{
	var cResult, oWindow, cText, cResultID="";

	if(!cBorderColor||cBorderColor.length<1)
		cBorderColor="#990000"
	if(!cBorderWidth||cBorderWidth.length<1)
		cBorderWidth="2"
	if(!cCaptionBackground||cCaptionBackground.length<1)
		cCaptionBackground="#990000"
	if(!cCaption||cCaption.length<1)
		cCaption=""
	if(!cImagePath||cImagePath.length<1)
		cImagePath="/images/";

	oWindow=SL_FindObject(cID);
	if(oWindow)
	{
		cResultID='"'+cID+'"';
		cText=oWindow.innerHTML;
		cResult='<table cellpadding="0" cellspacing="0" border="0" id="'+cID+'" width="'+cWidth+'">';
		cResult+='<tr><td colspan="3" bgcolor="'+cBorderColor+'" height="1"><spacer type="block" height="1"></td></tr>';
		cZusatz=' style="cursor: pointer;" onClick=';
		cZusatz+="'SL_Minimize("+cResultID+', "MIN_'+cID+'"'+")'";
		cResult+='<tr'+cZusatz+'>';
		cResult+='<td width="'+cBorderWidth+'" bgcolor="'+cBorderColor+'" rowspan="2"><spacer type="block" width="1"></td><td bgcolor="'+cCaptionBackground+'"><table><tr><td width="99%">';
		cResult+=cCaption;
		cResult+='</td><td>';
		cResult+='<img id="MIN_'+cID+'" src="'+cImagePath+'window_min.gif" border=0>';
		cResult+='</td></tr></table><td width="'+cBorderWidth+'" bgcolor="'+cBorderColor+'" rowspan="2"><spacer type="block" width="1"></td></tr><tr><td>';
		cResult+='<div id="Body_'+cID+'">'+cText+'</div></td>';
		cResult+='</tr><tr><td colspan="3" bgcolor="'+cBorderColor+'" height="'+cBorderWidth+'"><spacer type="block" height="1"></td></tr></table>';
		oWindow.innerHTML=cResult;
	}
}