var winName = "NFWin";
var width  = "550";
var height = "400";

// openWindow ( STRING URL [, BOOLEAN selfClose] )
function openWindow ( URL )
  {
   if ( URL==null || URL.length==0 || URL=="" )
      {
       width  = "200";
       height = "60";
       URL    = "blank.html";
      }
   var newWindow = window.open ( URL, winName, "resizable=yes,scrollbars=yes,status=yes,menubar=yes,toolbar=no,top=50" +
                                 ",width="+width+",height="+height);
   var selfClose = false;
   if ( openWindow.arguments.length == 2 )
      { selfClose = openWindow.arguments[1]; }

   //if ( selfClose )
   //   { return newWindow; }
   if ( !selfClose )
      {
       if ( document.window != null && !newWindow.opener )
          { newWindow.opener = document.window; }
      }
   //newWindow.location.href = "";
  }
  
function openWebChat ( URL, winName )
  {
   if ( URL==null || URL.length==0 || URL=="" )
      {
       width  = "160";
       height = "35";
       URL    = "blank.html";
      }
   var newWindow = window.open ( URL, winName, "resizable=yes,scrollbars=auto,status=no,menubar=no,toolbar=no,location=no,top=50" +
                                 ",width="+width+",height="+height);
   var selfClose = false;
   if ( openWebChat.arguments.length == 2 )
      { selfClose = openWebChat.arguments[1]; }

   //if ( selfClose )
   //   { return newWindow; }
   if ( !selfClose )
      {
       if ( document.window != null && !newWindow.opener )
          { newWindow.opener = document.window; }
      }
   //newWindow.location.href = "";
  }
  
function openChatWindow ( URL )
  {
  /* if ( URL==null || URL.length==0 || URL=="" )
      {
       width  = "0";
       height = "0";
       URL    = "blank.html";
      }*/
   var newWindow = window.open ( URL, winName, "resizable=yes,top=50 ,width=450,height=250");
   var selfClose = false;
   if ( openChatWindow.arguments.length == 2 )
      { selfClose = openChatWindow.arguments[1]; }

   //if ( selfClose )
   //   { return newWindow; }
   if ( !selfClose )
      {
       if ( document.window != null && !newWindow.opener )
          { newWindow.opener = document.window; }
      }
   //newWindow.location.href = "";
  }

// returns a window
function makeNewWindow ( URL )
  {
   return window.open ( URL, winName, "resizable=yes,scrollbars=yes,status=yes,menubar=yes,toolbar=no,top=50" +
                        ",width="+width+",height="+height);
  }



function openPreviewWin ( URL )
  {
   var newWindow = window.open ( URL, winName, "width=400,height=300,top=120,left=25,status=yes" +
                                  ",scrollbars=yes" );
    if ( document.window != null && !newWindow.opener )
       { newWindow.opener = document.window; }
  }


function openFavWindow ( URL )
  {
   var newWindow = window.open ( URL, winName, "width=300,height=100,top=120,left=25,status=no" +
                                  ",scrollbars=no" );
    if ( document.window != null && !newWindow.opener )
       { newWindow.opener = document.window; }
  }


function winBar( stmt )
  { window.status = stmt; }



function noFrame()
  {
   if ( parent.length > 0 ) { parent.location = self.location; }
   //if ( self != top ) { top.location = self.location; }
  }


//<A HREF="" ONCLICK="JAVASCRIPT: return false;"  ONMOUSEOVER="chgImg('img2','hlite.gif');" ONMOUSEOUT="chgImg('img2','normal.gif');">
//   <IMG NAME="img2" SRC="normal.gif" WIDTH="162" HEIGHT="69"></A>
function chgImg ( imgID, imgName)
  {
   if (document.images) { document[imgID].src = imgName; }
  }



// histGo ( [INTEGER pages] ) pages + forward - backward
function histGo()
  {  
   if ( histGo.arguments.length == 1 )
      {
       var pages = histGo.arguments[0];
       window.history.go ( pages );
      }
   else
      { window.history.back(-1); }
  }



// writeHREF ( STRING URL, STRING linkText, STRING statusMsg [, STRING className] )
//  writeHREF ("JAVASCRIPT: sortAction('catName', '#IIF(sortBy IS "catName", "newSortTitle", DE("Asc"))#' );",
//             "Category", "#IIF(sortBy IS 'catName', 'newSortTitle', DE('Sort ascending order'))#", "theader" );
function writeHREF ( URL, linkText, statusMsg )
  {var className = ""
   if ( writeHREF.arguments.length == 4 )
      { className = writeHREF.arguments[3]; }
   if ( className==null || className.length==0 || className=="" )
      {document.writeln ( "<A HREF=\"" + URL + "\" " +
                        "ONMOUSEOVER=\"JAVASCRIPT: window.status='" + statusMsg + "'; return true\" " +
                        "ONMOUSEOUT=\"JAVASCRIPT: window.status=''; return true;\">" +
                        linkText + "</A>" );
      }
   else
      {document.writeln ( "<A HREF=\"" + URL + "\" " +
                        "ONMOUSEOVER=\"JAVASCRIPT: window.status='" + statusMsg + "'; return true\" " +
                        "ONMOUSEOUT=\"JAVASCRIPT: window.status=''; return true;\">" +
                        "<SPAN CLASS=\"" + className + "\">" + linkText + "</SPAN></A>" );
      }
  }


 
//To make the text change to other color when onmouseover 
//For use in Sidebar menu 
function mouseover(section, msg)
  {
   section.className = "SectionOn";
   //winBar(msg);
   return true;
  }

function mouseout(section, msg)
  {
   section.className = "Section";
   //winBar(msg);
   return true;
  }

// archive window
function openArcWindow ( URL )
  {
   var newWindow = window.open ( URL, winName, "width=300,height=100,top=120,left=25,status=no" +
                                  ",scrollbars=no" );
    if ( document.window != null && !newWindow.opener )
       { newWindow.opener = document.window; }
  }  

// full window
function openFullWindow ( URL )
  {
   var newWindow = window.open ( URL, winName, "width=600,height=300,top=0,left=25,status=no" +
                                  ",scrollbars=no" );
    if ( document.window != null && !newWindow.opener )
       { newWindow.opener = document.window; }
  }  