var FormName = "MyForm";
var initSubLine = "---";
var myArray = new Array();

myArray[1] = new Array();
myArray[1][0] = "- no subcategories|389";

myArray[2] = new Array();
myArray[2][0] = "- optional subcategory|0";
myArray[2][1] = "High School Art|502";
myArray[2][2] = "Middle School Art|503";

myArray[3] = new Array();
myArray[3][0] = "- optional subcategory|0";
myArray[3][1] = "Business and Personal Finance|512";
myArray[3][2] = "Business Law|392";
myArray[3][3] = "Business Management|393";
myArray[3][4] = "Business Mathematics|394";
myArray[3][5] = "Introduction to Business|395";

myArray[4] = new Array();
myArray[4][0] = "- no subcategories|396";

myArray[5] = new Array();
myArray[5][0] ="- optional subcategory|0";
myArray[5][1]="Computer Concepts|397";
myArray[5][2]="Databases|398";
myArray[5][3]="Desktop Publishing|399";
myArray[5][4]="Internet|400";
myArray[5][5]="Multimedia|401";
myArray[5][6]="Networking|402";
myArray[5][7]="Office Suites|403";
myArray[5][8]="Operating Systems|404";
myArray[5][9]="Presentation Tools|405";
myArray[5][10]="Programming|406";
myArray[5][11]="Spreadsheets|407";
myArray[5][12]="Web Design|408";
myArray[5][13]="Word Processing|409";

myArray[6] = new Array();
myArray[6][0] = "- no subcategories|410";

myArray[7] = new Array();
myArray[7][0] ="- optional subcategory|0";
myArray[7][1]="Child Care|411";
myArray[7][2]="Child Development/Parenting|412";
myArray[7][3]="Clothing/Fashion|413";
myArray[7][4]="Comprehensive|414";
myArray[7][5]="Family Living|494";
myArray[7][6]="Food Service|415";
myArray[7][7]="Foods & Nutrition|513";
myArray[7][8]="Housing/Consumer Education|417";
myArray[7][9]="Independent Living|418";

myArray[8] = new Array();
myArray[8][0] ="- optional subcategory|0";
myArray[8][1]="Fitness|419";
myArray[8][2]="High School Health|499";
myArray[8][3]="Middle School Health|500";

myArray[21] = new Array();
myArray[21][0] = "- no subcategories|475";

myArray[9] = new Array();
myArray[9][0] ="- optional subcategory|0";
myArray[9][1]="Keyboarding|422";
myArray[9][2]="Office Technology|498";

myArray[10] = new Array();
myArray[10][0] ="- optional subcategory|0";
myArray[10][1]="Debate|423";
myArray[10][2]="Grammar & Composition|514";
myArray[10][3]="Journalism|425";
myArray[10][4]="Media|426";
myArray[10][5]="Speech & Communication|515";
myArray[10][6]="Theater Arts|428";
myArray[10][7]="Vocabulary|429";
myArray[10][8]="Writing & Composition|516";

myArray[11] = new Array();
myArray[11][0] ="- optional subcategory|0";
myArray[11][1]="Additional Literature Titles|431";
myArray[11][2]="Ethnic Anthologies|432";
myArray[11][3]="Glencoe Literature: The Reader's Choice|433";
myArray[11][4]="Literature Libraries|487";
myArray[11][5]="The Glencoe Readers|434";

myArray[12] = new Array();
myArray[12][0] ="- optional subcategory|0";
myArray[12][1]=" Entrepreneurship|435";
myArray[12][2]=" Marketing|436";

myArray[13] = new Array();
myArray[13][0] ="- optional subcategory|0";
myArray[13][1]="Algebra 1 & 2|437";
myArray[13][2]="Geometry|438";
myArray[13][3]="Integrated Mathematics|439";
myArray[13][4]="Intervention|440";
myArray[13][5]="Middle School|488";
myArray[13][6]="Middle School Reform|443";
myArray[13][7]="Pre-Algebra|444";
myArray[13][8]="Precalculus & Advanced Math|517";

myArray[14] = new Array();
myArray[14][0] ="- optional subcategory|0";
myArray[14][1]=" Choral|489";
myArray[14][2]=" General|490";

myArray[15] = new Array();
myArray[15][0] ="- optional subcategory|0";
myArray[15][1]="College Reading & Study Skills|501";
myArray[15][2]="Content-Area Reading|496";
myArray[15][3]="ELL|449";
myArray[15][4]="Mathematics|450";
myArray[15][5]="Reading Fiction|451";
myArray[15][6]="Reading Nonfiction|453";
myArray[15][7]="Reading Rate & Fluency|518";
myArray[15][8]="Reading Skills & Strategies|519";

