//<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
//<!--

//======================================================================
// AWM 2004
//======================================================================

var site;
var isite;
var isWDrive;

// ==========================================================
// function get_site() start
//function get_isite()  // site, isite)
function get_isite(oSite)  // site, isite)
{

//var isWDrive = false;
isWDrive = false;  // my local drive W:\

//var site = ""; // global declaration above

// if org/ folder:  var cat = "";
var cat = "";

// if awm/ folder:  var cat = "awm/";
//var cat = "awm/";

var temp, file_url;
var i;

// var isite; // global declaration above
var ftype, stype;
isite = -1;
ftype = -1;

temp = window.location.href;
file_href = temp;

//document.write ("url=[ " + temp + " ] <br>");
//document.write("<br>");

temp1 = temp.split("://");
stype = temp1[0];

switch (temp1[0])
{
  case "http":
    {
     ftype = 0;	// www - browser access to remote file
//     document.write("HTTP - www browser access");
     break;
    }
  case "file":
    {
     ftype = 1;	// file manager access - local file
//     document.write("local file - file manager access");
     break;
    }
  case "ftp":
    {
     ftype = 2; // ftp access
//     document.write("FTP access");
     break;
    }
  default:
    {
     ftype = -1; // other access types
//     document.write(temp1[0] + " access");
     break;
    }
} // switch (temp1[0]

//document.write("<br>");

//document.write("type=[ " + temp1[0] + " ]<br>");
//document.write("path=[ " + temp1[1] + " ]<br>");


//document.write('<center><font size="4"><strong>');
//document.write('Available mirrors of this <br>');
//document.write('<font color="red">');

//document.write ("<br>temp:"+temp+" ==&gt; ");

temp = temp.toLowerCase()
//document.write (temp+"<br>");

i = temp.indexOf ("adsorption.org/");
//j = temp.indexOf ("ADSORPTION.ORG/");
//document.write ("i="+i+"<br>");


if (i != -1)
 {
  site = "http://adsorption.org/";
//  document.write ("ADSORPTION.ORG site");
  isite = 0;
 }
else
{
i = temp.indexOf ("sorption.org/");
//j = temp.indexOf ("SORPTION.ORG/");
//document.write ("i="+i+"<br>");


if (i != -1)
 {
  site = "http://sorption.org/";
//  document.write ("ADSORPTION.ORG site");
  isite = 5;
 }
else
{
   i = temp.indexOf("hermes.umcs.lublin.pl/");
   j = temp.indexOf("hermes/sys/htdocs/users/");
// j = temp.indexOf("HERMES.UMCS.LUBLIN.PL/");
// k = temp.indexOf("HERMES/SYS/HTDOCS/USERS/");

// logical OR: ||, logical AND: &&
// logical EQ, NEQ: strict: ===, !== (1 is not eq "1")
// logical EQ, NEQ: not strict: ==, != (1 is eq "1" - type conversion incl)

 if ((i != -1) || (j != -1))
 {
  site = "http://hermes.umcs.lublin.pl/";
//  document.write("HERMES site");
//  document.write(" (MCS Univ., Fac. of Chemistry Novell server)");
  isite = 1;
 }
 else
 {
  i = temp.indexOf("hektor.umcs.lublin.pl/");
//  j = temp.indexOf("GOLEM.UMCS.LUBLIN.PL/");
//  k = temp.indexOf("GOLEM/SYS/HTDOCS/USERS/");

  if (i != -1)
  {
   site = "http://hektor.umcs.lublin.pl/";
//   document.write("HEKTOR site");
//   document.write(" (MCS Univ., Fac. of Math-Phys-Inf Linux server)");
  isite = 2;
  }

  else
  {

// http://republika.pl/awmarcz/

   i = temp.indexOf("republika.pl/");
//   j = temp.indexOf("REPUBLIKA.PL/");

   if (i != -1)
   {
   //==================
     k = temp.indexOf("republika.pl/awmarcz");
//     l = temp.indexOf("REPUBLIKA.PL/awmarcz");

     if (k != -1)
     {
      site = "http://republika.pl/awmarcz/";
//    document.write("ONET.PL portal site");
//    document.write(" (http://republika.pl/user_id)");
     isite = 3;
     }
     else
     {
      site = "http://republika.pl/sorption1601/";
//    document.write("ONET.PL portal site");
//    document.write(" (http://republika.pl/user_id)");
     isite = 6;
     }
   //==================
   }
   else
   {
// http://strony.wp.pl/wp/awmarcz/
// http://awmarcz.webpark.pl/

   i = temp.indexOf("wp.pl/");
//   j = temp.indexOf("WP.PL/");
   k = temp.indexOf("webpark.pl/");
//   l = temp.indexOf("WEBPARK.PL/");


   if (i != -1)
   {
    site = "http://strony.wp.pl/wp/awmarcz/";
//    document.write("WP.PL portal site");
//    document.write(" (http://strony.wp.pl/wp/user_id)");
    isite = 4;
   }
   else
   {
     if (k != -1)
     {
      site = "http://awmarcz.webpark.pl/";
//      document.write("WEBPARK.PL - WP.PL portal site");
//      document.write(" (http://user_id.webpark.pl/)");
      isite = 4;
     }
     else
     {
      isite = -1;
      if ((ftype != 0) && (ftype != 2)) // not (www or ftp)
      { site = "local site/file";
        if ((temp.indexOf("W:\\") != 0) || (temp.indexOf("w:\\") != 0))
        { site = "AWM local site/file";
          isWDrive = true;
        }
        else
        { site = "some local site/file";
          isWDrive = false;
        };
      }
      else
      { site = "alien www/ftp site"; };
//
//      document.write("local site");
     }
   }
   }
 }
}
}
}
//document.write("</font>");
//document.write("</strong></font></center><br>");
  oSite.site = site;
  oSite.isite = isite;
  oSite.cat = cat;
  oSite.ftype = ftype;
  oSite.stype = stype;
  oSite.AWMlocal = isWDrive;

return isite;
}
// function get_isite() end
// ==========================================================


