	var applyYourselfButton = "<img src=\"/images/btn_apply_yourself.gif\" width=\"106\" height=\"33\" alt=\"\" border=\"0\">";
	var collegeNetButton = "<img src=\"/images/btn_apply_collegenet.gif\" width=\"106\" height=\"34\" alt=\"\" border=\"0\">";
	var embarkButton = "<img src=\"/images/btn_apply_embark.gif\" width=\"106\" height=\"34\" alt=\"\" border=\"0\">";
	var lineBreak = "&nbsp;<br>";
	var noMainUrlAvailable = "&nbsp;";
	var noOnlineAppUrlAvailable = "&nbsp;";
	
	function setNotAvailableMessages() {
		// mainURLNotAvailable and onlineAppUrlNotAvailable are declared/initialized in oas_compare.jsp
		if (mainURLNotAvailable != null && mainURLNotAvailable != "")
			noMainUrlAvailable = mainURLNotAvailable;
		if (onlineAppURLNotAvailable != null && onlineAppURLNotAvailable != "")
			noOnlineAppUrlAvailable = onlineAppURLNotAvailable;
	}
	
	function writeMainSchoolLinks(colNum) {
		// schoolURLs[] and schoolNames[] are declared/initialized in oas_compare.jsp
		var url = schoolURLs[colNum - 1];
		var name = schoolNames[colNum - 1];
		var mainURL = lineBreak;
		
		if (url == "" || url == null || url == "&nbsp;") {
		 	if (name != "" && name != null)
				mainURL = mainURL + noMainUrlAvailable;
		}
		else {
			mainURL = mainURL + writeLink(url,"mainLink" + colNum,name);
		}
		document.write(mainURL + lineBreak);
	}
	
	function writeOnlineAppLinks(colNum) {
		// applyYourselfURLs[], collegeNetURLs[], embarkURLs[], and schoolNames[] are declared/initialized in oas_compare.jsp
		var applyYourselfLink = applyYourselfURLs[colNum - 1];
		var collegeNetLink = collegeNetURLs[colNum - 1];
		var embarkLink = embarkURLs[colNum - 1];
		var schoolName = schoolNames[colNum - 1];
		var allLinks = lineBreak;
		
		if (allLinksBlank(applyYourselfLink,collegeNetLink,embarkLink)) {
			if (schoolName != null && schoolName != "")
		 		allLinks = allLinks + noOnlineAppUrlAvailable;
		}
		else {
			allLinks = allLinks + writeLink(applyYourselfLink,"applyYourself"+colNum,applyYourselfButton);
			allLinks = allLinks + writeLink(collegeNetLink,"collegeNet"+colNum,collegeNetButton);
			allLinks = allLinks + writeLink(embarkLink,"embark"+colNum,embarkButton);
		}
		document.write(allLinks + lineBreak);
	}
	
	// This function writes any link (main or online application)
	function writeLink(url, urlName, urlClickableItem)
	{
		if (url != "") {
			url = writeExternalSiteHref(url);
			var aUrl = "<a name=\""+urlName+"\" href=\""+url+"\" target=\"_blank\" class=\"appxsm\">"+urlClickableItem+"</a><br>";
			return (aUrl);
		}
		else
			return (url);
	}
	
	function allLinksBlank(link1, link2, link3)	{
		var allBlank = false;
		if (link1 == "" && link2 == "" && link3 == "")
			allBlank = true;
		return (allBlank);
	}
	
	// This function is called whenever one of the select drop-down lists changes on the compare page.
	function checkSelection(obj) {
		if (obj.selectedIndex != 0)	{
			/* extract last character from name of select object that changed, e.g. the second select list
			*  is named "selectedSchoolID2", so the "2" is extracted from the end of the name to determine
			*  which column has changed.
			*/
			document.frmSelectSchool.columnChanged.value = obj.name.charAt((obj.name.length) - 1);
			document.frmSelectSchool.selectedSchoolID.value = obj.options[obj.selectedIndex].value
			document.frmSelectSchool.selectedSchoolName.value = obj.options[obj.selectedIndex].text
			document.frmSelectSchool.submit();
		}
	}