
var gbEditWinOpen = false;
var goEditWindow = null;

function fOpenWinEdit(asFieldName, asTitel, w, h)
{
    gbEditWinOpen = true;

    lsHtmlBody = fDrawFrameset(asTitel, asFieldName) 

    // popUp Fenster öffnen
    var windowOptions  = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=yes,width="+w+",height="+h+",left=500,top=30,screenX=500,screenY=30";
	goEditWindow = this.open("about:blank","goWindow", windowOptions);    

	goEditWindow.callingForm = this;
    goEditWindow.document.open();
    goEditWindow.document.write(lsHtmlBody);
    goEditWindow.document.close();
    goEditWindow.callingForm = this;

    goEditWindow.focus();
}

function fDrawFrameset(asTitel, asUrl) 
{
    var lsHtmlBody  = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n";
    lsHtmlBody += "<html>\n";
    lsHtmlBody += "<head>\n";
    lsHtmlBody += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
    lsHtmlBody += "<title>"+ asTitel +"</title>\n";
    lsHtmlBody += "<meta name=\"generator\" content=\"CMS .webtop 3.2, webtop media, http://www.webtop.de/\" />\n";
    lsHtmlBody += "<script type=\"text/javascript\">\n";
    lsHtmlBody += "<!--\n";
    lsHtmlBody += "function closeWin ()\n";
    lsHtmlBody += "{\n";
    lsHtmlBody += "callingForm.refreshSite();\n";
    lsHtmlBody += "}\n";
    lsHtmlBody += "//-->\n";    
    lsHtmlBody += "</script>\n";
    lsHtmlBody += "</head>\n";
    lsHtmlBody += "<frameset rows=\"100%\" onUnload=\"javascript: closeWin();\">\n";
    lsHtmlBody += "<frame src=\""+asUrl+"\" name=\"edit_form\" />\n";
    lsHtmlBody += "<noframes>\n";
    lsHtmlBody += "<body><p>Ihr Browser unterst&uuml;tzt keine Frames</p></body>\n";
    lsHtmlBody += "</noframes>\n";
    lsHtmlBody += "</frameset>\n";
    lsHtmlBody += "</html>\n";

    return lsHtmlBody;
}

function refreshSite()
{
    gbEditWinOpen = false;
    goEditWindow.close()

    parent.location.reload();
}