// ==========================================================
// function get_site() start
function get_site()
{
   if (site == "")
   {
    isite = get_isite()  // initialize first
   }
   return site;
}
// function get_site() end
// ==========================================================


// function show_site(isite) start
function show_site(isite)
{
// ONet:: http://republika.pl/awmarcz/
// ONet:: http://www.republika.pl/awmarcz/

// document.write ("<br>==============<br>");
// document.write ("    SITE No. " + isite);
// document.write ("<br>==============<br>");

document.write ("List of sites:<br>");

// for (i = -1; i <= 4; i++)

for (i = 0; i <= 6; i++)	// skipped local site
{

 if (i === isite)
 {
 document.write("<strong>")
 document.write("&nbsp;&nbsp;");
 }
 else
 {
 document.write("&nbsp;&nbsp;&nbsp;&nbsp;");
 };


 switch (i)
 {
  case -1:
    {document.write("??/local");
    break;}
  case 0:
    {
    document.write('<a href="http://');
    document.write('adsorption.org/'+cat+'" target="_blank">');
    document.write("ADSORPTION.ORG");
    document.write('</a> (hosted by Onet.pl) - <strong>main site</strong>');
    break;}
  case 5:
    {
    document.write('<a href="http://');
    document.write('sorption.org/'+cat+'" target="_blank">');
    document.write("SORPTION.ORG");
    document.write('</a> (hosted by Onet.pl) - <strong>main site++</strong>');
    break;}
  case 1:
    {
    document.write('<a href="http://');
    document.write('hermes.umcs.lublin.pl/~awmarcz/'+cat+'" target="_blank">');
    document.write("HERMES site");
    document.write('</a> (MCS Univ., Fac. of Chemistry server) - <strong>old home</strong>/partial (no maps or galleries)');
    break;}
  case 2:
    {
    document.write('<a href="http://');
    document.write('hektor.umcs.lublin.pl/~awmarcz/'+cat+'" target="_blank">');
    document.write("HEKTOR site");
    document.write('</a> (MCS Univ., Fac. of Math-Phys server) - <strong>new home</strong>/partial (no maps or galleries)');
    break;}
  case 3:
    {
    document.write('<a href="http://');
    document.write('republika.pl/awmarcz/'+cat+'" target="_blank">');
    document.write("ONET.PL portal site");
    document.write('</a>');
    //document,write(' (http://republika.pl/user_id)');
    document.write(' - complete');
    break;}
  case 6:
    {
    document.write('<a href="http://');
    document.write('republika.pl/sorption1601/'+cat+'" target="_blank">');
    document.write("ONET.PL portal site");
    document.write('</a>');
    //document,write(' (http://republika.pl/user_id)');
    document.write(' - complete++');
    break;}
  case 4:
    {
    //if (cat == "awm/") { cat1 = "index_m.htm"} else { cat1 = "index.htm" };
    cat1 = cat;
    document.write('<a href="http://');
    document.write('awmarcz.webpark.pl/'+cat1+'" target="_blank">');
    document.write("WP.PL portal site");
//    document.write('strony.wp.pl/wp/awmarcz/'+cat1+'" target="_blank">');
//    document.write("WP.PL portal site");
    document.write('</a>');
    //document.write(' (http://strony.wp.pl/wp/user_id)');
    document.write(' (old/partial version)');
    break;}
  default:
    {document.write("??/local");
    break;}

 } // switch


 if (i == isite) { document.write('</strong> (<font color="red">this site</font>)')} else {};

 document.write("<br>");

} // for (i) loop

}
// function show_site(isite) end

//-->
//</script>

