var BrowserName    = navigator.appName;
var BrowserVersion = navigator.appVersion;
var VersionShort   = BrowserVersion.substr(0, 1);
function WinOpen(seite)
   {
seite = seite+session_sid+"?forward=";

var high =690;
var wide =980;


if(VersionShort  >3){
   if(BrowserName == "Netscape")
   {
   wavewin=window.open(seite,"_blank","fullscreen=no,scrollbars=no,toolbar=no,resizable=0,resizable=no,menubar=no,location=no,status=no,hotkeys=no,height=" + high  + ",width=" + wide);
   wavewin.focus();
  //window.moveTo(0, 0);
   }
 }

if(BrowserName == "Microsoft Internet Explorer")
     {
wavewin=open(seite,"","fullscreen=no,scrollbars=no,resizable=yes,toolbar=no,menubar=no,location=no,status=no,hotkeys=no,height=" + high + " ,width=" +  wide);
      if(wavewin != null && typeof(wavewin.moveTo) =="function")
      {
      wavewin.moveTo(0,0);
      //wavewin.focus();
      }
    }
  //return false;
 //-->

 }
// This funktion is used from a link which is configured with the 'send' handler
function openlinkWindow(winLocation,high,wide,target,send_url)
{
    //send_url = encodeURIComponent(send_url);
    wavewin=window.open(winLocation+send_url,target,"fullscreen=no,scrollbars=no,resizable=yes,toolbar=no,menubar=no,location=no,status=no,hotkeys=no,height=" + high + " ,width=" +    wide);
    wavewin.focus();
    //return false;
}


function reload_opener()
{
    if(typeof(window.opener) == "undefined"
        )
        return;
     opener.location.reload();
     window.close();
}

function openprintWindow(winLocation,high,wide,target,send_url)
{
    //send_url = encodeURIComponent(send_url);

    wavewin=window.open(winLocation+send_url,target,"fullscreen=no,scrollbars=YES,resizable=yes,toolbar=no,menubar=no,location=no,status=no,hotkeys=no,height=" + high + " ,width=" +   wide);

  wavewin.focus();
    //return false;
}


/* Funktion um auf eine bestimmte Seite zu sprigen.
Z.B. aus der Navigation.
Der Eintrag im BO 'URL oder lokaler Pfad:' wrde dann
z.B. javascript:siteJump('hxcms/production_category','client_article_mainnav/sport/formel_1','')
so aussehen.
*/

function siteJump(path,main_category,main_object_id){
/*    alert('path = '+path);
      alert('session = '+session_sid);
      alert('category = ' + main_category);
      alert('object_id = ' + main_object_id);
*/
    if (session_sid != '')
        redirect_path = pre_path + path +session_sid+
        +"\/"+main_category+"\/"+main_object_id;
    else
       redirect_path = pre_path + path
       +"\/"+main_category+"\/"+main_object_id;

//    alert(redirect_path);
    window.location.href=redirect_path;
  }
/*
Allgemeinefunktionalit� um Formularfeldinhalte zu berprfen.
Dazu diese Funktion bentzen:
FO_validateForm(attribs);
Dort ist folgene Form einzuhalten.
<attrib_name>,<Anzuzeigender Name>,<form>|<attrib_name>,<Anzuzeigender Name>,<form>|...
Bsp.
'ext_abo_lastname,Name,R|ext_abo_firstname,Prename,R|ext_abo_email,eMail,RisEmail'
<form> M�lichkeiten R fr muss da sein
                     RisEmail fr die Emailsyntax
                     RisNum f numerische Werte
*/

<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm(arg1,arg2,arg3,arg4, success) { //v4.1: new optional success parameter
// NEW: only if last parameter is present, then ERROR STRING or 'success' value is obtained
// - else true or false!

  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2];
       val=MM_findObj(args[i]);

    if (val) { nm=arg4; if ((val=val.value)!="") {
      p=0;if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' muss eine Email-Adresse beinhalten.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' muss eine Zahl zwischen '+min+' und '+max+' enthalten.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' wird ben�igt.\n'; }
  }
document.MM_returnValue = (errors == '');
if (errors != '') { if (success==null)  { alert('Beheben Sie folgende(n) Fehler:\n'+errors); return false;
                    } else return errors; // String!
          } else {
             if (success==null) return true;
                    else return success;
            }
}

