/* windows library
*/
function dfc_openWin(sUrl, sName, sParam)
{
	oWin=window.open(sUrl,sName,sParam);
	if(!oWin) {
		sText = 'Bitte deaktivieren Sie Ihren PopUp-Blocker.';
		alert(sText);
	} else {
		oWin.focus();
	}
	
}

function dfc_openWin_withToolbar(sUrl, iWidth, iHeight, sName)
{
	sParam="toolbar=yes,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width="+iWidth+",height="+iHeight;
	dfc_openWin(sUrl, sName, sParam);
}

function dfc_openWin_onlyBorder(sUrl, iWidth, iHeight, sName)
{
	sParam="toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width="+iWidth+",height="+iHeight;
	dfc_openWin(sUrl, sName, sParam);
}

function dfc_openWin_Scroll(sUrl, iWidth, iHeight, sName)
{
	sParam="toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+iWidth+",height="+iHeight;
	dfc_openWin(sUrl, sName, sParam);
}

function dfc_openWin_Scroll_noResize(sUrl, iWidth, iHeight, sName)
{
	sParam="toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width="+iWidth+",height="+iHeight;
	dfc_openWin(sUrl, sName, sParam);
}

function dfc_openWin_Scroll_noResize_withToolbar(sUrl, iWidth, iHeight, sName)
{
	sParam="toolbar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width="+iWidth+",height="+iHeight;
	dfc_openWin(sUrl, sName, sParam);
}

function dfc_openWin_Scroll_noResize_withMenubar(sUrl, iWidth, iHeight, sName)
{
	sParam="menubar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width="+iWidth+",height="+iHeight;
	dfc_openWin(sUrl, sName, sParam);
}

// New Functions

function dfc_managePopupDetergenzie(sElementID)
{
	sParam = 'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=410,height=530';
	return dfc_managePopup(sElementID, 'DetergenziePopup', sParam);
}

function dfc_managePopupImage(sElementID)
{
	sParam = 'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=410,height=530';
	return dfc_managePopup(sElementID, 'ImagePopup', sParam);
}

function dfc_managePopupWithMenubar(sElementID, iWidth, iHeight, sWindowName)
{
	sParam = 'menubar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + iWidth + ',height=' + iHeight;
	return dfc_managePopup(sElementID, sWindowName, sParam);
}

function dfc_managePopupWithToolbar(sElementID, iWidth, iHeight, sWindowName)
{
	sParam = 'toolbar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + iWidth + ',height=' + iHeight;	
	return dfc_managePopup(sElementID, sWindowName, sParam);
}

function dfc_managePopup(sElementID, sWindowName, sParameter)
{
    oElement = window.document.getElementById(sElementID);
    sTarget  = oElement.target;
    sHref    = oElement.href;

	if (sTarget == '_blank')
    {
        oElement.removeAttribute('href', '0');
		
		if (typeof sWindowName == 'undefined')
		{
			sWindowName = 'Popup';	
		}
		
		if (typeof sParameter == 'undefined')
		{
			sParameter = '';	
		}
		
        oWindow = window.open(sHref, sWindowName, sParameter);
		
		if (!oWindow) 
		{
			alert('Bitte deaktivieren Sie Ihren PopUp-Blocker.');
		} 
		else 
		{
			oWindow.focus();
		}	
		
		oElement.setAttribute('href', sHref);
    }
    else
    {
        window.location.href = sHref;
    }    
	
	return false;
}