// Javascript Funktionen

neues_Fenster = null;
strHrefBackII = "";
strHrefBack   = "";
urlReferenz   = "";

breite = screen.width;
hoehe = screen.height;

function fenster(what,b,h)
         {
         xx = (breite/2)-(b/2);
         yy = (hoehe/2)-(h/2);
         what.moveTo(xx,yy);
         }

function pevorn()
    {
      if (neues_Fenster != null)
        if (!neues_Fenster.closed) setTimeout("pevorn()",2000);
        neues_Fenster.focus();
    }



function peopen(what,breite,hoehe)
    {
      neues_Fenster = window.open(what,"peformprojekt","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+breite+",height="+hoehe);
      fenster(neues_Fenster,breite,hoehe);
//      if (neues_Fenster != null)
//         if (!neues_Fenster.closed) pevorn();
//      return(neues_Fenster);
    }

function pnopen(what,breite,hoehe)
    {
      neues_Fenster = window.open(what,"peformprojekt","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+breite+",height="+hoehe);
      fenster(neues_Fenster,breite,hoehe);
      return(neues_Fenster);
    }



function zu(pID)
    {
      if (neues_Fenster != null)
         if (!neues_Fenster.closed) neues_Fenster.close();
//      document.location.href = strHrefBackII;
      strHrefBackII = "";
      document.location.reload();
    }

function popwarn(what)
    {
       urlReferenz=what;
       peopen('link.php',480,210);
       return(false);
    }

function dokopen(what,b,h)
    {
     // what.href
       if ( b*h )
         {
           neues_fenster = pnopen('',b+15,h+25);
           if ( neues_fenster != null)
              {
                with (neues_fenster.document)
                {
                 write('<html><link rel="stylesheet" href="css/projekte.css" type="text/css">');
                 write('<head></head><body>');
                 write('<table width="'+(b+15)+'" cellspacing="0" cellpadding="0" border="0">');
                 write('<tr valign="middle" align="center"><td height="'+(h+25)+'">');
                 write('<a class="linknormal" href="Javascript:close()">');
                 write('<img border="0" src="'+what.href+'" alt="Fenster schliessen">');
                 write('</a></td></tr></table></body></html>');
                }
              }
         }
        else
         {
           neues_fenster = pnopen(what.href,750,550);
         }
       return(false);
    }

function urlInput(what)
  {
    if ( !what.value.match(/^http|^mailto/) )
      {
        what.value = 'http://'+what.value;
      }
  }

function noInput(what)
  {
    if (! what.value.match(/^http.?.?.?|mailto$/) )
      {
        what.value = '';
      }
  }