function test(box)   {

	var uiltitle = box.value.split("|");

	var id1 = uiltitle[0].substr(1,3);
	var id2 = uiltitle[0].substr(4,1);
	var id3 = uiltitle[0].substr(5);



	if (box.checked)    // the box is checked initially
	{
		if (opener.document.formSel.comp1.value.length < 1) // if first parm
		{
			opener.document.formSel.esel1.value = id1 + "-" + id2 + "-" + id3;
			opener.document.formSel.comp1.value = uiltitle[1] ;
			if (uiltitle[2].length > 0 ) opener.document.formSel.comp1.value=opener.document.formSel.comp1.value + "/" + uiltitle[2];
			opener.document.formSel.title1.value = uiltitle[3];
			opener.document.formSel.gr1.value = uiltitle[4];
			opener.document.formSel.mvmt.value = uiltitle[5];


		if (opener.document.formSel.evt.options[opener.document.formSel.evt.selectedIndex].value.substr(0,3) != id1) {
				//alert("changed");
				for ( i=0; i< opener.document.formSel.evt.options.length; i++) {
						if (opener.document.formSel.evt.options[i].value.substr(0,3) == id1) {
							opener.document.formSel.evt.selectedIndex = i;
							var jim = String(opener.document.formSel.evt.options[i].value).split(":");
							//alert(jim.length);
							opener.document.formSel.orgevent.value = jim[0];
							opener.document.formSel.categ.value = jim[1];

						}
				} // for loop
			} // if changed



		}
		else // if subsequent parm

		{

			if (opener.document.formSel.comp2){
		if (opener.document.formSel.comp2.value.length < 1) {
			opener.document.formSel.esel2.value = id1 + "-" + id2 + "-" + id3;
			opener.document.formSel.comp2.value = uiltitle[1] ;
			if (uiltitle[2].length > 0 ) opener.document.formSel.comp2.value=opener.document.formSel.comp2.value + "/" + uiltitle[2];
			opener.document.formSel.title2.value = uiltitle[3];
			opener.document.formSel.gr2.value = uiltitle[4];

			} else
			{
			opener.document.formSel.esel3.value = id1 + "-" + id2 + "-" + id3;
			opener.document.formSel.comp3.value = uiltitle[1] ;
			if (uiltitle[2].length > 0 ) opener.document.formSel.comp3.value=opener.document.formSel.comp3.value + "/" + uiltitle[2];
			opener.document.formSel.title3.value = uiltitle[3];
			opener.document.formSel.gr3.value = uiltitle[4];


			} }  }
	}
	else    // if the box is unchecked later
	{

		opener.document.formSel.esel1.value = "";
		opener.document.formSel.title1.value = "";
		opener.document.formSel.comp1.value = "" ;
		opener.document.formSel.gr1.value = "";
		opener.document.formSel.mvmt.value = "" ;


	}
}

function getTitles(gr,ev) {

	var gra = gr.options[gr.selectedIndex].value;
	var eve = ev.options[ev.selectedIndex].value;
	var URL = "pml.asp?eve=" + eve +  "&gr1=" + gra ;
	//alert(URL);

	location.href= URL;

}
function getTitlesS(gr,ev) {

	var gra = gr.options[gr.selectedIndex].value;
	var eve = ev.options[ev.selectedIndex].value;
	var URL = "pmlbs.asp?eve=" + eve +  "&gr1=" + gra ;
	//alert(URL);

	location.href= URL;

}

function getTitlesb(gr,ev) {

	var gra = gr.options[gr.selectedIndex].value;
	var eve = ev.options[ev.selectedIndex].value;
	var URL = "pmlb.asp?eve=" + eve +  "&gr1=" + gra ;
	//alert(URL);

	location.href= URL;
}
function setgrade() {
	document.formSel.grsel1.selectedIndex = 0;
}

function setimage(name) {
	document.teachname.src = "../newnav/" + name + ".gif";
}



function setEvent() {
	for ( i=0; i<document.formSel.orgevent.options.length; i++) {
			//alert( document.formLib.hidCat.value );
			if (document.formSel.orgevent.options[i].value == document.formSel.hidOrg.value) {
				document.formSel.orgevent.selectedIndex = i;
			}
		}
}
function setGr1() {
	for ( i=0; i<document.formSel.grsel1.options.length; i++) {
			//alert( document.formLib.hidCat.value );
			if (document.formSel.grsel1.options[i].value == document.formSel.hidgr1.value) {
				document.formSel.grsel1.selectedIndex = i;
			}
		}
}
function checkcheck(box) {
	if (box.checked) alert (box.value);


}
function test4(box)   {

	var uiltitle = box.value.split("|");

	var id1 = uiltitle[0].substr(1,3);
	var id2 = uiltitle[0].substr(4,1);
	var id3 = uiltitle[0].substr(5);



	if (box.checked)    // the box is checked initially
	{
		if (opener.document.formSel.comp1.value.length < 1) // if first parm
		{
			opener.document.formSel.esel1.value = id1 + "-" + id2 + "-" + id3;
			opener.document.formSel.comp1.value = uiltitle[1] ;
			if (uiltitle[2].length > 0 ) opener.document.formSel.comp1.value=opener.document.formSel.comp1.value + "/" + uiltitle[2];
			opener.document.formSel.title1.value = uiltitle[3] + " " + uiltitle[5];
			opener.document.formSel.gr1.value = uiltitle[4];
			if (id1 == "921") opener.document.formSel.fors1[0].checked = true;

		}
		else // if subsequent parm

		{

			if (opener.document.formSel.comp2){
		if (opener.document.formSel.comp2.value.length < 1) {
			opener.document.formSel.esel2.value = id1 + "-" + id2 + "-" + id3;
			opener.document.formSel.comp2.value = uiltitle[1] ;
			if (uiltitle[2].length > 0 ) opener.document.formSel.comp2.value=opener.document.formSel.comp2.value + "/" + uiltitle[2];
			opener.document.formSel.title2.value = uiltitle[3] + " " + uiltitle[5];
			opener.document.formSel.gr2.value = uiltitle[4];
			if (id1 == "921") opener.document.formSel.fors2[0].checked = true;

			} else
			{
			opener.document.formSel.esel3.value = id1 + "-" + id2 + "-" + id3;
			opener.document.formSel.comp3.value = uiltitle[1] ;
			if (uiltitle[2].length > 0 ) opener.document.formSel.comp3.value=opener.document.formSel.comp3.value + "/" + uiltitle[2];
			opener.document.formSel.title3.value = uiltitle[3] + " " + uiltitle[5];
			opener.document.formSel.gr3.value = uiltitle[4];
			if (id1 == "921") opener.document.formSel.fors3[0].checked = true;


			} }  }
	}
	else    // if the box is unchecked later
	{
		if (opener.document.formSel.comp1.value.lastIndexOf(",") == -1) // if only one parm
		{

			var strRE = new RegExp(box.value);
			var data = opener.document.formSel.esel1.value;
			var newdata = data.replace(strRE, "");
			opener.document.formSel.esel1.value = newdata;

		}
		else     //  if more than one parm
		{


			var data = opener.document.formSel.esel1.value;
			if  (opener.document.formSel.esel1.value.indexOf(box.value) == 0) var strRE = new RegExp(box.value + ",");
			else var strRE = new RegExp("," + box.value);
			var newdata = data.replace(strRE, "");
			opener.document.formSel.esel1.value = newdata;

		}
	}
}