//  Modified 10/21/2009
    function RemoveIt(aName, anId, aListName) {
        // Get List values
        selValues = jQuery('#boxset1').val()
        //  Add trailing comma and leading comma
        selValues = ',' + selValues + ","
        //alert(selValues)

        //	Reset the original back to black    //	Color the clicked text normal
        jQuery("#sp_" + anId).removeClass("list_selected");

        //  Remove from boxset
        if (selValues.indexOf(anId) > 0) { selValues = selValues.replace(',' + anId + ',', ',') }

        //  Hide value
        jQuery('#rem_' + anId).hide();

        if (selValues == ',,') { selValues = '' }

        //  Remove trailing comma
        if (selValues.substring(selValues.length - 1, selValues.length) == ",") {selValues = selValues.substring(0, selValues.length - 1)}
        //  Remove leading comma
        if (selValues.substring(0, 1) == ",") { selValues = selValues.substring(1, selValues.length) }

        //  Populate the box
        jQuery('#boxset1').val(selValues)
        //window.status = selValues
        //alert(selValues)
    }

    function addIt(aName, oName, anId, aSrc) {
        selValues = jQuery('#boxset1').val()
        item_full_id = 'rem_' + anId
        //   what was clicked
        jQuery("#sp_" + anId).addClass("list_selected");
        strRemove = "<img class=\"remove_button\" onclick=\"RemoveIt('" + aName + "','" + anId + "');\" src=\"images/buttons/remove.gif\"/>";
        thisDiv = "<div class=\"sel_list_item\" title='" + oName + "' id=\"rem_" + anId + "\">" + strRemove + " " + aName + "</div>";

        //  Does the element already exists?
        if ($('#rem_' + anId).length == 0) {
            //  Add the button and the name to the list
            jQuery('#selectedList').html(jQuery('#selectedList').html() + thisDiv);
            strRemove + " " + aName +
            //	Add the area id to the Form output
                jQuery('#boxset1').val(jQuery('#boxset1').val() + ',' + anId);
        }
        else {
            $('#rem_' + anId).show();
            // Add it if does not exist
            if (selValues.indexOf(item_full_id) == -1) {
                jQuery('#boxset1').val(jQuery('#boxset1').val() + ',' + anId);
            }
        }
    }

    function addItCampus3(aName, oName, anId, aSrc) {
        selValues = jQuery('#boxset1').val()
        strRemove = "<img class=\"remove_button\" onclick=\"RemoveIt('" + aName + "','" + anId + "');\" src=\"images/buttons/remove.gif\"/>";
        thisDiv = "<div class=\"sel_list_item\" title='" + oName + "' id=\"rem_" + anId + "\">" + strRemove + " " + aName + "</div>";

        //	Color the clicked text Gray
        jQuery("#sp_" + anId).addClass("list_selected");

        //  Does the element already exists?
        if ($('#rem_' + anId).length == 0) {
            //  Add the button and the name to the list
            jQuery('#selectedList').html(jQuery('#selectedList').html() + thisDiv);
            strRemove + " " + aName +
            //	Add the area id to the Form output
            jQuery('#boxset1').val(jQuery('#boxset1').val() + ',' + anId);
        }

/*
        //	Color the clicked text Gray
        $(aSrc).setStyle({ color: 'gray' });
        if ($('selectedList').immediateDescendants().size() < 10) {
            //	make Sure item is not already in the list
            if ($('rem_' + anId) == null) {
                //	Remove Button
                strRemove = '<img style="cursor: pointer;position: relative;top: 4px;" onclick="javascript:removeIt2(\'' + aName + '\',\'' + anId + '\',\'selectedList\');" src="images/buttons/remove.gif">';
                new Insertion.Bottom('selectedList', '<div class="sel_list_item" title="' + oName + '" id="rem_' + anId + '">' + strRemove + ' ' + aName + '</div>');

                //	Add the area id to the Form output
                var boxset = $F('boxset1').split(',').without(''); // push is not a prototype.js method & doesn't return the array, otherwise the three lines could be combined into one
                boxset.push(anId);
                $('boxset1').value = boxset.uniq().join(',');
            }
        } else {
            alert('Only 10 schools can be searched at one time!');
        }
*/        
    }


    function addZip(aName, oName, anId, aSrc) {
        selValues = jQuery('#boxset1').val()
        item_full_id = 'rem_' + anId
        //   what was clicked
        jQuery("#sp_" + anId).addClass("list_selected");
        strRemove = "<img class=\"remove_button\" onclick=\"RemoveIt('" + aName + "','" + anId + "');\" src=\"images/buttons/remove.gif\"/>";
        thisDiv = "<div class=\"sel_list_item\" title='" + oName + "' id=\"rem_" + anId + "\">" + strRemove + " " + aName + "</div>";

        //  Does the element already exists?
        if ($('#rem_' + anId).length == 0) {
            //  Add the button and the name to the list
            jQuery('#selectedList').html(jQuery('#selectedList').html() + thisDiv);
            strRemove + " " + aName +
            //	Add the area id to the Form output
                jQuery('#boxset1').val(jQuery('#boxset1').val() + ',' + anId);
        }
        else {
            $('#rem_' + anId).show();
            // Add it if does not exist
            if (selValues.indexOf(item_full_id) == -1) {
                jQuery('#boxset1').val(jQuery('#boxset1').val() + ',' + anId);
            }
        }
    }


