
//'----------------------------------------------------------------------------
//' %MODULE:
//'   winurl.js
//' 
//' %DESCRIPTION: 
//'   Rinkner common js file 
//'     define WinURL and ListOfWinURL
//'        -- objects for holding URLs to be opened in their own
//'        --             windows along with the window parms
//'
//' %AUTHOR:
//'   EDS 
//'
//' %COPYRIGHT:
//'   Copyright (c) 2006 Electronic Data Systems. All Rights Reserved.
//'
//'----------------------------------------------------------------------------
<!--

// -- ------------------------
// -- ListOfWinURLs
// -- ------------------------

function ListOfWinURLs(doc) {

   if (doc == null) return;

   if ( !ListOfWinURLs.prototype.add) {
      ListOfWinURLs.prototype.add = _ListOfWinURLs_add;
      ListOfWinURLs.prototype.entryByIdx = _ListOfWinURLs_entryByIdx;
      ListOfWinURLs.prototype.entryByID = _ListOfWinURLs_entryByID;
   }

   this.numEntries = 0;

} // -- end function ListOfWinURLs


function _ListOfWinURLs_add (doc, sURL, sWinWidth, sWinHeight, sWinID, sWinNm,
                 sScrollbars, sMenubar, sStatus, sLocation,  sToolbar,
                 sDirectories, sResizable) {

   var idx = this.numEntries;
   var numArgs = _ListOfWinURLs_add.arguments.length;

   var l_name,l_toolbar,l_menubar,l_status,l_location,l_scrollbars,l_directories,l_resizable;
                                     
   l_name = "theWin";
   l_scrollbars =  "1";
   l_menubar = "0";
   l_status = "0";
   l_location =  "0";
   l_toolbar = "0";
   l_directories =  "0"; 
   l_resizable =  "1";
   
   
   if ( numArgs > 5 ) {
      l_name = sWinNm;
      if ( numArgs > 6 ) {
         l_scrollbars = sScrollbars;
         if ( numArgs > 7 ) {
            l_menubar = sMenubar;
            if ( numArgs > 8 ) {
               l_status = sStatus;
               if ( numArgs > 9 ) {   
                  l_location = sLocation;
                  if ( numArgs > 10 ) {
                     l_toolbar = sToolbar;                    
                     if ( numArgs > 11 ) {
                        l_directories = sDirectories;
                        if ( numArgs > 12 ) {
                           l_resizable = sResizable;
                        }
                     }
                  }
               }
            }
         }
      }
   }

   this[idx] = new oWinURL(this, sURL, sWinWidth, sWinHeight, sWinID, l_name, 
             l_scrollbars, l_menubar, l_status, l_location, l_toolbar, l_directories, l_resizable);
 
   this.numEntries = this.numEntries + 1;

} // -- end funciton _ListOfWinURLs_add




function _ListOfWinURLs_entryByIdx(idx) {
   return this[idx];

} // -- end function _ListOfWinURLs_entryByIdx


function _ListOfWinURLs_entryByID(sID) {
   
   var oWinURL;
   
   for ( var i = 0; i < this.numEntries; i++ ) {
      
      oWinURL = this[i];
      
      if (oWinURL.id == sID ) {
         // -- found it
         return oWinURL;
      }
   
   }  // -- end for
   
   
   return null;

} // -- end function _ListOfWinURLs_entryByIdx



// -- -----------------------------------------------------------------------
// -- WINDOWURL OBJECT
// -- --------------------
// --
function oWinURL(doc, sURL, sWinWidth, sWinHeight, sWinID, sWinNm, 
                 sScrollbars, sMenubar, sStatus, sLocation, sToolbar, 
                 sDirectories, sResizable) {

   if ( doc == null ) return;

   var numArgs = oWinURL.arguments.length;

   if ( !oWinURL.prototype.sWinID) {
      oWinURL.prototype.open = _oWinURL_open;
      
      oWinURL.prototype.URL = "#";
      oWinURL.prototype.width = "650";
      oWinURL.prototype.height = "640";
      oWinURL.prototype.id = "";

      oWinURL.prototype.name = "theWin";

      oWinURL.prototype.scrollbars = "1";
      oWinURL.prototype.menubar = "0";
      oWinURL.prototype.status = "0";
      oWinURL.prototype.location = "0";
      oWinURL.prototype.toolbar = "0";
      oWinURL.prototype.directories = "0";
      oWinURL.prototype.resizable = "1";
                                     
   }

   this.URL = sURL;
   this.width = sWinWidth;
   this.height = sWinHeight;
   this.id = sWinID;

   if ( numArgs > 5 ) {
      this.name = sWinNm;
      if ( numArgs > 6 ) {
         this.scrollbars = sScrollbars;
         if ( numArgs > 7 ) {
            this.menubar = sMenubar;
            if ( numArgs > 8 ) {
               this.satus = sStatus;
               if ( numArgs > 9 ) {   
                  this.location = sLocation;
                  if ( numArgs > 10 ) {
                     this.toolbar = sToolbar;
                     if ( numArgs > 11 ) {
                        this.directories = sDirectories;
                        if ( numArgs > 12 ) {
                           this.resizable = sResizable;
                        }
                     }
                  }
               }
            }
         }
      }
   }
   
   return;

}
// -- end function oWinURL


function _oWinURL_open () {


   var sFeatures;
   sFeatures = "toolbar="      + this.toolbar      + ",location="  + this.location +
               ",directories=" + this.directories  +
               ",status="      + this.status       + ",menubar="   + this.menubar +
               ",scrollbars="  + this.scrollbars   + ",resizable=" + this.resizable +
               ",width="       + this.width        + ",height="    + this.height;

   var w = window.open (this.URL, this.name, sFeatures);
   if (w) {
		if (this.resizable == "1") {
  	      w.resizeTo(this.width, this.height);
		}
   	w.focus();
   }
   
   return (false);

}
// -- end function oWinURL_open


// -->

