//File.......:  jsLaunch.js
//Description:  Used to launch the content window.

//******************************************************************************************************
function fNewWinURL( strURL, strWinName ) {
//******************************************************************************************************
var strCurrentURL;
var strPassOn;
var intPosAnchor;
var intPosParam;
var winContent = null;

  strWinName = (typeof strWinName == "string") ? strWinName : "winContentName";

  strWinProp = " toolbar=no"         //Back, Forward, etc...
               + ",location=no"      //URL field
               + ",directories=no"   //"What's New", etc...
               + ",status=yes"       //Status Bar at bottom of window.
               + ",menubar=no"       //Menubar at top of window.
               + ",resizable=no"    //Allow resizing by dragging. (Yes - Does not work with Netscape or IE)
               + ",scrollbars=yes"   //Displays scrollbars is document is larger than window.
               + ",titlebar=yes"     //Enable/Disable titlebar resize capability.
               + ",width=788"        //Standard 640,800/788, 800/788
               + ",height=541"       //Standard 480,600/541, 600/566               
               + ",top=0"            //Offset of windows top edge from screen.
               + ",left=0"           //Offset of windows left edge from screen.
               + "";

  strCurrentURL = document.URL + ""; //must have the +"" to convert to string.
  strPassOn     = "";
  intPosAnchor  = strCurrentURL.indexOf("#"); //For bookmarks/anchors
  intPosParam   = strCurrentURL.indexOf("?"); //For parameters passed by LMS etc...

  if ( intPosAnchor > -1 ) {
    //Anchors/Bookmarks.  Start from "#".  If it exists, will always before "?"
    strPassOn = strCurrentURL.substring(intPosAnchor);
  }else if ( intPosParam > -1) {
    //Parameters. Start from "?"
    strPassOn = strCurrentURL.substring(intPosParam);
  } else { 
    strPassOn = "";
  }

  strURL = strURL + strPassOn; //Add the bookmark or parameters to the new URL.

  //Start:  Debugging of param/bookmarks
  //document.write("For testing purposes:<br>");
  //document.write("<b>document.URL = </b><br>" + document.URL + "<br>");
  //document.write("<br>");
  //document.write("<b>strURL = </b><br>" + strURL + "<br>");
  //document.write("<br>");
  //Stop:
 

  winContent = window.open(strURL, strWinName, strWinProp);  //parms: URL,window name,properties.

  //window.location.href = "/LearningSpace4/Program/System/Help/Topics/en/Help/Student_help/StudentHome.html"
  winContent.focus();                           

  //window.close();  //Does not close when launched from LS4
                     //When launched as a new window from LS4, the winMsg window gets closed!

}


