//Funktionen Spotlite-Popup
function SpotLite() {
  myPopup=window.open('http://videomail.webfreetv.com/playerobject/html/microsite_index_v3_0.html?&scFl=no|0|&pfMS=erste/2003-04-04|1|&bhWe=800|550|2|&vmIx=0|3|&wiTi=ERSTE%20SPARINVEST|3.1|&poPu=true|4|&videoindex=1|666|','spotlite','width=800,height=550,scrollbars=no,resizable=no');
  myPopup.focus();
}

//Funktionen Imagefilm-Popup
function ImageFilm() {
  myPopup=window.open('http://videomail.webfreetv.com/playerobject/html/msi.php?&scFl=no|0|&pfMS=erste/2004-03-22_GSCHIEGL|1|&bhWe=0|0|2|&vmIx=0|3|&wiTi=ERSTE-SPARINVEST%20KAG|3.1|&poPu=true|4|&videoindex=1|666| ','imagefilm','width=780,height=550,scrollbars=no,resizable=no');
  myPopup.focus();
}

//Funktionen popUp
function popUp(url, target, width, height, scrollbars, resizable) {
  var lvUrl = new String(url)
  if (lvUrl.indexOf('.asp')>-1) {
    if (lvUrl.indexOf('?')==-1) { lvUrl = lvUrl.concat('?'); }
    else { lvUrl = lvUrl.concat('&'); }
    if ((scrollbars=='Yes') && (parseInt(width)-20>=490)) {
      lvUrl = lvUrl.concat('popup_height='+height+'&popup_width='+(parseInt(width)-20));
    } else {
      lvUrl = lvUrl.concat('popup_height='+height+'&popup_width='+width);
    }
  }
  if ((scrollbars=='Yes') && (parseInt(width)-20<490)) width=parseInt(width)+20;
  if (parseInt(width)<490) width=490;
  myPopup= window.open(lvUrl, target,'width='+ width +',height=' + height + ',scrollbars=' + scrollbars + ',resizable=' + resizable);
  myPopup.focus();
}

//Ticker
var l1 = 508; // links in pixel, oder 0 fuer position relative
var t1 = 40;  // top in pixel, oder 0 fuer  position relative
var w1 = 436; // width von ticker in pixel
var ie = document.all ? true : false;
var first = true;
var l2 = l1 + w1;
var l3 = l1 - l2;
var l = l2;

function tickinit() {
  if (ie) {
    if (l1 == 0 && t1 == 0) {
      pos = document.all['tickpos'];
      l1 = getLeft(pos);
      t1 = getTop(pos);
    }
    ticktext.style.posTop = t1;
  } else {
    if (l1 == 0 && t1 == 0) {
      pos = document.anchors['tickpos'];
      l1 = pos.x;
      t1 = pos.y;
    }
    document.ticktext.pageY = t1;
  }
  l2 = l1 + w1;
  l3 = l1 - l2;
  l = l2;
  setInterval('tick()', 10);
}

function getLeft(ll) {
  if (ll.offsetParent)
    return (ll.offsetLeft + getLeft(ll.offsetParent));
  else
  return (ll.offsetLeft);
}

function getTop(ll) {
  if (ll.offsetParent)
    return (ll.offsetTop + getTop(ll.offsetParent));
  else
    return (ll.offsetTop);
}

function tick() {
  l = l - 0.5;
  if (l < l3) l = l2;
  cl = l1 - l;
  cr = l2 - l;
  if (ie) {
    ticktext.style.posLeft = l;
    ticktext.style.posTop = t1;
    ticktext.style.clip = 'rect(auto '+cr+'px auto '+cl+'px)';
    if (first) ticktext.style.visibility = 'visible';
  } else {
    document.ticktext.pageX = l;
    document.ticktext.clip.left = cl;
    document.ticktext.clip.right = cr;
    if (first) document.ticktext.visibility = 'show';
  }
  first = false;
}

//Funktionen Daten - Download
function setze_fondsliste() {
  strTemp = '';
  for (var j = 0; j<document.frmAuswahl.lbFonds.length; j++)
    if (strTemp=='')
      strTemp = document.frmAuswahl.lbFonds.options[j].value;
    else
      strTemp = strTemp + ';' + document.frmAuswahl.lbFonds.options[j].value;
  document.frmAuswahl.fondsliste.value = strTemp;
}

function dazu_single(i) {
  if (i > -1) {
    bOk = true;
    if (document.frmAuswahl.lbFonds.length!=0)
      for (var j = 0; (j<document.frmAuswahl.lbFonds.length) && bOk; j++)
        bOk = bOk && (document.frmAuswahl.lbFonds.options[j].value != document.frmAuswahl.lbFonds_Auswahl.options[i].value);
    if (bOk) {
      oNeu = new Option(document.frmAuswahl.lbFonds_Auswahl.options[i].text);
      oNeu.value = document.frmAuswahl.lbFonds_Auswahl.options[i].value;
      document.frmAuswahl.lbFonds.options[document.frmAuswahl.lbFonds.length] = oNeu;
      if (document.frmAuswahl.fondsliste.value=='')
        document.frmAuswahl.fondsliste.value = oNeu.value;
      else
        document.frmAuswahl.fondsliste.value = document.frmAuswahl.fondsliste.value + ';' + oNeu.value;
    }
  }
}

function dazu_alle() {
  weg_alle();
  for(var i=0;(i<document.frmAuswahl.lbFonds_Auswahl.length);i++) { dazu_single(i) }
}

function dazu() {
  dazu_single(document.frmAuswahl.lbFonds_Auswahl.selectedIndex)
}

function weg_single(i) {
  if (i > -1) { document.frmAuswahl.lbFonds.options[i] = null; }
}

function weg_alle() {
  for(var i=document.frmAuswahl.lbFonds.length;(i>=1);i--) { weg_single(i-1) }
  setze_fondsliste()
}

function weg() {
  weg_single(document.frmAuswahl.lbFonds.selectedIndex)
  setze_fondsliste()
}

