<!--

//*************************************************************************
//  Allgemeines Script zur Bestimmung enthaltener Objekte im Dokument
//*************************************************************************
function findObj(n, d)
{
  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 = findObj( n, d.layers[i].document );
  return x;
}

//*************************************************************************
//  Bilder fuer MouseOvers vorausladen
//*************************************************************************
function preloadImages()
{
  if(document.images)
  {
    if (!document.preload)
      document.preload = new Array();
    var i, j = document.preload.length, a = preloadImages.arguments;
    for(i = 0; i < a.length; i++)
      if ( a[i].indexOf("#") != 0 )
      {
        document.preload[j] = new Image;
        document.preload[j++].src = a[i];
      }
  }
}

//*************************************************************************
//  Funktion fuer MouseOvers
//*************************************************************************
function swapImage()
{
  var i, j = 0, x, a = swapImage.arguments;
  document.sr = new Array;
  for ( i=0; i < (a.length-2); i+=3 )
    if ( ( x = findObj(a[i]) ) != null )
    {
      document.sr[j++] = x;
      if (!x.oSrc)
        x.oSrc = x.src;
        x.src = a[i+2];
    }
}

//*************************************************************************
//  Funktion fuer MouseOut
//*************************************************************************
function swapImgRestore()
{
  var i, x, a = document.sr;
  for ( i = 0; a && i < a.length && (x=a[i]) && x.oSrc;i++)
    x.src=x.oSrc;
}

//*************************************************************************
//  Neues Fenster mit angegebenen Parametern oeffnen
//*************************************************************************
function openWindow(theURL,winName,features)
{
  window.open(theURL,winName,features);
}

//*************************************************************************
//  Aus einem Select-Field heraus zu einer URL springen, option muss value enthalten
//*************************************************************************
function selectURL(targ,selObj,restore)
{
  if (selObj.options[selObj.selectedIndex].value != "")
  {
    eval (targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
    if (restore)
      selObj.selectedIndex = 0;
  } else {
    return;
  }
}

//*************************************************************************
//  Fenster neu laden wenn bei Netscape4 das Browserfenster skaliert wird
//*************************************************************************
function reloadPage(init) {
  if (init == true) with (navigator) {
    if ( (appName=="Netscape") && (parseInt(appVersion) == 4) ) {
      document.pgW=innerWidth;
      document.pgH=innerHeight;
      onresize=reloadPage;
    }
  } else if (innerWidth != document.pgW || innerHeight != document.pgH)
    location.reload();
}
reloadPage(true);

//*************************************************************************
//  Texte in Layern (div-Tags) austauschen
//*************************************************************************
function setLayertext(objName,x,newText) {
  if ( (obj = findObj(objName) ) != null ) with (obj) {
    if ( navigator.appName == 'Netscape' ) {
      document.write( unescape(newText) );
      document.close();
    }
    else innerHTML = unescape(newText);
  }
}

//*************************************************************************
//  Eigenschaften von Layern veraendern (top,left,visibility etc.)
//*************************************************************************
function changeProp(objName,x,prop,value) {
  var obj = findObj(objName);
  if ( obj && ( (prop.indexOf("style.") == -1 ) || obj.style) ) eval ( "obj." + prop + "='" + value + "px'");
}

//*************************************************************************
//  Navigationsscript fuer die Bereichseinstiegsseiten (Flash)
//*************************************************************************
//function flashNavigate(p) {
//alert("schieber "+p+" wurde geklickt");
//}

function submitCliquenWirtschaft(form, mode) {
    var fileInt = form.url.options[form.url.selectedIndex].value;
    form.action = "/was_will_ich/oekonomics/oekonomics" + fileInt + ".jsp";
    if (mode == "onsubmit") {
        return true;
    } else {
        form.submit();
    }
}
//-->
