<!-- Hide script from old browsers
//=============================================================================
//
// Version 1.x 20??-??-??
//
// Requirements:
//    none
//
// Opens a link placing the focus on the opened window.
//
function openWindow(myLink,windowName)
   {
   if(! window.focus)return;
   var myWin=window.open("",windowName,"height=screen.height,width=screen.width,left=0,top=0,dependent=no,scrollbars=yes,location=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes");
   if (parseInt(navigator.appVersion) >= 4) { myWin.focus(); }
   myLink.target=windowName;
//   myWin.target=windowName;
   }

//=============================================================================
//
// Version 1.0 2011-06-05
//
// Written by GCSRSS
//
// Requirements:
//    openWindow (in this file)
//    overlib    (external)
//
// Writes code to open a link using openWindow, ensuring the same passed text
// is used for onmouseover and onfocus when displayed (handled by overlib).
//
// When the mouse pointer is moved over the link, hover text is displayed.
// If no text is passed, the default text is displayed instead.
// If text is passed, it is displayed preceding the detault text. The passed text
// cannot contain single quotes, even escaped (\') because the escape character
// is removed before the text is passed on to overlib. Therefore, the text will cause
// an error. As long as the text is simple plain text, it works fine.
//
// The title of the hovertext is above the passed text.
// If no title is passed, the default title is displayed instead.
// If title is passed, it is displayed preceding the detault title.
//
// The URL is a required parameter.
//
// The associated text to display as the link is also a required parameter.
//
// The class to use for the link can be passed, otherwise "x" is used.
//
// The page code can be passed, otherwise codepage is used.
//
// Example:
//   Head section: <script type="text/javascript" src="common/js/hd_openwindow.js"></script>
//   Body section: <script type="text/javascript">openExtURL('Computer Guru from long ago.','Computer Consulting','http://www.gcsrss.com/','<img src="images/logo.gif" alt="Click to learn about the company." width="100" height="50" />','x','');</script>
//
function openExtURL(p_text,p_title,p_URL, p_URL_text,p_class,p_page)
   {
   var L_default_text = "Clicking this link opens another copy of the browser (or another browser tab).";
   var L_default_title ="External Link";
   var L_tclass = '';
   var L_pagecode = 'codepage';
   var L_output = '';


   if (p_URL == '')
      {
      document.write('GCSRSS: Error: openExtURL: No URL passed to routine.');
      return;
      }
   if (p_URL_text == '')
      {
      document.write('GCSRSS: Error: openExtURL: No link text passed to routine.');
      return;
      }
   
   if (p_page != '')
      L_pagecode=page;
   else
      L_pagecode='codepage';
   L_output+='<a ';
   L_output+='onmouseover="dcc(\'';
   if (p_text != '')
      {
      L_output+=p_text;
      L_output+=' - ';
      }
   L_output+=L_default_text;
   L_output+='\',\'';
   if (p_title != '')
      {
      L_output+=p_title;
      L_output+=' - ';
      }
   L_output+=L_default_title;
   L_output+='\'); return true;" onmouseout="nd(); return true;"';
   L_output+=' onfocus="dcc(\'';
   L_output+=p_text;
   L_output+='\',\'';
   L_output+=p_title;
   L_output+='\'); return true;" onblur="nd(); return true;"';
   L_output+=' onclick="openWindow(this,\''+L_pagecode+'\')"';

   if (p_class != '')
      L_tclass=p_class;
   else
      L_tclass='x';
   L_output+=' class="'+L_tclass+'"';
   
   L_output+=' href="';
   L_output+=p_URL;
   L_output+='">';
   L_output+=p_URL_text;
   L_output+='</a>';
   if (L_output != '')
      {
      //alert (L_output);
      document.write(L_output);
      L_output='';
      }
   } // end openExtURL








//=============================================================================
//
// Version 1.x 20??-??-??
//
// Requirements:
//    none
//
// Opens a link placing the focus on the opened window.
//
function popUpWindow(wLink)
   {
props = window.open(wLink,'poppage','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=*,height=*');
   if (parseInt(navigator.appVersion) >= 4) { props.focus(); }
   }


var SGPopupWindow=null;

//=============================================================================
//
// Version 1.x 20??-??-??
//
// Requirements:
//    none
//
// Opens a link placing the focus on the opened window.
//
function SGPopup( mypage, myname, w, h, pos, infocus )
   {
   var LeftPosition;
   var TopPosition;

    if(pos=='random')
       {
       LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
       TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
       }
    if( pos=='center' )
       {
       LeftPosition=(screen.width)?(screen.width-w)/2:100;
       TopPosition=(screen.height)?(screen.height-h)/2:100;
       }
    else
       if( (pos!='center' && pos!='random') || pos==null)
          {
          LeftPosition=100;TopPosition=100;
          }

    var settings='width='+ w + ', height='+ h + ', top=' + TopPosition + ', left=' + LeftPosition + ', location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,dependent=no';
    var SGPopupWindow=window.open( mypage, myname, settings );
    if( infocus=='front' )
       {
       SGPopupWindow.focus();
       SGPopupWindow.location=mypage;
       }
   }

//=============================================================================
//
// Version 1.x 20??-??-??
//
// Requirements:
//    none
//
// Opens a link placing the focus on the opened window.
//
function NewWindow(mypage, myname, w, h, scroll)
   {
   var winl = (screen.width - w) / 2;
   var wint = (screen.height - h) / 2;
   var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+'';
   var win = window.open(mypage, myname, winprops);
   if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
   }

//  End hiding -->

