var EFN_FEEDBACK_PAGE="2384";
var EFN_SECURE_AREA="/show/detail.php/";
var EFN_PUBLIC_AREA="/show/detail.php/";
function new_js_window(furl,title,params) {
    f = window.open(furl,title,params);
    f.focus();
}
function help_window(id,flag) {
    if (!flag)
        anchor="#"+id.toString();
    else
        anchor="";
    new_js_window(EFN_PUBLIC_AREA+id.toString()+anchor,'Hilfe','width=510,height=450,scrollbars=yes');
}
function urlencode(str){
    return escape(str.replace(/ /g,'+'));
}
function feedback_mail(to,type,subject) {
    local=document.location.href;
    if (local.indexOf(EFN_SECURE_AREA)==-1 &&
        local.indexOf(EFN_PUBLIC_AREA)==-1)
        EFN_FEEDBACK_PAGE=EFN_PUBLIC_AREA+EFN_FEEDBACK_PAGE;
    querystr=EFN_FEEDBACK_PAGE+
             "?fmailto="+to.toString()+
             "&ftype="+urlencode(type.toString())+
             "&fsubject="+urlencode(subject.toString());
    new_js_window(querystr,
                  "Feedback",
                  "width=414,height=454,scrollbars=yes");
}
function preload_images() {
    for (i=0;i<datalist.length;i++) {
        imglist[i]=new Image();
        imglist[i].src=datalist[i];
        }
}
function efn_form(id,params,typ)
{
    var max_height = 900;
    var min_height = 520;
    frontend = '/forms/';
    backend = '/admin/backend.php/';
    if (typeof(appBackend)!='undefined' && appBackend==true)
    	frontend = backend;
    h = screen.height-128;
    if (h < min_height)
    	h = min_height;
    if (h > max_height)
    	h = max_height;
    if (!params)
    	params = '';

    uri = frontend+id+params;
    f = window.open(uri,id,'width=632,height='+h+',scrollbars=yes,resizable=no,status=yes');
    f.focus();
}
function form_goto(site,blank) {
    if (site==-99)
        return;
    if (blank && site.indexOf("javascript:")==-1) {
        bwin=window.open(site,"new","width=720,height=480,scrollbars=yes,location=yes,menubar=yes,resizable=yes,status=yes,toolbar=yes");
        bwin.focus();
        return;
        }
    document.location.href=site;
}