myArray[16] = new Array();
myArray[16][0] ="- optional subcategory|0";
myArray[16][1]="Biology|457";
myArray[16][2]="Chemistry|458";
myArray[16][3]="Earth Science|459";
myArray[16][4]="Middle School: 15-Book Series|520";
myArray[16][5]="Middle School: Integrated|521";
myArray[16][6]="Middle School: Life, Earth, Physical|522";
myArray[16][7]="Physical Science|509";
myArray[16][8]="Physics|462";

myArray[17] = new Array();
myArray[17][0] ="- optional subcategory|0";
myArray[17][1]="Economics|463";
myArray[17][2]="Geography|464";
myArray[17][3]="Government & Civics|523";
myArray[17][4]="Law-Related Education|466";
myArray[17][5]="Psychology|467";
myArray[17][6]="Sociology|468";
myArray[17][7]="United States History|469";
myArray[17][8]="World History|471";

myArray[18] = new Array();
myArray[18][0] = "- no subcategories|473";

myArray[19] = new Array();
myArray[19][0] ="- optional subcategory|0";
myArray[19][1]="Automotive Technologies|491";
myArray[19][2]="Construction & Woodworking Technologies|524";
myArray[19][3]="Drafting & Design Technologies|525";
myArray[19][4]="Manufacturing Technologies|476";

myArray[20] = new Array();
myArray[20][0] ="- optional subcategory|0";
myArray[20][1]="Exploratory|479";
myArray[20][2]="French|480";
myArray[20][3]="French Readers|510";
myArray[20][4]="German Readers|526";
myArray[20][5]="Italian|481";
myArray[20][6]="Japanese|482";
myArray[20][7]="Latin|483";
myArray[20][8]="Russian|484";
myArray[20][9]="Spanish|485";
myArray[20][10]="Spanish Readers|511";

function Initialize() {
	eval('document.' + FormName + '.reset()');
	eval('document.' + FormName + '.secondary.options.length = 0');
	eval('document.' + FormName + '.secondary.options[0] = new Option(initSubLine,"")');
} 

function MakeSecondary(mySel) {
	var v = new String();
	var plen = 0;
	eval('plen = document.' + FormName + '.primary.length');
	for(var i = 0; i < plen; i++) {
		var theone = false;
		eval('theone = document.' + FormName + '.primary.options[i].selected');
		if(theone == true) {
			eval('v = document.' + FormName + '.primary.options[i].value');
			i = plen;
			//alert("i= "+i)
		}
	}

// 	The following method of removing non-alphanumerics is used 
//  instead of regular expressions, to accomodate IE/Mac.
	var vlen = v.length;
	var ts = new String();
	for(var vi = 0; vi < vlen; vi++) {
		var vs = v.substr(vi,1);
		if((vs >= 'A' && vs <= 'Z') || (vs >= 'a' && vs <= 'z') || (vs >= '0' && vs <= '9')) {
			ts += vs;
		}
	}
	v = ts;
	var Splitter = "|";
	if(v.length < 1) { Initialize(); return; }
	//var arrayLength = eval(v + "Array.length");
	var arrayLength = eval("myArray["+v+"].length");
	eval('document.' + FormName + '.secondary.options.length = 0');
	for(var i = 0; i < arrayLength; i++ ) {
		var iArray = new Array();
		eval("iArray = " + "myArray["+v+"][i].split(Splitter)");
		if(iArray.length < 2) { iArray[1] = ""; }
		eval('document.' + FormName + '.secondary.options[i] = new Option(iArray[0],iArray[1])');
	}
} // function MakeSecondary()

function open_glen2(mytype,mytext) {
	myurl="http://www.glencoe.com/catalog/index.php/catalog?c=1675&v=13?searchType="+mytype+"&searchString="+mytext+"&displayImages=yes"
	
	if (mytext!='') {openWin(myurl,'glen')} else {alert('Please enter text to search')}	
}

function open_glen(prim,sec) {
	//if (sec!=0) {area='subject?'; second="&s="+sec} else {area='catalog?'; second=''}

	//myurl="http://www.glencoe.com/catalog/index.php/" + area
	myurl = "http://www.glencoe.com/catalog/";
	
	if (prim!='') {openWin(myurl,'glen')} else {alert('Please select a discipline')}	
}