<!--
//
// Copyright (c) Nuno Ferreira
//	Created: 31/03/2002
//	Last modified: 18/08/2003
//
// You're free to use this code, if you:
// - Don't change the source code
// - Maintain the copyright notice
// - Include on your site a notice of this fact
// - Link your site to mine: Nuno Ferreira (www.nuno.net)
// - Send me an e-mail, so I can link my site to your's
//
var replaceok = ((parseInt(navigator.appVersion)>=4)||(window.location.replace));
wontshow = 0;
pos = location.search.indexOf("lang=");
path = self.location.toString();
if (path.indexOf('?')!=-1) path = path.substring(0, path.indexOf('?'));
//domain = window.top.location.toString();
//if (domain.indexOf('file://')!=0)
//  {
//  domain = domain.substring(domain.indexOf('://')+3);
//  domain = domain.substring(0, domain.indexOf('/'));
//  if (domain=='nuno.net'||domain=='www.nuno.net'||domain=='nuno.netpower.pt'||domain=='nferreira-por'||domain=='localhost'||domain=='127.0.0.1') domain='';
//  else
//    {
//    if (replaceok) top.location.replace(path);
//    else top.location.href = path;
//    }
//  }
//else domain='';
if ( self.name != "nf_pages" && ( path.indexOf("/pt/") >= 0 || path.indexOf("/en/") >= 0 || pos >= 0 ) )
  {
//  if ( path.indexOf("FrontPageTempDir") < 0 || domain != '' )
  if ( path.indexOf("FrontPageTempDir") < 0 )
    {
    wontshow = 1;
    path = "";
    if ( pos >= 0 )
      {
      dir = location.search.substring(pos+5);
      if ( dir.indexOf("&") >= 0 )
        {
        dir = dir.substring(0, dir.indexOf("&"));
        }
      }
    if ( pos >= 0 )
      {
      path = "/"+dir+"/";
      }
    a = -1;
    if ( navigator.cookieEnabled )
      {
      document.cookie="cookie=TRUE; path=/";
      a = document.cookie.indexOf("cookie=TRUE");
      document.cookie="cookie=; path=/";
      }
    if ( a < 0 )
      {
      if (replaceok)
        {
        top.location.replace(path+"index.htm?page="+escape(document.location));
        }
      else
        {
        top.location.href = path+"index.htm?page="+escape(document.location);
        }
      }
    else
      {
      document.cookie = "page="+escape(document.location)+"; path=/";
      if (replaceok)
        {
        top.location.replace(path+"index.htm");
        }
      else
        {
        top.location.href = path+"index.htm";
        }
      }
    }
  else
    {
//    if (domain=='') document.write("On production this page will be open on a frame<br>");
    document.write("On production this page will be open on a frame<br>");
    }
  }
//-->