//  End Modified 10/21/2009

/*
    function addIt(aName, oName, anId, aSrc) {
        myControl = document.getElementById("selectedList");
        curList = myControl.innerHTML


        //	Remove Style tags from name if they exist
        aName = aName.replace('<font color=gray>', '')
        aName = aName.replace('</font>', '')

        //	Color the clicked text Gray
        //	Get the Source Contents
        srcContents = aSrc.innerHTML;
        aSrc.innerHTML = "<font color=gray>" + srcContents + "</font>"

        //	make Sure item is not already in the list
        var iSpanExists = curList.indexOf('id=rem_' + anId)
        var intExists = curList.indexOf("'" + anId + "'")

        if (intExists < 0) {
            //	Remove Button
            strRemove = "<IMG style=\"cursor: pointer;position: relative;top: 4px;\" language=\"javascript\" onclick=\"removeIt('" + aName + "','" + anId + "');\" src=\"images/buttons/remove.gif\">";

            //	Add the area id to the Form output
            curDetail = document.getElementById("boxset1").value;
            document.getElementById("boxset1").value = curDetail + ',' + anId;

            //	Add the Current on to the list
            if (iSpanExists > 0) {
                myAreaSpan = document.getElementById("rem_" + anId);
                myAreaSpan.innerHTML = curList + strRemove + " " + aName + "</div>";
            }
            else {
                myControl.innerHTML = curList + "<div class='sel_list_item' title='" + oName + "' id=\"rem_" + anId + "\">" + strRemove + " " + aName + "</div>";
                //	Update the map
                search_by = document.getElementById("search_by").value
                if (search_by == 1 || search_by == 0 || search_by == 4 || search_by == 3) {
                    var img = document.getElementById("map")
                    var mySrc = img.src
                    //	Strip past the =
                    mySrc = mySrc.substr(0, mySrc.indexOf('=') + 1);
                    img.src = mySrc + '0' + document.getElementById("boxset1").value;
                }
            }
        }

    }


    function removeIt(aName, anId, aListName) {
        myControl = document.getElementById("selectedList");
        curList = myControl.innerHTML

        //	Reset the original back to black
        //	Color the clicked text normal
        OrigControl = document.getElementById("sp_" + anId)
        if (OrigControl != null) {
            OrigContents = OrigControl.innerHTML
            OrigContents = OrigContents.replace('<FONT color=gray>', '')
            OrigContents = OrigContents.replace('</FONT>', '')
            OrigControl.innerHTML = OrigContents
        }

        //	Get the Source Contents (removed item)
        srcControl = document.getElementById("rem_" + anId)
        srcControl.innerHTML = aName;

        //	get the main Div (list of items)
        myControl = document.getElementById("selectedList");

        // Remove from the list  (delete content of the div)
        //	make Sure item is already in the list
        var iSpanExists = curList.indexOf("rem_" + anId)
        if (iSpanExists > 0) {
            //	delete the div
            myControl.removeChild(srcControl);
        }


        //	Rebuild the list (TODO***** need to remove the div)
        curList = myControl.innerHTML
        myControl.innerHTML = curList

        //	Remove it from the Current list that get passed to next page
        selVal = document.getElementById("boxset1").value;
        //	Add extra comma for first position
        selVal = ',,' + selVal + ','
        var iV = selVal.indexOf(',' + anId + ',')
        if (iV > 0) {
            selVal = selVal.replace(',' + anId + ',', ',');
            //	Strip away the leading and trailing comma
            while (selVal.charAt(0) == ',') { selVal = selVal.slice(1, selVal.length); }
            while (selVal.charAt(selVal.length - 1) == ',') { selVal = selVal.slice(0, selVal.length - 1); }
            document.getElementById("boxset1").value = selVal;
        }

        itemCount = parseInt(document.getElementById("itemCount").value)
        if (itemCount == 11) { itemCount = 10; }
        itemCount = itemCount - 1
        document.getElementById("itemCount").value = itemCount

        //	Update the map
        search_by = document.getElementById("search_by").value
        if (search_by == 1 || search_by == 0 || search_by == 4 || search_by == 3) {
            if (search_by == 1 || search_by == 0) { mapName = 'homecityarea.asp?Area_ID='; }
            if (search_by == 3) { mapName = 'Schooldistrict.asp?SchoolDistricts='; }
            if (search_by == 4) { mapName = 'zipcode.asp?Zipcodes='; }
            var img = document.getElementById("map")
            img.src = 'http://207.200.31.117/Austin/' + mapName + '0' + document.getElementById("boxset1").value;
        }



    }

*/
    function addItCampus2(aName, oName, anId, aSrc) {
			//	Color the clicked text Gray
		    $(aSrc).setStyle( {color: 'gray'} );
		    if ( $('selectedList').immediateDescendants().size() < 10 ) {
			    //	make Sure item is not already in the list
		        if ( $('rem_' + anId) == null ) {
				    //	Remove Button
				    strRemove = '<img style="cursor: pointer;position: relative;top: 4px;" onclick="javascript:removeIt2(\'' + aName + '\',\'' + anId + '\',\'selectedList\');" src="images/buttons/remove.gif">';
		            new Insertion.Bottom('selectedList', '<div class="sel_list_item" title="' + oName + '" id="rem_' + anId + '">' + strRemove + ' ' + aName + '</div>');

				    //	Add the area id to the Form output
				    var boxset = $F('boxset1').split(',').without(''); // push is not a prototype.js method & doesn't return the array, otherwise the three lines could be combined into one
				    boxset.push( anId );
                    $('boxset1').value = boxset.uniq().join(','); 
		        }
		    } else {
		        alert('Only 10 schools can be searched at one time!');
		    }
		}
		
		function addItCampus(aName, oName, anId, aSrc){

			myControl = document.getElementById("selectedList"); 
			curList = myControl.innerHTML

			//	Remove Style tags from name if they exist
			aName = aName.replace('<font color=gray>','')
			aName = aName.replace('</font>','')

			//	Color the clicked text Gray
			//	Get the Source Contents
			srcContents = aSrc.innerHTML;
			aSrc.innerHTML = "<font color=gray>" + srcContents + "</font>"

			//	make Sure item is not already in the list
			var iSpanExists = curList.indexOf('id=rem_' + anId)
			//	See if it exists with the different spans or class
			//if (iSpanExists == -1) {iSpanExists = curList.indexOf('<div class=sf_listitems id=rem_' + anId)}

			var intExists = curList.indexOf("'" + anId + "'")

			
			if (intExists < 0) {

				itemCount = parseInt(document.getElementById("itemCount").value) + 1
				document.getElementById("itemCount").value = itemCount	

				if (itemCount > 10) {alert('Only 10 schools can be searched at one time!');return; }

				//	Remove Button
				strRemove = "<IMG style=\"cursor: pointer;position: relative;top: 4px;\" language=\"javascript\" onclick=\"RemoveIt('" + aName + "','" + anId + "','selectedList');\" src=\"images/buttons/remove.gif\">";

				//	Add the area id to the Form output
				curDetail = document.getElementById("boxset1").value;
				document.getElementById("boxset1").value = curDetail + ',' + anId;

				if (iSpanExists > 0) {
						//	Span Already exists
						myAreaSpan = document.getElementById("rem_" + anId); 
						myAreaSpan.innerHTML = curList  + strRemove  + aName + "</div>";
					}
				else {myControl.innerHTML = curList + "<div class='sel_list_item' title='" + oName + "' id=\"rem_" + anId + "\">" + strRemove + " "  + aName + "</div>";}

			}

	}

	function addCampusSuggestion(){
		myControl = document.getElementById("selectedList"); 
		curList = myControl.innerHTML
	
		var aName = document.getElementById('suggest_field_hidden_name').value
		var anId = document.getElementById('suggest_field_hidden').value
		
		//	Make sure a valid item is used
		if (aName.length == 0) {alert("Please select a valid item from the list!"); return }

		ShowYellowButton();
		
		//	make Sure item is not already in the list
		var iSpanExists = curList.indexOf('id=rem_' + anId)
		var intExists = curList.indexOf("'" + anId + "'")

		//  Clear the suggest_field
		jQuery('#suggest_field').val('');

		if (intExists < 0) {
				itemCount = parseInt(document.getElementById("itemCount").value) + 1
				document.getElementById("itemCount").value = itemCount	

				if (itemCount > 10) {alert('only 10 schools can be searched at one time!');return; }

				//	Remove Button
				strRemove = "<IMG style=\"cursor: pointer;position: relative;top: 4px;\" language=\"javascript\" onclick=\"RemoveIt('" + aName + "','" + anId + "','selectedList');\" src=\"images/buttons/remove.gif\">";

				//	Add the area id to the Form output
				curDetail = document.getElementById("boxset1").value;
				document.getElementById("boxset1").value = curDetail + ',' + anId;


			//	Add the Current on to the list
				if (iSpanExists > 0) {
						//	Span Already exists
						myAreaSpan = document.getElementById("rem_" + anId); 
						myAreaSpan.innerHTML = curList  + strRemove  + aName + "</div>";
					}
				else {myControl.innerHTML = curList + "<div class='sel_list_item' title='" + aName + "' id=\"rem_" + anId + "\">" + strRemove + " "  + aName.substring(0,15) + "</div>";}

			}
	}


