
/*
***********************************************************************
***********************************************************************
***                                                                 ***
***                          e c _ f k t . j s                      ***
***                                                                 ***
***                     E  -  C O M M E R C E                       ***
***                     JavaScript - Funktionen                     ***
***                             V 1.0                               ***
***                                                                 ***
***   Stand: 12.07.00                              Bearb: Lachner   ***
***                                                                 ***
***********************************************************************
***********************************************************************
*/
/*
***********************************************************************
**                                                                   **
**   Copyright (C) CS, 1995-2004, All Rights Reserved, Confidential  **
**                                                                   **
***********************************************************************
*/


/*
******************************************************************
programm: cs_getcookie
eingaben: 1. Name des Paramenters
ausgaben: Inhalt
funktion: Hole Cookie; Wenn nicht vorh. ist Ergbnis leer
******************************************************************
*/
function cs_getcookie(Name) {
  var erg = "";                         /* Ergebnis */
  var search = Name + "=";              /* danach suchen */
  if (document.cookie.length > 0) {     /* if there are any cookies */
    var ioffset = document.cookie.indexOf(search);
    if (ioffset != -1) {                /* cookie exists */
      ioffset = ioffset + search.length;  /* offset of value */
      var iend = document.cookie.indexOf(";", ioffset);
                                        /* wo endet der Wert */
      if (iend == -1) iend = document.cookie.length;
                                        /* das ist letzter Wert im String */
      erg = unescape(document.cookie.substring(ioffset, iend));
    }                                   /* ende cookie exists */
  }                                     /* ende cookies vorhanden */

/*!!!!!!!!!*/
/*if (Name == "cs_co_id") erg = "123456";  /* */
/*!!!!!!!!!*/

  return erg;
}




/*
******************************************************************
programm: cs_setcookie
eingaben: 1. Name des Paramenters
          2. Inhalt
ausgaben: ---
funktion: Cookie setzen
******************************************************************
*/
function cs_setcookie(Name, Value) {
  document.cookie = Name + "=" + escape(Value) + ";path=/";
}




/*
******************************************************************
programm: cs_setcookie_perm
eingaben: 1. Name des Paramenters
          2. Inhalt
          3. Tage, die Cookie gueltig bleiben soll
ausgaben: ---
funktion: Cookie permanent setzen
******************************************************************
*/
function cs_setcookie_perm(Name, Value, Tage) {
  var jetzt = new Date();
  var Auszeit = new Date(jetzt.getTime() + Tage*24*60*60*1000);
  document.cookie = Name + "=" + escape(Value) + ";path=/" + ";expires=" + Auszeit.toGMTString();
                                /* oder cookieDate(jetzt + Tage*24*60*60*1000);  */
}




/*
******************************************************************
programm: cs_setlang
eingaben: 1. Welche Sprache (D)eutsch, (E)nglisch, (I)talienisch
             (F)ranzoesisch, (S)panisch, (P)ortugiesisch
ausgaben: ---
funktion: Cookie fuer Sprache setzen
******************************************************************
*/
function cs_setlang(lang) {
  if (lang == "D") {
    cs_setcookie_perm("cs_co_lang", "", 365);
  }
  if (lang == "E") {
    cs_setcookie_perm("cs_co_lang", "E", 365);
  }
  if (lang == "I") {
    cs_setcookie_perm("cs_co_lang", "I", 365);
  }
  if (lang == "F") {
    cs_setcookie_perm("cs_co_lang", "F", 365);
  }
  if (lang == "S") {
    cs_setcookie_perm("cs_co_lang", "S", 365);
  }
  if (lang == "P") {
    cs_setcookie_perm("cs_co_lang", "P", 365);
  }
}



/*
******************************************************************
programm: cs_checkframeset
eingaben: ---
ausgaben: ---
funktion: Test, ob der Aufruf der Seite ueber ein Frameset
          stattfindet. Falls 'nein': Rufe die Hauptseite des
          Framesets mit der Info, welche Seite aufruft.
******************************************************************
*/
function cs_checkframeset() {
/* if (!parent.cs_left) l o c a t i o n. h r e f="index.html?" + location.pathname;  (ganz einfach) */

  if (!parent.cs_left) {                /* Frame und Menu nicht da? */
    var cs_befehl;
    if (location.hash == "") {          /* nur wenn ohne Anker */
      if (document.images) {
        cs_befehl = 'to'+'p.lo'+'cation.replac'+'e("index.html?" + lo'+'cation.pathname)';
      } else {
        cs_befehl = 'to'+'p.lo'+'cation.h'+'ref="index.html?" + lo'+'cation.pathname';
      }
      eval(cs_befehl);
    }                                   /* ende ohne Anker */
  }
}




/*
******************************************************************
programm: cs_setbookmark
eingaben: 1. URL, der zu den Favoriten hinzugefuegt werden soll
          2. Zugehoeriger Auswahltext
ausgaben: ---
funktion: Hinzufuegen eines Links zu den Favoriten. (nur IE)
          Anwendungsbeispiele:
          cs_setbookmark('http://scriptasylum.com', 'ScriptAsylum');  konstant
          cs_setbookmark(self.location.href, 'Current Page');         aktuelle Seite
          cs_setbookmark( parent.location.href, 'Current Page');      aus einem Frameset
          cs_setbookmark( self.location.href, document.title);        Angaben aus Dokument
******************************************************************
*/
function cs_setbookmark(url,str) {
  if(str=='') str=url;
  if (document.all) window.external.AddFavorite(url, str);
  else alert('Press CTRL and D to add a bookmark to:\n"'+url+'".');
}





/*
******************************************************************
programm: cs_seitenende
eingaben: ---
ausgaben: ---
funktion: Funktionen, die am Seitenende ausgefuehrt werden
******************************************************************
*/
function cs_seitenende() {
  document.write('<div id="LPC" style="position:absolute; width:500px; height:100px; z-index:1; left: 55px; top: -520px;">');

  /*-- Beginn Hitmaster Statistikcode --*/
  var ref = document.referrer;
  var sr = screen.width+"x"+screen.height;
  var br = navigator.appName;
  var bv = navigator.appVersion;
  var page = "";
  document.write ('<SCR'+'IPT language="JavaScript" SRC="http://www.hitmaster.de/hm3log.php?uid=142149&ref='+ref+'&screen='+sr+'&br='+br+'&bv='+bv+'&page='+page+'"><\/scr'+'ipt>');
  /*-- Ende Hitmaster Statistikcode --*/

  document.write('<\/div>');
}


  
  
/*---------------------- eof 'ec_fkt.js' -------------------*/