function FO_validateForm(attribs) { //v1.1
    var err='';
    var attribs_array = attribs.split("|");
    for(i=0;i<attribs_array.length;i++){
        var attribs_expression = attribs_array[i].split(",");
        attrib_value = attribs_expression[1];
        attrib_expression =  attribs_expression[2];
        attrib_name      =  attribs_expression[0];
        //alert(attrib_name+" "+attrib_expression," ",attrib_value);

    // NEW: last parameter is present, so '' or ERROR STRING is obtained:
    err = err + MM_validateForm(attrib_name,'',attrib_expression,attrib_value, '');
    } // for

    if (err == '') return true;
    else     { alert('Beheben Sie folgende(n) Fehler:\n'+err);
           return false;
         }
}

/*
Diese Funktion z�lt den Wert inCount rckw�ts bis 0 und vergleicht
diesen mit der L�ge des Feldes inFormObject (�ergabe: this.form.<attrib_name>).
Soll der Aktuelle Count in einem Textfield zurckgegeben werden, so
muss das Object reachedObject (�ergabe: this.form.<inputfieldname>) auch noch bergeben werden.
Soll am Ende des Countdowns ein Warnausgabe Javascript erfolgen, so ist
der Warntext inAlert zu bergeben
*/
function counterField(reachedObject,inFormObject,inCount,inAlert)
 {
  if (typeof(reachedObject) != "undefined" && reachedObject !="")
     reachedObject.value = inCount -inFormObject.value.length;

  if (inFormObject.value.length >  inCount ) {
      inFormObject.value = inFormObject.value.substr(0, inCount);
      if (typeof(reachedObject) != "undefined" && reachedObject !="")
         reachedObject.value = 0;
      if (typeof(inAlert) != "undefined" && inAlert != "")
          alert(inAlert);
       }
 }
/* Folgende 4 Funktionen sind aus dem alten Intranet */

                 function cookie_popup(to, id)
                {
                    var mycookie = 0;
                    go2 = "http://intra-apps.burda.com/cgi-bin/cookiecopy/copycookie.php?id="+id+"&aid="+mycookie+"&uid="+id+"&bds_id="+mycookie+"&to="+to;
                    w=window.open(go2,'640x500','width=640,height=500,scrollbars=yes, resizable=yes');
                    w.focus();
                }
                function cookie_popup2(to, id)
                {
                    var mycookie = 0;
                    go2 = "http://intra-apps.burda.com/cgi-bin/cookiecopy/copycookie.php?id="+id+"&aid="+mycookie+"&uid="+id+"&bds_id="+mycookie+"&to="+to;
                    w=window.open(go2,'640x500','width=640,height=500,scrollbars=yes, resizable=yes');
                    w.focus();
                }
                function cookie_popup_direct(to)
                {
                    var mycookie = 0;
                    w=window.open(to,'640x500','width=640,height=500,scrollbars=yes, resizable=yes');
                    w.focus();
                }
                function cookie_popup_click_dial(to, id)
                {
                    var mycookie = 0;
                    go2 = "http://intra-apps.burda.com/cgi-bin/cookiecopy/copycookie_click_dial.php?id="+id+"&bds_id="+mycookie+"&to="+to;
                    w=window.open(go2,'640x500','width=640,height=500,scrollbars=yes, resizable=yes');
                    w.focus();
                }
                function sms_popup(to, id)
                {
                    var mycookie = 0;
                    go2 = "http://intra-apps.burda.com/cgi-bin/cookiecopy/copycookie.php?uid="+id+"&bds_id="+mycookie+"&to="+to;
                    w=window.open(go2,'640x500','width=640,height=500,scrollbars=yes');
                    w.focus();
                }

/* dummy wegen kopierter Inhalte aus dem alten System: */

function ct_link(p1,p2,p3,p4,p5) {
// EXAMPLE: 'link_dl', '', '', '', ''
}

//-->
/* Ausgeglieder aus den Publicseiten AB */
<!--
function fx(){
    df=document.login;
    df.pernr.value='D';
    setCaretToEnd(df.pernr);
}
function setSelectionRange(input, selectionStart, selectionEnd) {
  if (input.setSelectionRange) {
    input.focus();
    input.setSelectionRange(selectionStart, selectionEnd);
  }
  else if (input.createTextRange) {
    var range = input.createTextRange();
    range.collapse(true);
    range.moveEnd('character', selectionEnd);
    range.moveStart('character', selectionStart);
    range.select();
  }
}
function setCaretToEnd (input) {
  setSelectionRange(input, input.value.length, input.value.length);
}
//-->
