/* JavaScript Standard-File                                       */
/* This file is used in every HTML as standard-utility            */

/* These are the "Start"-signs ! */
<!--

function SetCookie(Key, Value)
{
  var now = new Date();

  document.cookie = Key + "=" + Value + ";";

}

function RtvCookie(Key)
{
  var Value = " ";

/* alert ("Key:" + Key); */
  if (document.cookie)
  {
    KeyCookieStart = document.cookie.indexOf(Key);
/* alert ("KeyCookieStart:" + KeyCookieStart); */
    if (KeyCookieStart != -1)
    {
      KeyCookieStart ++;
      ValueStart = document.cookie.indexOf("=", KeyCookieStart) + 1;
      ValueEnd   = document.cookie.indexOf(";", KeyCookieStart);
      if (ValueEnd == -1)
        ValueEnd = document.cookie.length;
      Value = document.cookie.substring(ValueStart, ValueEnd);
    }
  }
  /* alert(document.cookie); */
  return Value;
}

function StandardTop()

{
/* write the left "back" */
  document.write("<p align=left><font face=\"Verdana, arial, helvetica\" size=\"-1\"><a href=\"javascript:history.back()\">back</a></p>");
/* write the right "back" */  
/***  document.write("<p align=right><font face=\"Verdana, arial, helvetica\" size=\"-1\"><a href=\"javascript:history.back()\">back</a></p>"); ***/
  
 /* Here you activate the test message! */
  if (0 == 1)
    document.write("<br>Test volker (You should turn this off in \\as0030\http\as4-information\Sonstiges\Standard.js!)<br>");
}

function StandardFooter()

{
  var now = new Date();
  var VisitTime = new Date(now.getTime());
  var HttpURL;
  var HttpCheck;

  document.write("<br><br><font face=\"Verdana, arial, helvetica\" size=\"-1\">\n");
  document.write("<center><a href=\"javascript:history.back()\">back</a></center>\n");
}

function WebCamBAC()
{
  NewWindow = window.open("/public/WebCamBAC.htm", 
                 "BAC_lunch", "width=340, height=250, locationbar=yes, menubar=yes");
  NewWindow.focus();
}

function checkNoteNumber()
{
  var search_note = document.note_display._NNUM.value;
  var letter;
  
// Remove *blanks at the beginning and at the end

// input empty ?
  if (search_note.length == 0)
  {
    alert('Please specify a SAP Note number')
    return false;
  }
  else
  {
// input just numeric ?  
    for (var i = 0; i < search_note.length; i++) {
      letter = search_note.charAt(i)
      if (letter < '0' || letter > '9') {
         alert('Please specify a SAP Note number')
         return false;
      }
    }
    return true;
  }
}
function displayNote()
{
  var noteNumber = document.note_display._NNUM.value;
  var param = "menubar,location=yes,scrollbars,status,toolbar,resizable=yes";
//  var url = "http://service.sap.com/~form/handler?_APP=01100107900000000342&_EVENT=REDIR&_NNUM="
  var url = "http://service.sap.com/~form/handler?_APP=01100107900000000342&_EVENT=DISPL_TXT&_NNUM="
  if (checkNoteNumber() == true)
  {
    newWindow =  window.open(url + noteNumber,"_blank",param);
    newWindow.focus();
  }
}

function printNote()
{
  var noteNumber = document.note_display._NNUM.value;
  var param = "menubar,location=yes,scrollbars,status,toolbar,resizable=yes";
  var url = "http://service.sap.com/~form/handler?_APP=01100107900000000342&_EVENT=DISP_PRINT&_NNUM="
  if (checkNoteNumber() == true)
  {
    newWindow =  window.open(url + noteNumber,"_blank",param);
    newWindow.focus();
  }
}


// OLD Version of the Protector !!!
// <!--Quick! Hide the java!
// Speaking of Java, this particular script is (C) Copyright 2002 Jim Tucek
// If you wish to use my Email Encryption script, these comments must be left
// alone!  That is all.
// Visit www.jracademy.com/~jtucek/ for script information and a bit of help
// setting it up, or www.jracademy.com/~jtucek/email.html for contact
// information.
// A brief history of this script can be found (and it's rather entertaining)
// at www.jracademy.com/~jtucek/eencrypt.html

function goForth(c,n,d) {
c += ' ';
var length = c.length;
var number = 0;
var bar = 0;
var answer = '';
for(var i = 0; i < length; i++) {
number = 0;
bar = 0;
while(c.charCodeAt(i) != 32) {
number = number * 10;
number = number + c.charCodeAt(i)-48;
i++;
}
answer += String.fromCharCode(decrypt(number,n,d));
}
// Updated security feature
parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+answer;
}

function showText(c,n,d) {
c += ' ';
var length = c.length;
var number = 0;
var bar = 0;
var answer = '';
for(var i = 0; i < length; i++) {
number = 0;
bar = 0;
while(c.charCodeAt(i) != 32) {
number = number * 10;
number = number + c.charCodeAt(i)-48;
i++;
}
document.write('&');
document.write('#');
document.write(decrypt(number,n,d));
}
}

function decrypt(c,n,d) {
// Split exponents up
if (d % 2== 0) {
bar = 1;
for(var i = 1; i <= d/2; i++) {
foo = (c*c) % n;
bar = (foo*bar) % n;
}
} else {
bar = c;
for(var i = 1; i <= d/2; i++) {
foo = (c*c) % n;
bar = (foo*bar) % n;
}
}
return bar;
}
// Stop hiding the script -->

/* These are the "End"-signs ! */
//-->

// <!-- New Version of the Protector !!!
// This script is (C) Copyright 2004 Jim Tucek
// Leave these comments alone!  For more info, visit
// www.jracademy.com/~jtucek/email/ 
// Version 4.06 
// Information available at http://www.jracademy.com/~jtucek/email/download.php

function burst(air,squirrel,art) {
air += ' ';
var design = air.length;
var birth = 0;
var walk = '';
for(var agreement = 0; agreement < design; agreement++) {
birth = 0;
while(air.charCodeAt(agreement) != 32) {
birth = birth * 10;
birth = birth + air.charCodeAt(agreement)-48;
agreement++;
}
walk += String.fromCharCode(plead(birth,squirrel,art));
}
parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+walk;
}

function cost(thing,area,effect) {
thing += ' ';
var leaf = thing.length;
var family = 0;
for(var oxygen = 0; oxygen < leaf; oxygen++) {
family = 0;
while(thing.charCodeAt(oxygen) != 32) {
family = family * 10;
family = family + thing.charCodeAt(oxygen)-48;
oxygen++;
}
//document.write('&');
//document.write('#');
//document.write(plead(family,area,effect));
document.write(String.fromCharCode(plead(family,area,effect)));
}
}

function plead(bed,fire,government) {
if (government % 2 == 0) {
year = 1;
for(var landing = 1; landing <= government/2; landing++) {
mission = (bed*bed) % fire;
year = (mission*year) % fire;
}
} else {
year = bed;
for(var hieroglyphic = 1; hieroglyphic <= government/2; hieroglyphic++) {
mission = (bed*bed) % fire;
year = (mission*year) % fire;
}
}
return year;
}
// -->