function schoolSetSearchBySub (aSearchBySub) {
	location.href='home_search_form.asp?search_by=8&search_by_sub=' + aSearchBySub;
}

function schoolSetSearchBySubDetail (aPropType, aSearchBySub, aSearchBySubDetail) {
	location.href='prop_search_form.asp?pt=' + aPropType + '&search_by=8&search_by_sub=' + aSearchBySub + '&search_by_sub_detail=' + aSearchBySubDetail;
}

function schoolSetSearchBySubDetailDemo (aPropType, aSearchBySub, aSearchBySubDetail) {
	location.href='demo_search_form.asp?pt=' + aPropType + '&search_by=8&search_by_sub=' + aSearchBySub + '&search_by_sub_detail=' + aSearchBySubDetail;
}


	function ShowYellowButton() { var btn=document.getElementById("search-button");	btn.className = "btn_yellow";}	
//	function ShowYellowButton() { var btn=document.getElementById("search-button");	btn.background = "transparent url(images/button_yellow_flat.gif) no-repeat";}	
//	function ShowYellowButton() {var btn=document.getElementById("show-search-results");	btn.src = "images/buttons/search-yellow.gif";}	


	function clearForm(sType) {
		document.getElementById("selectedList").innerHTML=""; 
		document.getElementById("boxset1").value=""
		search_by = document.getElementById("search_by").value
		var url = "prop_search_form.asp?x=0&pt=" + sType + "&clear=true&search_by=" + search_by;
		location.href=url

		//if (sType == 'home') {location.href="home_search_form.asp?clear=true&search_by=" + search_by;}
		//if (sType == 'lease') {location.href="lease_search_form.asp?clear=true&search_by=" + search_by;}
		//if (sType == 'lot') {location.href="lot_search_form.asp?clear=true&search_by=" + search_by;}
		
	}
	function switchSearchBy(sType) {
		var iSelected = document.form1.area_type.options[document.form1.area_type.selectedIndex].value;
		//alert(iSelected)
		location.href = 'prop_search_form.asp?pt=' + sType + '&search_by=' + iSelected;
		
	}

	function switchSearchByMod(sType, sModify, sHSID) {
		var iSelected = document.form1.area_type.options[document.form1.area_type.selectedIndex].value;

		var url = 'prop_search_form.asp?pt=' + sType + '&search_by='+ iSelected;
		if (sModify != '') { url += '&modify=' + sModify + '&modby=1'; }
		if (sHSID != '') { url += '&search_id=' + sHSID; }

		//alert(url)
		location.href = url
//		location.href = 'prop_search_form.asp?pt=' + sType 
//		    + '&search_by='+ iSelected 
//		    + sModify != '' ? '&modify=' + sModify : ''
//		    + sHSID != '' ? '&Search_ID=' + sHSID : '';
		
	}

	function addSuggestion(){
		myControl = document.getElementById("selectedList"); 
		curList = myControl.innerHTML
	
		var aName = document.getElementById('suggest_field_hidden_name').value
		var anId = document.getElementById('suggest_field_hidden').value
		
		//	Make sure a valid item is used
		if (aName.length == 0) {alert("Please select a valid item from the list!"); return }

		ShowYellowButton();
		
		//	make Sure item is not already in the list
		var iSpanExists = curList.indexOf('<span id=rem_' + anId)
		var intExists = curList.indexOf('.gif"> ' + aName)
		if (intExists < 0) {
			//	Remove Button
			strRemove = "<IMG language=\"javascript\" onclick=\"RemoveIt('" + aName + "','" + anId + "');\" src=\"images/buttons/remove.gif\">";

			//	Add the area id to the Form output
			curDetail = document.getElementById("boxset1").value;
			document.getElementById("boxset1").value = curDetail + ',' + anId;

			//	Add the Current on to the list
			//myControl.innerHTML = curList + "<BR>" + strRemove + " " + aName;
			if (iSpanExists > 0) {
					myAreaSpan = document.getElementById("rem_" + anId); 
					myAreaSpan.innerHTML = curList + "<BR>" + strRemove + " "  + aName + "</span>";
				}
			else {myControl.innerHTML = curList + "<span title='" + aName + "' id=\"rem_" + anId + "\"><BR>" + strRemove + " "  + aName + "</span>";}

			}				
	}

	function addItZip(aName, oName, anId, aSrc) {
	    myControl = document.getElementById("selectedList");
	    curList = myControl.innerHTML

	    //  Add the marker
	    addZip(anId);

	    //	Remove Style tags from name if they exist
	    aName = aName.replace('<font color=gray>', '')
	    aName = aName.replace('</font>', '')

	    //	Color the clicked text Gray
	    //	Get the Source Contents
	    srcContents = aSrc.innerHTML;
	    aSrc.innerHTML = "<font color=gray>" + srcContents + "</font>"

	    //	make Sure item is not already in the list
	    var iSpanExists = curList.indexOf('id=rem_' + anId)
	    var intExists = curList.indexOf("'" + anId + "'")

	    
	    if (intExists < 0) {
	        //	Remove Button
	        strRemove = "<IMG style=\"cursor: pointer;position: relative;top: 4px;\" language=\"javascript\" onclick=\"removeItdd('" + aName + "','" + anId + "');\" src=\"images/buttons/remove.gif\">";

	        //	Add the area id to the Form output
	        curDetail = document.getElementById("boxset1").value;
	        document.getElementById("boxset1").value = curDetail + ',' + anId;

	        //	Add the Current on to the list
	        if (iSpanExists > 0) {
	            myAreaSpan = document.getElementById("rem_" + anId);
	            myAreaSpan.innerHTML = curList + strRemove + " " + aName + "</div>";
	        }
	        else {
	            myControl.innerHTML = curList + "<div class='sel_list_item' title='" + oName + "' id=\"rem_" + anId + "\">" + strRemove + " " + aName + "</div>";
	            //	Update the map
	            search_by = document.getElementById("search_by").value
	            if (search_by == 1 || search_by == 0 || search_by == 4 || search_by == 3) {
	                var img = document.getElementById("map")
	                var mySrc = img.src
	                //	Strip past the =
	                mySrc = mySrc.substr(0, mySrc.indexOf('=') + 1);
	                img.src = mySrc + '0' + document.getElementById("boxset1").value;
	            }
	        }
	    }

	}



	function addIt_old(aName, oName, anId, aSrc){
		myControl = document.getElementById("selectedList"); 
		curList = myControl.innerHTML

		//	Remove Style tags from name if they exist
		aName = aName.replace('<font color=gray>','')
		aName = aName.replace('</font>','')
		
		//	Color the clicked text Gray
		//	Get the Source Contents
		srcContents = aSrc.innerHTML;
		aSrc.innerHTML = "<font color=gray>" + srcContents + "</font>"
		
		//	make Sure item is not already in the list
		var iSpanExists = curList.indexOf('<span id=rem_' + anId)

		//	See if it exists with the different spans or class
		if (iSpanExists == -1) {iSpanExists = curList.indexOf('<span class=sf_listitems id=rem_' + anId)}
		if (iSpanExists == -1) {iSpanExists = curList.indexOf('<SPAN class=sf_listitems id=rem_' + anId)}
	
		var intExists = curList.indexOf('.gif"> ' + aName)
		if (intExists < 0) {
			//	Remove Button
			strRemove = "<IMG style=\"cursor: pointer;\" language=\"javascript\" onclick=\"RemoveIt('" + aName + "','" + anId + "');\" src=\"images/buttons/remove.gif\">";

			//	Add the area id to the Form output
			curDetail = document.getElementById("boxset1").value;
			document.getElementById("boxset1").value = curDetail + ',' + anId;

			//	Add the Current on to the list
			//myControl.innerHTML = curList + "<BR>" + strRemove + " " + aName;
			if (iSpanExists > 0) {
					myAreaSpan = document.getElementById("rem_" + anId); 
					myAreaSpan.innerHTML = curList + "<BR>" + strRemove + " "  + aName + "</span>";
				}
			else {myControl.innerHTML = curList + "<span title='" + oName + "' id=\"rem_" + anId + "\"><BR>" + strRemove + " "  + aName + "</span>";}

			}				

	}
	
	function removeIt2(aName, anId, aListName){
		//	Reset the original back to black
		//	Color the clicked text normal
	    $('sp_' + anId).setStyle( {color: 'black'} );

		// Remove from the list  (delete content of the div)
	    $('rem_' + anId).remove();
	    
		//	Remove it from the Current list that get passed to next page
	    $('boxset1').value = $F('boxset1').split(',').without( anId ).join(',');
	}

	
	function removeItdd(aName, anId, aListName) {
	    myControl = document.getElementById("selectedList");
	    curList = myControl.innerHTML

	    //	Reset the original back to black
	    //	Color the clicked text normal
	    OrigControl = document.getElementById("sp_" + anId)
	    if (OrigControl != null) {
	        OrigContents = OrigControl.innerHTML
	        OrigContents = OrigContents.replace('<FONT color=gray>', '')
	        OrigContents = OrigContents.replace('</FONT>', '')
	        OrigControl.innerHTML = OrigContents
	    }

	    //	Get the Source Contents (removed item)
	    srcControl = document.getElementById("rem_" + anId)
	    srcControl.innerHTML = aName;

	    //	get the main Div (list of items)
	    myControl = document.getElementById("selectedList");

	    // Remove from the list  (delete content of the div)
	    //	make Sure item is already in the list
	    var iSpanExists = curList.indexOf("rem_" + anId)
	    if (iSpanExists > 0) {
	        //	delete the div
	        myControl.removeChild(srcControl);
	    }

	    //	Rebuild the list (TODO***** need to remove the div)
	    curList = myControl.innerHTML
	    myControl.innerHTML = curList

	    //	Remove it from the Current list that get passed to next page
	    selVal = document.getElementById("boxset1").value;
	    //	Add extra comma for first position
	    selVal = ',,' + selVal + ','
	    var iV = selVal.indexOf(',' + anId + ',')
	    if (iV > 0) {
	        selVal = selVal.replace(',' + anId + ',', ',');
	        //	Strip away the leading and trailing comma
	        while (selVal.charAt(0) == ',') { selVal = selVal.slice(1, selVal.length); }
	        while (selVal.charAt(selVal.length - 1) == ',') { selVal = selVal.slice(0, selVal.length - 1); }
	        document.getElementById("boxset1").value = selVal;
	    }

	    itemCount = parseInt(document.getElementById("itemCount").value)
	    if (itemCount == 11) { itemCount = 10; }
	    itemCount = itemCount - 1
	    document.getElementById("itemCount").value = itemCount

	    //	Update the map
	    hideMarker(selVal);
	}

	
	

	
	/*
	function removeIt(aName, anId){
		myControl = document.getElementById("selectedList"); 
		curList = myControl.innerHTML

		//	Color the clicked text normal 	//	Get the Source Contents
		srcControl = document.getElementById("sp_" + anId)
		srcControl.innerHTML = aName;
		//srcControl.innerHTML = '&nbsp;' + aName;

		// Remove from the list
		//	make Sure item is already in the list
		var iSpanExists = curList.indexOf("rem_" + anId)
		if (iSpanExists > 0 ) {
			selControl = document.getElementById("rem_" + anId)
			selControl.innerHTML = "";
		}

		//	Remove it from the Current list that get passed to next page
		selVal = document.getElementById("boxset1").value; 
		//	Add extra comma for first position
		selVal = ',,' + selVal + ','
		var iV = selVal.indexOf(',' + anId + ',')
		if (iV > 0 ) {selVal = selVal.replace(',' + anId + ',', ',');
			//	Strip away the leading and trailing comma
			while (selVal.charAt(0) == ',') { selVal = selVal.slice(1,selVal.length);}
			while (selVal.charAt(selVal.length - 1) == ',') { selVal = selVal.slice(0,selVal.length -1);}
			document.getElementById("boxset1").value = selVal;
		}

	}
*/