// ******************************** &ouml;ffnen von fenstern

function opentext (filename)
{
   window.open("text.php?file="+filename, "ci_text_window", "dependent=yes, location=no, menubar=no, scrollbars=yes, resizable=no, status=no, toolbar=no");
}

picwindow = null;            // picture display window




function openpic (filename)
{
   if((picwindow==null) || picwindow.closed == true)
   {
      picwindow=window.open("pic.php?filename="+filename, "ci_picture_window", "dependent=1, location=0, scrollbars=0, menubar=0, resizable=0, status=0, toolbar=0");
      picwindow.focus();
   }
   else
   {
      picwindow.location.href="pic.php?filename="+filename;
      picwindow.focus();
   }
}




function openpic2 (gallery, type, index)
{
   if((picwindow==null) || picwindow.closed == true)
   {
      picwindow=window.open("pic2.php?gal="+gallery+"&type="+type+"&index="+index, "ci_picture_window", "dependent=1, location=0, scrollbars=0, menubar=0, resizable=1, status=0, toolbar=0");
      picwindow.focus();
   }
   else
   {
      picwindow.location.href="pic2.php?gal="+gallery+"&type="+type+"&index="+index;
      picwindow.focus();
   }
}




function openfile ( file, width, height )
{
   openstring = "dependent=yes, location=no, scrollbars=no, statusbar=no, menubar=no, resizable=no, toolbar=no, width=" + width + ", height=" + height;
   window.open(file, "vivaldiwindow", openstring);
}




// ********************************** frameset wiederherstellen

function gohome (fromwhere)
{
//   alert ("Fenster: [" + top.name + "]");

   if (    top.name != "ci_text_window"
        && top.name != "ci_picture_window"
        && top.location.pathname != '/'
        && top.location.pathname != '/index.php'
        && top.location.hostname != 'localhost'
      )
//      top.location.href = 'http://www.capella-incognita.at/index.php?done='+fromwhere;
      top.location.replace('http://www.capella-incognita.at/index.php?done='+fromwhere);

//   alert(top.location.pathname);
}


// ************************************* specials

function openvivaldi ()
{
//   openfile('stagioni/page1.php', 418, 570);
}

function openSpecial ()
{
//   openfile('oest/page1.php', 400, 555);
}

// ************************************* funktionen f&uuml;r kartenverwaltung

function clearText (which)
{
//   num = 2 + 2*which;
   num=which;

   with(document.forms[0].elements[num])
   {
      if (value=='0') value='';
   }
}

function checkText (which)
{
//   num=2+2*which;
   num=which;

   with(document.forms[0].elements[num])
   {
      if(value=='') value='0';
      else if(isNaN(value)) value='0';
   }
}

