<!---Hide from old browsers
// NAME:    ad_course_catalog_2subdirs.js
// PURPOSE: popup window for Course Catalog - course details - EXTERNAL SITE
// REVISED: 10/02/06  Jim Veilleux


var isNavigator = ( navigator.appName.indexOf("Netscape") != -1 );

  // POPUP WINDOW WITH DETAIL IMAGE AND CAPTION INFO... 
function ShowCourseDetail(sPageTitle,  // Popup page title
                          sImage,      // Path/file name for image
                          nImgWidth,   // Image width
                          nImgHeight,  // Image height
                          sTitle,      // Courseware title                 
                          sLanguage,   // Courseware title                 
                          sAvailability,   // When available                      
                          sProduct,    // Product                      
                          sDuration,   // Duration                      
                          sPages,      // Includes                      
                          sIncludes,   // Includes                      
                          sMSRP,       // Price                     
                          sDescrip,    // Description                     
                          nPosLeft,    // Left position of window on screen   (OPTIONAL)
                          nPosTop,     // Top  position of window on screen   (OPTIONAL)
                          sBgColor,    // Window background color             (OPTIONAL)
                          sScroll ) {  // Scrollbars - "yes" or "no"          (OPTIONAL)
 
  // ESTIMATE HEIGHT OF DESCRIPTION PARAGRAPH(S)...  	 
  var nBlankLines = 0;
  var nPos        = -1;
  while ( (nPos = sDescrip.indexOf('<br', nPos + 20)) >= 0 ) { 
     nBlankLines = nBlankLines + 0.5;
  }

  var nTextHeight  = Math.round(sDescrip.length*0.24);
  var nDescHeight  = 30*Math.round(nBlankLines) + nTextHeight;
  var nButtonSpace = 50;
  var nFillerSpace = 130;
  
  sIncludes = sIncludes.length > 1 ? ' Includes ' + sIncludes : '&nbsp;';


  // SET VALUES FOR POPUP WINDOW, ADJUST FOR CAPTION LENGTH...
  var popWindow  = null;
  var nPopWidth  = nImgWidth  + 420  + (isNavigator ? 20 : 0);
  nPopWidth      = Math.max(nPopWidth, 450);
  var nPopHeight = nImgHeight + nButtonSpace + nFillerSpace + nDescHeight + (isNavigator  ?  16 : 0);
  
  var sWinName   = "photo_window";
  var sHowToBuy  = "'../../aotc/cware_popup_how_to_buy.asp'";

  // Set default values for optional parameters...
  nPosLeft = ( typeof( nPosLeft ) == 'undefined' ) ? 30        :  nPosLeft;
  nPosTop  = ( typeof( nPosTop )  == 'undefined' ) ? 50        :  nPosTop;
  sTitle   = ( typeof( sTitle )   == 'undefined' ) ? ''        :  sTitle;
  sBgColor = ( typeof( sBgColor ) == 'undefined' ) ? '#000000' :  sBgColor;
  sScroll  = ( typeof( sScroll )  == 'undefined' ) ? 'no'      :  sScroll;
  
  // Build page content...
  var sContent = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\n' +
        '<html>  \n<head> \n<STYLE TYPE="text/css"><!-- '         +
        '\n    @import url(../../AC_CSS/course_catalog_popup.css);'         +
        '\n --></STYLE> \n <title>' + sPageTitle + '</title></head> \n <body> \n'  +

        '\n\n <div id="container">' +

        '\n\n <div id="top-left">' +
        '\n <img src="' + sImage + '" alt="' + sTitle  + '"' +
        '\n  width="' + nImgWidth + '" height="' + nImgHeight + '" /></div>' + 

        '\n\n <div id="top-right">' + '<span id="title">' + sTitle + '</span></div>' +
             
        '\n\n <div class="spacer_1">&nbsp;</div>' +
        '\n\n <div class="top-detail">' + '<p><strong id="language">Language:</strong><span>'       + sLanguage + '</span></p></div>' +
        '\n\n <div class="top-detail">' + '<strong id="product">Product:</strong><span>'         + sProduct  + '</span></div>' +
        '\n\n <div class="top-detail">' + '<strong id="duration">Duration:  &nbsp;</strong><span>'  + sDuration + '</span></div>' +
        '\n\n <div class="top-detail">' + '<strong id="pages">No. pages: &nbsp;</strong><span>'     + sPages    + '</span></div>' +
        '\n\n <div class="top-detail">' + '<strong id="price">Price:     &nbsp;</strong><span>'  + sMSRP     + '</span></div>' +
        '\n\n <div class="top-detail">' + '<strong id="available">Available:</strong><span>'     + sAvailability + '</span></div>' +

        '\n\n <div id="description">' +
        
        '\n\n <p class="includes"><strong>'  + sIncludes + '</strong></p>' +

        '\n\n <p>'       + sDescrip + '</p>'  + 

        '\n\n <p style="padding-top: 15px;"><input type="button" class="button" value="Close" onClick="self.close();">' +
        '\n <span style="margin-left: 50px; font: 11px bold Verdana,Arial,Helvetica,sans-serif;"><strong>' + 

//        'For purchase information, see ' +
//        '<a href="javascript:void window.open(' + sHowToBuy + 
//        ",'cware_buy', 'width=460,height=530,left=390,top=20,resizable=no,toolbar=no,scrollbars=yes'" +                          
//        ');">How to Buy</a>'     +

         
         '</strong></span></p></div>' +

        
        '\n\n </div>\n </body></html>';

     // Open window and write contents...
     popWindow = window.open("",sWinName,
          "toolbar=no,width="+nPopWidth+",height="+nPopHeight+",status=no,scrollbars="+sScroll+",resizable=no,status=no,menubar=no,alwaysRaised=yes,left="+nPosLeft+",top="+nPosTop+'"');

     popWindow.resizeTo(nPopWidth, nPopHeight);

     if( popWindow != null ) {
        var popDoc = popWindow.document;
        popDoc.open();
        popDoc.write(sContent);
        popDoc.close();
        popWindow.focus();
     }

  }

// End hiding from old browsers  -->
