function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v3.0
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  Show = window.open(theURL,winName,features);
  Show.focus();
}
function isblank(s) {
  for ( var i = 0; i<s.length; i++ ) {
     var c = s.charAt(i);
     if ( ( c != ' ' ) && ( c != '\n' ) && ( c != '\t' ) ) return false;
  }
  return true;
}
function subwin(name) {
  tempwin = window.open("",name)
  tempwin.close()
  return false;
}

function window_left() {
  if((top != null) && (top.screenX != null)) {
    return top.screenX;
  } else if((window != null) && (window.screenX != null)) {
    return window.screenX;
  } else if((top != null) && (top.screenLeft != null)) {
    return top.screenLeft;
  } else if((window != null) && (window.screenLeft != null)) {
    return window.screenLeft;
  } else {
    return 0;
  }
}

function window_top() {
  if((top != null) && (top.screenY != null)) {
    return top.screenY;
  } else if((window != null) && (window.screenY != null)) {
    return window.screenY;
  } else if((top != null) && (top.screenTop != null)) {
    return top.screenTop;
  } else if((window != null) && (window.screenTop != null)) {
    return window.screenTop;
  } else {
    return 0;
  }
}

function window_width() {
  if((top != null) && (top.outerWidth != null)) {
    return top.outerWidth;
  } else if((window != null) && (window.outerWidth != null)) {
    return window.outerWidth;
  } else if(screen.availWidth != null) {
    return screen.availWidth;
  } else if(screen.width != null) {
    return screen.width;
  } else {
    return 0;
  }
}

function window_height() {
  if((top != null) && (top.outerHeight != null)) {
    return top.outerHeight;
  } else if((window != null) && (window.outerHeight != null)) {
    return window.outerHeight;
  } else if(screen.availHeight != null) {
    return screen.availHeight;
  } else if(screen.height != null) {
    return screen.height;
  } else {
    return 0;
  }
}

function getBrowserType() {
  sBrowser = navigator.appName;
  sVersion = parseInt(navigator.appVersion);
  sDetail  = navigator.userAgent;
  sBrowVer = null;
	
  if(sBrowser == "Netscape")  {
    if(sVersion == 2)
      sBrowVer = "Net2";
    else if(sVersion >= 3 && sVersion < 4)
      sBrowVer = "Net3";
    else if(sVersion >= 4)
      sBrowVer = "Net4";
  } else if(sBrowser == "Microsoft Internet Explorer") {
    if(sVersion >= 2 && sVersion <= 3)  {
      if(sDetail.indexof("3.") != -1)
        sBrowVer = "IE3";
      else
        sBrowVer = "IE2";
    } else if (sVersion >= 4) {
      sBrowVer = "IE4";
    }
  }
	return sBrowVer;
}

// Oeffnet ein Popup - Fenster. Ist den Parametern posX oder posY
// ein negativer Wert zugeordnet, dann wird das Popup - Fenster
// anhand der Breite oder Hoehe des aufrufenden Fensters zentriert.
function popwin(winname, loc, posX, posY, width, height, resiz, scrollb) {
  sBrowVer = getBrowserType();
  
  if(posX < 0) {
    posX = (window_width() - width) / 2;
    if(posX < 0) posX = 0;
    if(sBrowVer.indexOf("IE") == -1)
      posX = window_left() + posX;
  }
  if(posY < 0) {
    posY = (window_height() - height) / 2;
    if(posY < 0) posY = 0;
    if(sBrowVer.indexOf("IE") == -1)
      posY = window_top() + posY;
  }
	
  if(sBrowVer == "Net2" || sBrowVer == "Net3") {
    NewWindow = window.open("", winname, "height=" + height + ",width=" + width + ",screenX=" + posX + ",left=" + posX + ",screenY=" + posY + ",top=" + posY +",menubar=0,status=0,resizable=" + resiz + ",scrollbars=" + scrollb)
    NewWindow.location.href = loc;
    if(sBrowVer == "Net3") NewWindow.focus();
    return;
  }

  if(sBrowVer == "Net4") {
    NewWindow = window.open("", winname, "height=" + height + ",width=" + width + ",screenX=" + posX + ",left=" + posX + ",screenY=" + posY + ",top=" + posY +",menubar=0,status=0,resizable=" + resiz + ",scrollbars=" + scrollb)
    NewWindow.location.href = loc;
    NewWindow.focus();
    return;
  }

  if(sBrowVer == "IE3") {
    NewWindow = window.open("", winname, "height=" + height + ",width=" + width + ",screenX=" + posX + ",left=" + posX + ",screenY=" + posY + ",top=" + posY + ",dependent=1,directories=0,fullscreen=0,location=0,menubar=0,channelmode=0,resizable=" + resiz + ",scrollbars=" + scrollb + ",status=0,toolbar=0");
    if(NewWindow != null) {
      if(NewWindow.opener == null) NewWindow.opener = self;
      NewWindow.location.href = loc;
    }
    return;
  }

  if(sBrowVer == "IE4") {
    NewWindow = window.open("", winname, "height=" + height + ",width=" + width + ",screenX=" + posX + ",left=" + posX + ",screenY=" + posY + ",top=" + posY + ",dependent=1,directories=0,fullscreen=0,location=0,menubar=0,channelmode=0,resizable=" + resiz + ",scrollbars=" + scrollb + ",status=0,toolbar=0");
    NewWindow.location.href = loc;
    NewWindow.focus();
    return;
  }

  if(sBrowVer == null) {
    NewWindow = window.open("", winname, "height=" + height + ",width=" + width + ",screenX=" + posX + ",left=" + posX + ",screenY=" + posY + ",top=" + posY + ",dependent=1,directories=0,fullscreen=0,location=0,menubar=0,channelmode=0,resizable=" + resiz + ",scrollbars=" + scrollb + ",status=0,toolbar=0");
    NewWindow.location.href = loc;
    NewWindow.focus();
    return;
  }
  return false;
}