isDefault = false	// Indicates default.htm, course_offerings.asp
//--------------------------------------------------------------------------------------------------------------
function setup(headerName) {
  eval("document.myForm.SessionHeader.value = document.myForm." + headerName + ".value")
}
//--------------------------------------------------------------------------------------------------------------
function setupCOSIN1() {
  setup("COSI_O_HEADER")
}
//--------------------------------------------------------------------------------------------------------------
function setupCCDLS1() {
  setup("CCDLST_O_HEADER")
}
//--------------------------------------------------------------------------------------------------------------
function setupCourseOfferings() {
  var objSelect = document.myForm.FiscalYear
  isDefault = true
  if(objSelect.options.length > 0){
    findSelectValue(objSelect)
  }
  else{
    submitOWTERM()
  }
  document.myForm.department.focus()
}
//--------------------------------------------------------------------------------------------------------------
function setupNCOfferings() {
  var objSelect = document.myForm.FiscalYear
  isDefault = true
  if(objSelect.options.length > 0){
    findSelectValue(objSelect)
  }
  else{
    submitNCTERM()
  }
    document.myForm.department.focus()
}
//--------------------------------------------------------------------------------------------------------------
function setupDefault() {
  isDefault = true
  submitOWTERM()
}
//--------------------------------------------------------------------------------------------------------------
function setupNCDefault() {
  isDefault = true
	submitNCTERM()
}
//--------------------------------------------------------------------------------------------------------------
function setupOWTERM() {
  setup("OWTERM_O_HEADER")
  submitCourseOfferings()
}
//--------------------------------------------------------------------------------------------------------------
function setupNCTERM() {
  setup("NCTERM_O_HEADER")
	submitNCOfferings()
}
//--------------------------------------------------------------------------------------------------------------
function submitOWTERM() {
  document.myForm.action = "/WEBM001" + getClientPhase().toUpperCase() +
                           "/webm001" + getClientPhase().toLowerCase() + "serv.tx"
  document.myForm.View.value = "OWTERMI_" + getClientPhase().toUpperCase() + "VIEW"
  document.myForm.submit()
}
//--------------------------------------------------------------------------------------------------------------
function submitNCTERM() {
  document.myForm.action = "/WEBM001" + getClientPhase().toUpperCase() +
                           "/webm001" + getClientPhase().toLowerCase() + "serv.tx"
  document.myForm.View.value = "NCTERMI_" + getClientPhase().toUpperCase() + "VIEW"
  document.myForm.submit()
}
//--------------------------------------------------------------------------------------------------------------
function submitIREG() {
  var strSSL = "https://ireg"
  if((strSSL.search(/\./) == -1) || (location.port.search(/\w/) > -1))
    strSSL = ""
  location.href = strSSL + getDirectory().substr(0, 5) + "reg/"
}
//--------------------------------------------------------------------------------------------------------------
function submitCourseOfferings() {
  document.myForm.action = getDirectory() + "course_offerings.asp"
  document.myForm.submit()
}
//--------------------------------------------------------------------------------------------------------------
function submitNCOfferings() {
  document.myForm.action = getDirectory() + "nc_offerings.asp"
  document.myForm.submit()
}
//--------------------------------------------------------------------------------------------------------------
function submitHELP(strSection) {
  var strTemp = getDirectory() + "help.html#" + strSection
  window.open(strTemp, "Help", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=600")
}
//--------------------------------------------------------------------------------------------------------------
function setCCDLS1_O_KEY_CRS(strCourse) {
  document.myForm.CCDLST_O_KEY_CRS_ALL.value = strCourse
}
//--------------------------------------------------------------------------------------------------------------
function submitCCDLS1() {
  document.myForm.action = "/SRSM140" + getClientPhase().toUpperCase() +
                           "/srsm140" + getClientPhase().toLowerCase() + "serv.tx"
  document.myForm.View.value = "CCDLS1I_" + getClientPhase().toUpperCase() + "VIEW"
  document.myForm.CCDLST_O_HEADER.value = document.myForm.SessionHeader.value
  document.myForm.submit()
  return true
}
//--------------------------------------------------------------------------------------------------------------
function submitCOSIN1() {
  document.myForm.action = "/SRSM102" + getClientPhase().toUpperCase() +
                           "/srsm102" + getClientPhase().toLowerCase() + "serv.tx"
  document.myForm.View.value = "COSIN1I_" + getClientPhase().toUpperCase() + "VIEW"
  document.myForm.COSI_O_HEADER.value = document.myForm.SessionHeader.value
  document.myForm.submit()
  return true
}
//--------------------------------------------------------------------------------------------------------------
function submitCOSIN1asp() {
  var validDept = false,
      validCrs = false,
      strDept = document.myForm.department.value,
      strCrs = document.myForm.course.value,
      regDept = /[a-zA-Z]{3}/,			
      regCrs = /[0-9a-zA-Z]{3}/				
  if(isEmpty(strDept))
    alert("Department cannot be blank.")
  else if(regDept.test(strDept))
    validDept = true
  else
    alert("Department should be 3 letters.")		
  if(isEmpty(strCrs))
    validCrs = true
  else if(regCrs.test(strCrs))
    validCrs = true
  else
    alert("Course should be 3 letters/numbers.")	
  if(validDept && validCrs) {
    setCOSI_O_PAR_DEPT(strDept.toUpperCase())
    setCOSI_O_PAR_CRS(strCrs.toUpperCase())		
    submitCOSIN1()
  }
  return false
}
//--------------------------------------------------------------------------------------------------------------
function getClientPhase() {
  if(isDefault)
    return getClientPhaseDefault()
  var strPath = location.pathname
  return strPath.substr(8, 4)
}
//--------------------------------------------------------------------------------------------------------------
function getClientPhaseDefault() {
  var strPath = location.pathname
  return strPath.substr(1, 4)
}
//--------------------------------------------------------------------------------------------------------------
function getDirectory() {
  return "/" + getClientPhase().toLowerCase() + "openweb/"
}
//--------------------------------------------------------------------------------------------------------------
function getDirectoryImages() {
  return getDirectory() + "images/"
}
//--------------------------------------------------------------------------------------------------------------
function offeringsResultsStart() {
  var arrOfferingsResults = new Array, courseCount = 0, strRowId
  for(i = 1; i < 7; i++)
    eval("arrOfferingsResults[" + i + "] = new Array(document.myForm.COSI_D_CRIT_IND_" + i + ".value," +	// 0
                                                    "document.myForm.COSI_D_DEPT_" + i + ".value," +		// 1
                                                    "document.myForm.COSI_D_COS_" + i + ".value," +			// 2
                                                    "document.myForm.COSI_D_SEC_" + i + ".value," +			// 3
                                                    "document.myForm.COSI_D_TITLE_" + i + ".value," +		// 4
                                                    "document.myForm.COSI_D_CRDHR_" + i + ".value," +		// 5
                                                    "document.myForm.COSI_D_MEETS_" + i + ".value," +		// 6
                                                    "document.myForm.COSI_D_INST_" + i + ".value," +		// 7
                                                    "document.myForm.COSI_D_SRTIME_" + i + ".value," +		// 8
                                                    "document.myForm.COSI_D_SAMPM_" + i + ".value," +		// 9
                                                    "document.myForm.COSI_D_BLD_" + i + ".value," +			//10
                                                    "document.myForm.COSI_D_CAP_" + i + ".value," +			//11
                                                    "document.myForm.COSI_D_AVAIL_" + i + ".value," +		//12
                                                    "document.myForm.COSI_D_START_DATE_" + i + ".value," +	//13
                                                    "document.myForm.COSI_D_CDEPT_" + i + ".value," +		//14
                                                    "document.myForm.COSI_D_CCOS_" + i + ".value," +		//15
                                                    "document.myForm.COSI_D_CSEC_" + i + ".value," +		//16
                                                    "document.myForm.COSI_D_FEES_" + i + ".value," +		//17
                                                    "document.myForm.COSI_D_WAIT_" + i + ".value," +		//18
                                                    "document.myForm.COSI_D_WAIT_LIT_" + i + ".value," +	//19
                                                    "document.myForm.COSI_D_TTN_" + i + ".value," +			//20
                                                    "document.myForm.COSI_D_SPTIME_" + i + ".value," +		//21
                                                    "document.myForm.COSI_D_SPAMPM_" + i + ".value," +		//22
                                                    "document.myForm.COSI_D_ROOM_" + i + ".value," +		//23
                                                    "document.myForm.COSI_D_END_DATE_"   + i + ".value," +	//24
                                                    "document.myForm.COSI_D_SECNOTE_VCC_" + i + ".value," +	//25
                                                    "document.myForm.COSI_D_SECNOTE_"   + i + ".value," +	//26
 													"document.myForm.COSI_D_LOCATION_"   + i + ".value," +	//27
 													"document.myForm.COSI_D_LDROP_VCC_" + i + ".value," +	//28 
                                                    "document.myForm.COSI_D_LDROP_LIR_" + i +".value," +	//30 
						    					    "document.myForm.COSI_D_LDROP_" + i + ".value)")		//31
 if(!isEmpty(arrOfferingsResults[1][1])) {
    HTML_tr_begin("")
      HTML_th_begin("offeringsResultsHeader", 1, 1, "left", "");document.write(" Start Date / End Date ");HTML_th_end()
      HTML_th_begin("offeringsResultsHeader", 1, 1, "center", "");document.write(" Meeting Times ");HTML_th_end()
      HTML_th_begin("offeringsResultsHeader", 1, 1, "center", "");document.write("&nbsp;&nbsp;&nbsp; Days &nbsp;&nbsp;&nbsp;");HTML_th_end()
      HTML_th_begin("offeringsResultsHeader", 1, 1, "center", "");document.write("Bld-Room");HTML_th_end()
      HTML_th_begin("offeringsResultsHeader", 1, 1, "center", "");document.write("");HTML_th_end()
      HTML_th_begin("offeringsResultsHeader", 1, 1, "center", "");document.write("Instructor");HTML_th_end()
      HTML_th_begin("offeringsResultsHeader", 1, 1, "right", "");document.write("Add'l Fees");HTML_th_end()
    HTML_tr_end()
    HTML_tr_begin("")
      HTML_td_begin("horizontalBar", 9, 1, "", "");HTML_td_end()
     HTML_tr_end()
    for(i = 1; i < 7; i++) {
      if(!isEmpty(arrOfferingsResults[i][1])) {
        courseCount++
        strRowId = courseCount % 2
        switch(strRowId) {
          case 0: strRowId = "offeringsResultsEvenRow"; break
          case 1: strRowId = "offeringsResultsOddRow"; break
        }
        offeringsResultsPrimaryRow(arrOfferingsResults[i][1], arrOfferingsResults[i][2],		
                                   arrOfferingsResults[i][3], arrOfferingsResults[i][4],
                                   arrOfferingsResults[i][5], arrOfferingsResults[i][11],
                                   arrOfferingsResults[i][12], arrOfferingsResults[i][14],
				   				   arrOfferingsResults[i][15], arrOfferingsResults[i][16],
								   arrOfferingsResults[i][25], strRowId)

        offeringsResultsSecondaryRow(arrOfferingsResults[i][13], arrOfferingsResults[i][24],
                                     arrOfferingsResults[i][8] + arrOfferingsResults[i][9],
				     				 arrOfferingsResults[i][21] + arrOfferingsResults[i][22],
                                     arrOfferingsResults[i][6], arrOfferingsResults[i][10] + "-" +
                                     arrOfferingsResults[i][23] + " " + arrOfferingsResults[i][27],
//	no more touch-tone numbers  	 arrOfferingsResults[i][20], arrOfferingsResults[i][7],
									 "", arrOfferingsResults[i][7],
									 arrOfferingsResults[i][17], strRowId + "Small")
       }
	   else if(!isEmpty(arrOfferingsResults[i][6])) {
        offeringsResultsSecondaryRow("","",
									 arrOfferingsResults[i][8] + arrOfferingsResults[i][9],
                                     arrOfferingsResults[i][21] + arrOfferingsResults[i][22],
                                     arrOfferingsResults[i][6], arrOfferingsResults[i][10] + "-" +
                                     arrOfferingsResults[i][23],"",
                                     "","",strRowId + "Small")
       }
    }
    createNextLink("COSI_D_MESSAGE_XX", "HIT XMIT FOR NEXT PAGE", 9, "javascript:submitCOSIN1()",
                   "View more results", false)
  }
  else {
    HTML_tr_begin("")
      HTML_td_begin("", 1, 1, "", "");HTML_td_end()
      HTML_td_begin("", 8, 1, "", "");document.write("No courses found.");HTML_td_end()
    HTML_tr_end()
  }
}
//---Open Web-----------------------------------------------------------------------------------------------------------
function offeringsResultsPrimaryRow(strDept, strCrs, strSection, strTitle, dblCreditHours, intSeatCap, intSeatAvail, strConDept, strConCrs, strConSec, strNote, strRowId) {	
   	var strConcurrent = strConDept + strConCrs + strConSec
   	var strConcurrLit = ""
	var strCourse = strDept + strCrs + strSection
	var strJavafunction = "setCCDLS1_O_KEY_CRS('" + strCourse + "');submitCCDLS1()"
   	var strTemp = strCourse + " &nbsp;&nbsp;&nbsp; "
    var strTemp2 = "&nbsp;&nbsp;&nbsp;" + stringConverter(strTitle) + " &nbsp;&nbsp;&nbsp; "
    var intOpenSeats = 0

  	strTemp2 += " (" + parseFloat(dblCreditHours) + " credit"
  	if(parseFloat(dblCreditHours) > 1.00)
    	strTemp2 += "s"
  	if((intSeatAvail > 0) || (intSeatAvail < 9999)){
		intOpenSeats = (intSeatCap - intSeatAvail)	
    	strTemp2 += ") &nbsp;&nbsp;&nbsp;" + intOpenSeats + " seats available &nbsp;&nbsp;&nbsp;"
	}
	else 
	  	strTemp2 += ") &nbsp;&nbsp;&nbsp;" + intSeatAvail + " &nbsp;&nbsp;"
   	for(var i = strDept.length; i < 3; i++)
		strDept += " "
  	if(!isEmpty(strConcurrent)){
		strConcurrLit = " (required with "
		strTemp += strConcurrLit + strConcurrent + ") &nbsp;&nbsp;&nbsp;"
	}
  	else 
		strConcurrLit = " &nbsp;&nbsp;&nbsp; "
  HTML_tr_begin("")
    HTML_th_begin(strRowId, 7, 1, "left", "")
		document.write(strTemp);HTML_a_begin("","javascript:" + strJavafunction);document.write(" info ");HTML_a_end()
		document.write(strTemp2)
      	HTML_a_begin("", "javascript:submitHELP('results_icons')")
        	if(strSection >= "050" && strSection <= "059")
          		HTML_img("section_icons_hybrid.gif", 16, 16, "Hybrid Section", 0)
        	else if(strSection >= "070" && strSection <= "079")
          		HTML_img("section_icons_business.gif", 16, 16, "Business Simulation Section", 0)
        	else if(strSection >= "096" && strSection <= "099")
          		HTML_img("section_icons_honors.gif", 16, 16, "Honors Section", 0)
        	else if(strSection >= "300" && strSection <= "399")
          		HTML_img("section_icons_academy.gif", 16, 16, "Academy Section", 0)
        	else if(strSection >= "500" && strSection <= "599")
          		HTML_img("section_icons_telecourse.gif", 16, 16, "Telecourse Section", 0)
        	else if(strSection >= "600" && strSection <= "699")		
          		HTML_img("section_icons_internet.gif", 16, 16, "Online/Internet Section", 0)
        	else if(strSection >= "700" && strSection <= "799")			
          		HTML_img("section_icons_distance.gif", 16, 16, "Tech Prep Section", 0)	
      	HTML_a_end()
			if(strNote == ""){
      			HTML_a_begin("","javascript:" + strJavafunction);document.write(" Section Notes ");HTML_a_end()
			}
    HTML_th_end()   
  HTML_tr_end()
}
//--------------------------------------------------------------------------------------------------------------
function offeringsResultsSecondaryRow(strBeginDate, strEndDate, strBeginTime, strEndTime, strDays, strBuilding,
                                      strTTN, strInstructor, dblAdditionalFee, strRowId)
{
  HTML_tr_begin("")
    HTML_td_begin(strRowId, 1, 1, "", "");document.write(strBeginDate + "  " + strEndDate);HTML_td_end()
    HTML_td_begin(strRowId, 1, 1, "center", "");document.write(strBeginTime + " - " + strEndTime);HTML_td_end()
    HTML_td_begin(strRowId, 1, 1, "center", "");document.write(strDays);HTML_td_end()
    HTML_td_begin(strRowId, 1, 1, "center", "");document.write(strBuilding);HTML_td_end()
    HTML_td_begin(strRowId, 1, 1, "center", "");document.write(strTTN);HTML_td_end()
    HTML_td_begin(strRowId, 1, 1, "center", "");document.write(stringConverter(strInstructor));HTML_td_end()
    HTML_td_begin(strRowId, 1, 1, "right", "");document.write(dblAdditionalFee);HTML_td_end()
  HTML_tr_end()
}
//--------------------------------------------------------------------------------------------------------------
function findSelectValue(objSelect) {
  setCOSI_O_PAR_TERM(objSelect.options[objSelect.options.selectedIndex].value)
}
//--------------------------------------------------------------------------------------------------------------
function getTermText(strUnknown) {	// give it a 5 length string or a header with atleast 26 length.
  var intYear, intTerm, intFiscalYear, strChoice, strChoice2
  if(strUnknown.length == 5)
    intFiscalYear = strUnknown
  else if(strUnknown.length >= 26)
    intFiscalYear = strUnknown.substr(21, 5)
  else
    return("")
  intYear = parseInt(intFiscalYear.substr(0, 4))
  intTerm = intFiscalYear.charAt(4)
  strChoice = ""
  strChoice2 = ""
 switch(intTerm) {
    case "1" :
      strChoice += "Summer ";
	  intYear--;
	  strChoice2 += " / Summer Intersession";
	  break;
    case "3" :
      strChoice += "Fall ";
	  intYear--;
	  break;
    case "6" :
      strChoice += "Spring ";
	  strChoice2 += " / Winter Intersession";
	  break;
  }
  if(intYear >= 2000)
    strChoice += intYear += strChoice2
  return(strChoice)
}
//--------------------------------------------------------------------------------------------------------------
function writeTermChoices() {
  var strYearTerms = document.myForm.OWTERM_O_DATA.value,
      strLength = strYearTerms.length,
      i = 0, intFiscalYear, strChoice
  while(i < strLength) {
    i += 6
    intFiscalYear = strYearTerms.substr(i, 5)
    i += 6	// Avoid comma again.
    strChoice = "<option value=\"" + intFiscalYear + "\""
    if(i > strLength)		// Last choice.
      strChoice += " selected"
    strChoice += ">"
    strChoice += getTermText(intFiscalYear)
    strChoice += "</option>"
    document.write(strChoice)
  }
}
//--------------------------------------------------------------------------------------------------------------
function writeNCTermChoices() {
  var strYearTerms = document.myForm.NCTERM_O_DATA.value,
      strLength = strYearTerms.length,
      i = 0, intFiscalYear, strChoice

	//alert("strYearTerms = " + strYearTerms + " strLength = " + strLength)

	while(i < strLength) {
//    i += 6
    intFiscalYear = strYearTerms.substr(i, 30)
    i += 30	// Avoid comma again.

    strChoice = "<option value=\"" + intFiscalYear + "\""

	//alert("intFiscalYear = " + intFiscalYear + " i = " + i)

	if(i > strLength)		// Last choice.
      strChoice += " selected"
    strChoice += ">"
    strChoice += getNCTermText(intFiscalYear)
    strChoice += "</option>"
    document.write(strChoice)
  }
}
//--------------------------------------------------------------------------------------------------------------
function getNCTermText(strUnknown) {	// give it a 5 length string or a header with atleast 26 length.
  var intYear, intTerm, intFiscalYear, strChoice, strChoice2
//	alert("strUnknown = " + strUnknown)
  if(strUnknown.length == 30){
    intFiscalYear = strUnknown
//	alert("intFiscalYear = " + intFiscalYear)
  }
  else if(strUnknown.length >= 28){
    intFiscalYear = strUnknown.substr(0, 30)
//	alert("intFiscalYear = " + intFiscalYear)
  }
  else
    return("")
  intYear = parseInt(intFiscalYear.substr(0, 4))
  intTerm = intFiscalYear.charAt(4)
  strChoice = ""
  strChoice2 = " = " + intFiscalYear.substr(6,23)
  switch(intTerm) {
    case "1" :
      strChoice += "Summer ";
	  intYear--;
	  break;
    case "3" :
      strChoice += "Fall ";
	  intYear--;
	  break;
    case "6" :
      strChoice += "Spring ";
	  break;
  }
  if(intYear >= 2000)
    strChoice += intYear += strChoice2
  return(strChoice)
}
//--------------------------------------------------------------------------------------------------------------
function createNextLink(msgField, msgValue, cols, href, linkText, boolNormal)
 {
  var tempValue
  eval("tempValue = document.myForm." + msgField + ".value")
  if(tempValue == msgValue)
  	{
      HTML_tr_begin("")
        HTML_td_begin("", cols-1, 1, "right", "")
          HTML_a_begin("navigationPathLink", href);document.write(linkText + " &gt;");HTML_a_end()
        HTML_td_end()
      HTML_tr_end()
    } 
	else
	{
      HTML_tr_begin("")
        HTML_td_begin("", cols, 1, "center", "");document.write("End of Search | ")
          HTML_a_begin("", href);document.write("Return to Beginning of Search");HTML_a_end()
        HTML_td_end()
      HTML_tr_end()
    }
}
//--------------------------------------------------------------------------------------------------------------
function stringConverter(strTemp) {
  var myarray = strTemp.split(/\W/g), regTemp,
      roman = /^[ivxlcdm]+$/i, i, tempString = strTemp, returnString = new String()
  for(i = 0; i < myarray.length; i++) {
    strTemp = myarray[i]
    regTemp = new RegExp(strTemp, "i")
    var lastIndex = tempString.search(regTemp) + strTemp.length			
    if(roman.test(strTemp))
      tempString = tempString.replace(regTemp, strTemp.toUpperCase())
    else
      tempString = tempString.replace(regTemp, strTemp.charAt(0).toUpperCase() +
                                          strTemp.substring(1, strTemp.length).toLowerCase())
    returnString += tempString.substring(0, lastIndex)				
    tempString = tempString.substring(lastIndex, tempString.length)		
  }
  var ampcodes = /&(lt|gt|nbsp|copy|reg|#\d+);/i
  tempString = returnString
  returnString = ""
  myarray = ampcodes.exec(tempString)
  while(myarray != null) {
    strTemp = myarray[0]
    regTemp = new RegExp(strTemp, "gi")
    var lastIndex = tempString.search(regTemp) + strTemp.length			
    tempString = tempString.replace(regTemp, strTemp.toLowerCase())
    returnString += tempString.substring(0, lastIndex)				
    tempString = tempString.substring(lastIndex, tempString.length)	
    myarray = ampcodes.exec(tempString)
  }
  return(returnString + tempString)
}
//--------------------------------------------------------------------------------------------------------------
function isEmpty(strTemp) {
  var boolString = true,
      i = 0
  while((i < strTemp.length) && (boolString == true)) {
    if(strTemp.substring(i, i + 1) != " ")
      boolString = false
    i++
  }
  return boolString
}
//--------------------------------------------------------------------------------------------------------------
function setCOSI_O_PAR_DEPT(strDept) {
	if (document.myForm.Telecourses.checked)		
		document.myForm.COSI_O_TELE.value = "X"
	if (document.myForm.Online.checked)		
		document.myForm.COSI_O_ONLINE.value = "X"
	if (document.myForm.Acadamy.checked)		
		document.myForm.COSI_O_ACAD.value = "X"
	if (document.myForm.Honors.checked)		
		document.myForm.COSI_O_HONORS.value = "X"
	if (document.myForm.Hybrid.checked)		
		document.myForm.COSI_O_HYBRID.value = "X"
    document.myForm.COSI_O_PAR_DEPT.value = strDept
}
//--------------------------------------------------------------------------------------------------------------
function setCOSI_O_PAR_CRS(strCourse) {
  document.myForm.COSI_O_PAR_CRS.value = strCourse
}
//--------------------------------------------------------------------------------------------------------------
function setCOSI_O_PAR_TERM(strTerm) {
  var strTemp = new String(document.myForm.SessionHeader.value)
  document.myForm.SessionHeader.value = strTemp.substr(0, 21) + strTerm + strTemp.substring(26, strTemp.length)
  document.myForm.COSI_O_PAR_TERM.value = strTerm
}
//--------------------------------------------------------------------------------------------------------------
function HTML_a_begin(strId, strHref) {
  var strTemp = "<a id=\"" + strId + "\" href=\"" + strHref + "\">"
  document.write(strTemp)
}
//--------------------------------------------------------------------------------------------------------------
function HTML_a_end() {
  document.write("</a>")
}
//--------------------------------------------------------------------------------------------------------------
function HTML_img(strSrc, intWidth, intHeight, strAlt, intBorder) {
  var strTemp = "<img src=\"" + getDirectoryImages() + strSrc + "\"" + 
                " width=\"" + intWidth + "\" height=\"" + intHeight + "\"" + 
                " alt=\"" + strAlt + "\" border=\"" + intBorder + "\">"
  document.write(strTemp)
}
//--------------------------------------------------------------------------------------------------------------
function HTML_table_begin(intWidth, intCellPadding, intCellSpacing, intBorder, strAlign) {
  var strTemp = "<table width=\"" + intWidth + "\" cellpadding=\"" + intCellPadding + "\"" + 
                " cellspacing=\"" + intCellSpacing + "\" border=\"" + intBorder + "\"" + 
                " align=\"" + strAlign + "\">"
  document.write(strTemp)
}
//--------------------------------------------------------------------------------------------------------------
function HTML_table_end() {
  document.write("</table>")
}
//--------------------------------------------------------------------------------------------------------------
function HTML_tr_begin(strId) {
  var strTemp = "<tr id=\"" + strId + "\">"
  document.write(strTemp)
}
//--------------------------------------------------------------------------------------------------------------
function HTML_tr_end() {
  document.write("</tr>")
}
//--------------------------------------------------------------------------------------------------------------
function HTML_th_begin(strId, intColSpan, intRowSpan, strAlign, strValign) {
  var strTemp = "<th id=\"" + strId + "\" colspan=\"" + intColSpan + "\"" + 
                " rowspan=\"" + intRowSpan + "\" align=\"" + strAlign + "\"" + 
                " valign=\"" + strValign + "\">"
  document.write(strTemp)
}
//--------------------------------------------------------------------------------------------------------------
function HTML_th_end() {
  document.write("</th>")
}
//--------------------------------------------------------------------------------------------------------------
function HTML_td_begin(strId, intColSpan, intRowSpan, strAlign, strValign) {
  var strTemp = "<td id=\"" + strId + "\" colspan=\"" + intColSpan + "\"" + 
                " rowspan=\"" + intRowSpan + "\" align=\"" + strAlign + "\"" + 
                " valign=\"" + strValign + "\">"
  document.write(strTemp)
}
//--------------------------------------------------------------------------------------------------------------
function HTML_td_end() {
  document.write("</td>")
}
//--------------------------------------------------------------------------------------------------------------