/////////////////////////////////////////////////////////////////////////////////////////////////////////
// JavaScript Function Name:  Explain
// Purpose: Explain creates a popup window that displays help information to the user.
// Note: functions getTitle, getHeight, getWidth & getContent are appended at build time
/////////////////////////////////////////////////////////////////////////////////////////////////////////

function explain(name)
{
var vTitle=getTitle(name)
var vHeight=getHeight(name)
var vWidth=getWidth(name)
var vContent=getContent(name)
newwin = window.open('','Explanation','resizable=1,location=0,status=0,scrollbars=0,top=150,left=150,width='+vWidth+',height='+ vHeight);
if (!newwin.opener) newwin.opener = self;
with (newwin.document)
   {
open();
write('<html><head><title>Military Guides Online</title>');
write('<link rel="StyleSheet" href="explain.css" type="text/css">');
write('</head><body>');
write('<p class="Title">' + vTitle + '</p>');
write('<form name=form>');
write('<p>' + vContent + '</p>');
write('<p align="center"><input type=button value="Close" onClick=window.close()></p>');
write('</form></body></html>');
close();
   }
}

function getTitle(vName) {
 if (vName=="CrsFolder") {
  return "Service"
 } else {
  if (vName=="CrsKeyword") {
   return "Keywords"
  } else {
   if (vName=="CrsNumber") {
    return "Course Number"
   } else {
    if (vName=="CrsLocation") {
     return "School/Location"
    } else {
     if (vName=="CrsDate") {
      return "Date"
     } else {
      if (vName=="CrsAceID") {
       return "ACE ID"
      } else {
       if (vName=="CrsSort") {
        return "Sort Results By"
       } else {
        if (vName=="OccFolder") {
         return "Occupation"
        } else {
         if (vName=="OccKeyword") {
          return "Keywords"
         } else {
          if (vName=="OccDesignator") {
           return "Occupation Designator"
          } else {
           if (vName=="OccDate") {
            return "Date"
           } else {
            if (vName=="OccAceID") {
             return "ACE ID"
            } else {
             if (vName=="OccSort") {
              return "Sort Results By"
             } else {
              if (vName=="CrsDownload") {
               return "Download Detailed List"
              } else {
               if (vName=="OccDownload") {
                return "Download Detailed List"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
}


function getHeight(vName) {
 if (vName=="CrsFolder") {
  return 178
 } else {
  if (vName=="CrsKeyword") {
   return 404
  } else {
   if (vName=="CrsNumber") {
    return 180
   } else {
    if (vName=="CrsLocation") {
     return 404
    } else {
     if (vName=="CrsDate") {
      return 259
     } else {
      if (vName=="CrsAceID") {
       return 266
      } else {
       if (vName=="CrsSort") {
        return 164
       } else {
        if (vName=="OccFolder") {
         return 179
        } else {
         if (vName=="OccKeyword") {
          return 388
         } else {
          if (vName=="OccDesignator") {
           return 227
          } else {
           if (vName=="OccDate") {
            return 260
           } else {
            if (vName=="OccAceID") {
             return 265
            } else {
             if (vName=="OccSort") {
              return 164
             } else {
              if (vName=="CrsDownload") {
               return 335
              } else {
               if (vName=="OccDownload") {
                return 284
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
}


function getWidth(vName) {
 if (vName=="CrsFolder") {
  return 273
 } else {
  if (vName=="CrsKeyword") {
   return 410
  } else {
   if (vName=="CrsNumber") {
    return 282
   } else {
    if (vName=="CrsLocation") {
     return 453
    } else {
     if (vName=="CrsDate") {
      return 350
     } else {
      if (vName=="CrsAceID") {
       return 430
      } else {
       if (vName=="CrsSort") {
        return 276
       } else {
        if (vName=="OccFolder") {
         return 273
        } else {
         if (vName=="OccKeyword") {
          return 427
         } else {
          if (vName=="OccDesignator") {
           return 320
          } else {
           if (vName=="OccDate") {
            return 352
           } else {
            if (vName=="OccAceID") {
             return 449
            } else {
             if (vName=="OccSort") {
              return 295
             } else {
              if (vName=="CrsDownload") {
               return 462
              } else {
               if (vName=="OccDownload") {
                return 462
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
}


function getContent(vName) {
 if (vName=="CrsFolder") {
  return "Select <i>All Services</i> to search the entire database. Select an individual service to restrict the search to just that service."
 } else {
  if (vName=="CrsKeyword") {
   return "<table width=100% border=0 cellspacing=0 cellpadding=2>   <tr>     <td valign=top colspan=2>Enter one or more keywords from the course title. You can use entire words or word fragments.<br><br><b>Example:</b> &#8220;miss&#8221; will find entries containing <i> missile</i> as well as <i>noncommissioned officer</i>.<br><br>Search criteria are not case sensitive. Multiple entries are grouped depending on how they are joined:<br></td>   </tr>   <tr>     <td valign=top nowrap width=20%>&nbsp;&nbsp;&nbsp;&#8220;+&#8221;, &#8220;&amp;&#8221;, and &#8220;and&#8221;</td>     <td valign=top>...are  treated as ANDs</td>     </tr>   <tr>     <td valign=top nowrap>&nbsp;&nbsp;&nbsp;&#8220;|&#8221;, blank spaces, and  &#8220;or&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>     <td valign=top>...are  treated as ORs.</td>     </tr>   <tr>     <td valign=top colspan=2><br>       When there is a mixture of ANDs and ORs, the ANDs are evaluated first.<br><br>       <b>Example:</b> Search will evaluate &#8220;aviation &amp; radar       equipment + maintenance&#8221; as <i>(aviation AND radar) OR (equipment       AND maintenance)</i>. </td>     </tr> </table>"
  } else {
   if (vName=="CrsNumber") {
    return "Enter a full or partial course number. To illustrate, <i>603</i> or <i>68g</i> will both find course number <i>603-68G30</i>. Search criteria are not case sensitive."
   } else {
    if (vName=="CrsLocation") {
     return "<table width=100% border=0 cellspacing=0 cellpadding=2>  <tr>   <td colspan=2>Enter one or more keywords from the school name or location. Entries can be either entire words, or word fragments<br><br>    <b>Example:</b> &#8220;ar&#8221; will find <i>Armor Center and School, Ft. Knox, KY</i> as well as <i>Professional Education Center, North Little Rock, AR</i>.<br><br>    Search criteria are not case sensitive. Multiple entries are grouped depending on how they are joined:   </td>  </tr>  <tr>   <td valign=top nowrap width=20%>&nbsp;&nbsp;&nbsp;&#8220;+&#8221;, &amp;&#8221;, and &#8220;and&#8221;</td>   <td valign=top>...are  treated as ANDs</td>  </tr>  <tr>   <td valign=top nowrap>&nbsp;&nbsp;&nbsp;&#8220;|&#8221;, blank spaces, and  &#8220;or&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>   <td valign=top>...are  treated as ORs.</td>  </tr>  <tr>   <td valign=top colspan=2><br>When there is a mixture of ANDs and ORs, the ANDs are evaluated first.<br><br>   <b>Example:</b> Search will evaluate &#8220;missile &amp; munitions or redstone and arsenal&#8221; as <i>(missile AND munitions) OR (redstone AND arsenal)</i>.   </td>  </tr> </table>"
    } else {
     if (vName=="CrsDate") {
      return "Enter a year &#8212; or a month and year &#8212; during which you attended the course. This criterion finds all courses for which the entry is greater than or equal to the start date AND less than or equal to the end date.<br><br> Two-digit  entries less than or equal to 30 are  converted to 20XX years, while two digit entries greater than 30 are converted to 19XX years."
     } else {
      if (vName=="CrsAceID") {
       return "<table width=100% border=0 cellspacing=0 cellpadding=2>  <tr>   <td valign=top colspan=2>    Enter the full course identification number assigned by ACE, or just the initial portion.<br><br>    <b>Example:</b><br>   </td>  </tr>  <tr>   <td valign=top nowrap>&nbsp;&nbsp;&nbsp;Entering this...</td>   <td valign=top>...will find:</td>  </tr>  <tr>   <td valign=top nowrap width=20%>&nbsp;&nbsp;&nbsp;&#8220;ar-1715-0199&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>   <td valign=top><i>Ground Control Radar Repair</i></td>  </tr>  <tr>   <td valign=top nowrap>&nbsp;&nbsp;&nbsp;&#8220;ar-1715&#8221;</td>   <td valign=top>all Army electronics-related courses</td>  </tr>  <tr>   <td height=22 valign=top>&nbsp;&nbsp;&nbsp;&#8220;ar&#8221;</td>   <td valign=top>all Army courses</td>  </tr> </table>"
      } else {
       if (vName=="CrsSort") {
        return "This option sets the sort order of the results returned by the search. The default sort order is by course title."
       } else {
        if (vName=="OccFolder") {
         return "Select <i>All Occupations</i> to search the entire database. Select an individual occupation to restrict the search to just that occupation."
        } else {
         if (vName=="OccKeyword") {
          return "<table width=100% border=0 cellspacing=0 cellpadding=2>   <tr>    <td valign=top colspan=2>Enter one or more keywords from the occupation title. You can use entire words or word fragments.<br><br><b>Example:</b> &#8220;ser&#8221; will find both <i>Aeroscout Observer</i> and <i>Army Senior Sergeant</i>.<br><br>Search criteria are not case sensitive. Multiple entries are grouped depending on how they are joined:<br>   </td>   </tr>   <tr>    <td valign=top nowrap width=20%>&nbsp;&nbsp;&nbsp;&#8220;+&#8221;, &#8220;&amp;&#8221;, and &#8220;and&#8221;</td>    <td valign=top>...are  treated as ANDs</td>   </tr>   <tr>    <td valign=top nowrap>&nbsp;&nbsp;&nbsp;&#8220;|&#8221;, blank spaces, and  &#8220;or&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>    <td valign=top>...are  treated as ORs.</td>   </tr>   <tr>    <td valign=top colspan=2><br>When there is a mixture of ANDs and ORs, the ANDs are evaluated first.<br><br><b>Example:</b> Search will evaluate &#8220;field &amp; artillery senior + sergeant&#8221; as <i>(field AND artillery) OR (senior AND sergeant)</i>.        </td>  </tr> </table>"
         } else {
          if (vName=="OccDesignator") {
           return "Enter the full occupation designator, or just the initial portion. Search criteria are not case sensitive.<br><br><b>Example:</b> entering &#8220;88&#8221; will find Army enlisted occupations from 88H through 88Z, and warrant occupations 880A and 881A."
          } else {
           if (vName=="OccDate") {
            return "Enter a year &#8212; or a month and year &#8212; during which you held the occupation. This criterion finds all occupations for which the entry is greater than or equal to the start date AND less than or equal to the end date.<br><br>Two-digit  entries less than or equal to 30 are converted to 20XX years, while two-digit entries greater than 30 are converted to 19XX years."
           } else {
            if (vName=="OccAceID") {
             return "<table width=100% border=0 cellspacing=0 cellpadding=2>   <tr>     <td valign=top colspan=2>Enter the occupation identification number assigned by ACE, or the initial portion of that number.<br><br>       <b>Example:</b><br>       </td>   </tr>   <tr>     <td valign=top nowrap>&nbsp;&nbsp;&nbsp;Entering this...</td>     <td valign=top>...will find occupation:</td>   </tr>   <tr>     <td valign=top nowrap width=20%>&nbsp;&nbsp;&nbsp;&#8220;ner-ag-002&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>     <td valign=top><b>Aerographer&#8217;s Mate</b>; dates 01/91&#8211;11/01</td>   </tr>   <tr>     <td valign=top nowrap>&nbsp;&nbsp;&nbsp;&#8220;ner-ag&#8221;</td>     <td valign=top><b>Aerographer&#8217;s Mate</b>; all timeframes</td>   </tr>   <tr>     <td height=22 valign=top>&nbsp;&nbsp;&nbsp;&#8220;ner&#8221;</td>     <td valign=top>all Navy rates and ratings</td>   </tr> </table>"
            } else {
             if (vName=="OccSort") {
              return "This option sets the sort order of the results returned by the search. The default sort order is by occupation title."
             } else {
              if (vName=="CrsDownload") {
               return "<p><b>Description:</b> Download a Microsoft Excel spreadsheet for the search results that contains the following columns: <ul>  <li>ACE ID</li>  <li>Course Number(s)</li>  <li>Course Title</li>  <li>Course Length(s)</li>  <li>Start Date (mm/yy)</li>  <li>End Date (mm/yy, or &quot;Pres&quot; if the course is still being offered)</li>  <li>Training Location(s)</li> </ul></p>  <p><b>Recommended Software:</b> Microsoft Excel 2000 or later for best results. However, any application that can read HTML can open the file (although some formatting information may be lost).</p>"
              } else {
               if (vName=="OccDownload") {
                return "<p><b>Description:</b> Download a Microsoft Excel spreadsheet for the search results that contains the following columns: <ul>  <li>ACE ID</li>  <li>Occupation Title</li>  <li>Start Date (mm/yy)</li>  <li>End Date (mm/yy, or &quot;Pres&quot; if the course is still being offered)</li> </ul></p>  <p><b>Recommended Software:</b> Microsoft Excel 2000 or later for best results. However, any application that can read HTML can open the file (although some formatting information may be lost).</p>"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
}

