//**********************************************************
//	matInfo.js has been moved into this file because safari browser had scope problems
//	the only way it will work is to hard code the name and type arrays in a function
//	and then call the function from within any function needing access
//
//	the array declaration etc at end of this file
//
//**********************************************************

function searchIt()
{
	if(!document.createRecipeDB.searchMats.value || document.createRecipeDB.searchMats.value == ' ' )
	{
		alert('Please enter all or part of a material name');
		document.createRecipeDB.searchMats.focus();
		return false;
	}
	var name = new Array();
	var type = new Array();
	name = n1();
	type = t1();
	
	document.createRecipeDB.materialList.options.length=0;
	sIt = document.createRecipeDB.searchMats.value;
	sIt.toLowerCase();
	
	optInd = 0;
	
	for(y=0;y<name.length;y++)
	{
		if(type[y] != 'xxx')
		{
			result = name[y].toLowerCase().indexOf(sIt);
			
			if(result != -1)
			{
					document.createRecipeDB.materialList.options[optInd] = new Option(name[y]);
				optInd++;
			}
		}
	}
	if(optInd == 0)
	{
		//material not found
		alert('Sorry, but your search entry could not be found. Please send the Material Name you are looking for to feedback@glazesimulator.com and we will add it to the database. Thank you.');
		loadTypes1('all','materialList','createRecipeDB');
	}
}

function popMaterial(selMat)
{
	if(selMat)
	{
		rr=escape(selMat);
		newwindow=window.open('showMaterial.php?material=' + rr,'MaterialInformation','height=350,top=200,left=200,width=490,scrollbars=yes');
		if (window.focus) 
		{
			newwindow.focus();
		}
	}
	return false;
}

function popColourDef(selCol)
{
	if(selCol)
	{
		rr=escape(selCol);
		newwindow=window.open('showColDef.php?col=' + rr,'ColorDefinition','height=360,top=200,left=200,width=265,scrollbars=yes');
		if (window.focus) 
		{
			newwindow.focus();
		}
	}
	return false;
}

function popitup(url) 
{
	
	if(url == 'helpRecWizard.php')
	{
		newwindow=window.open(url,'name','height=550,width=470,top=100,left=175,scrollbars=yes');
	}
	else if(url == 'showContact.php')
	{
		newwindow=window.open(url,'name','height=550,width=440,top=100,left=175,scrollbars=no,resizable=no');
	}
	else if(url == 'showColor.php')
	{
		newwindow=window.open(url,'name','height=560,width=450,top=100,left=175,scrollbars=no,resizable=no');
	}
	else if(url == 'support.php')
	{
		newwindow=window.open(url,'name','height=600,width=795,top=200,left=200,scrollbars=no,resizable=yes');
	}
	else if(url == 'showMatSearch.php')
	{
		newwindow=window.open(url,'name','height=600,width=350,top=100,left=200,scrollbars=no,resizable=yes');
	}
						
	if (window.focus) 
	{
		newwindow.focus();
	}
	
	return false;
}


function chkTerms()
{
	var name = new Array();
	var type = new Array();
	name = n1();
	type = t1();
	
	//make sure there is at least one material entered
	notAlone=0;
	needOne=0;
	var inFrit = 0;
	
	for(x=0;x<12;x++)
	{
		eval("mat=document.createRecipeDB.material"+x+".value;");
				
		for(y=0;y<name.length;y++)
		{	
			if(mat==name[y])
			{	
				//sometimes frits show up as fluxes and fool wont let the program proceed
				inFrit=0;
				inFrit = name[y].indexOf('Frit');
				if(inFrit != -1)
				{
					inFrit = 1;
				}
			
				if(type[y]=='Glass' || type[y]=='Colorant' || type[y]=='Opacifier')
				{
					notAlone=1;
				}
				else if(type[y]=='Feldspar' || type[y]=='Frit' || type[y]=='Ash' || type[y]=='Clay' || type[y]=='Clay/Feldspar' || inFrit)
				{               
					needOne=1;
				}
			}
		}		
	}
	
	if(notAlone && !needOne)
	{
		alert('A Flux, Colorant - Opacifier, or Glass can not be processed alone. Add at least one other material from another Material Category.');
		return false;
	}
		
	noShow=0;
	
	//make sure each material has an amount	
	for(x=0;x<12;x++)
	{
		eval("mat=document.createRecipeDB.material"+x+".value;");
		eval("amt=document.createRecipeDB.amount"+x+".value;");
		
		if(mat!='')
		{
			if(amt>0 && amt < 1000 && amt!='')
			{}
			else
			{
				alert('Each material must have a positive numeric amount less than 1000 entered');
				return false;
				break;
			}
		}
		else
		{
			noShow++;
		}
	}
	
	if(noShow==12)
	{
		alert('A recipe must have at least one entry');
		return false;
	}
	
	return true;
}

function chkForAdj()
{
	//make sure there is at least one material entered
	test=0;
	for(x=0;x<12;x++)
	{
		eval("mat=document.createRecipeDB.material"+x+".value;");
		eval("amt=document.createRecipeDB.amount"+x+".value;");
				
		if(mat!='')
		{
			test++;
		}
	}
	if(test<2)
	{
		alert('At least two materials and amounts must be entered');
		return false;
	}
	
	if(test==0)
	{
		alert('At least one material and amount must be entered');
		return false;
	}
	
	//make sure each material has an amount	
	for(x=0;x<12;x++)
	{
		eval("mat=document.createRecipeDB.material"+x+".value;");
		eval("amt=document.createRecipeDB.amount"+x+".value;");
		
		if(mat!='' && amt<=0)
		{
			alert('Each material must have a positive amount entered');
			return false;
			break;
		}
	}
	return true;
}


function showColourButton()
{

	document.getElementById("colDesc").style.visibility="visible";
	document.getElementById("colDesc1").style.visibility="visible";
}


function toggleGraphs(id)
{
	//document.getElementById("Layer1").style.visibility="hidden";
	document.getElementById("Layer2").style.visibility="hidden";
	document.getElementById("Layer3").style.visibility="hidden";
	document.getElementById("Layer4").style.visibility="hidden";
	//document.getElementById("Layer5").style.visibility="hidden";

	document.getElementById(id).style.visibility="visible";
	
}

function canvas(id,pos)
{

	document.getElementById('LayerP1').style.visibility="hidden";
	document.getElementById('LayerP2').style.visibility="hidden";
	document.getElementById('LayerP3').style.visibility="hidden";
	document.getElementById('LayerP4').style.visibility="hidden";
	document.getElementById('LayerP5').style.visibility="hidden";
	document.getElementById('LayerP6').style.visibility="hidden";
	document.getElementById('LayerP10').style.visibility="hidden";
	
	if(pos=='over')
	{
	//alert(document.createRecipeDB.gLayers.value);
	
	//	for(i=0;i<document.createRecipeDB.gLayers.value;++i)
	//	{
			//eval("document.getElementById('LayerG"+[i]+"').style.visibility = 'hidden';");
	//	}
	
		//blank1 is used to cover underlying div content of p1 to p10
		document.getElementById('blank1').style.visibility="visible";
		document.getElementById(id).style.visibility="visible";
	}
	else
	{
		document.getElementById('blank1').style.visibility="hidden";
		document.getElementById(id).style.visibility="hidden";
		document.getElementById('LayerP6').style.visibility="visible";
	}

}

function delMaterial(fieldNo)
{
	var emptyVal = '';
	eval("document.createRecipeDB.material"+fieldNo+".value = emptyVal;");
	eval("document.createRecipeDB.amount"+fieldNo+".value = emptyVal;");
}


function updateField1(form)
{
	var selectedMaterial;
	//number of options in select box
	var n=form.materialList.length;
	
	for(i=0;i<n;++i)
	{
		if(form.materialList.options[i].selected)
		{
			selectedMaterial =form.materialList.options[i].text;
		}
	}
	for(i=0;i<12;++i)
	{
		yy=eval("form.material"+i+".value");
		if(yy=='')
		{
			eval("form.material"+i+".value = selectedMaterial");
			break;
		}
		else
		{
			if(yy==selectedMaterial)
			{
				alert(selectedMaterial+' has already been selected');
				return;
			}
		}
	}
}

function updateColourField(form)
{
				
		var selectedMaterial;
		//number of options in select box
		var n=form.colourList.length;
		
		for(i=0;i<n;++i)
		{
			if(form.colourList.options[i].selected)
			{
				selectedMaterial =form.colourList.options[i].text;
			}
		}
				
		//populate empty fields
		for(i=0;i<10;++i)
		{
			yy=eval("form.material"+i+".value");
			if(yy=='')
			{
				eval("form.material"+i+".value = selectedMaterial");
				break;
			}
			else
			{
				if(yy==selectedMaterial)
				{
					alert(selectedMaterial+' has already been selected');
					return;
				}
			}
		}
}

function materialDisplay(form)
{

	var selectedMaterial;
	//number of options in select box
	var n=form.materialList1.length;
	
	for(i=0;i<n;++i)
	{
		if(form.materialList1.options[i].selected)
		{
			selectedMaterial =form.materialList1.options[i].text;
		}
	}
	
	eval("document."+form.name+".materialSearch.value = selectedMaterial");
	
	sendForm(form);
}


function updateField(form)
{
		var selectedMaterial;
		//number of options in select box
		var n=form.materialList.length;
		
		for(i=0;i<n;++i)
		{
			if(form.materialList.options[i].selected)
			{
				selectedMaterial =form.materialList.options[i].text;
				selectedType=typeIt[i].toLowerCase();
			}
		}
		
		
		//determine target
		if(selectedType.toLowerCase()=='clay')
		{
			document.createRecipeDB.clayMaterial.value=selectedMaterial;
		}
		else if(selectedType.toLowerCase()=='feldspar')
		{
			document.createRecipeDB.feldsparMaterial.value=selectedMaterial;
		}
		else if(selectedType=='glassformer')
		{
			document.createRecipeDB.glassformerMaterial.value=selectedMaterial;
		}
		else if(selectedType.toLowerCase()=='flux')
		{
			document.createRecipeDB.fluxMaterial.value=selectedMaterial;
		}
		else if(selectedType.toLowerCase()=='color-opacifier') 
		{
			document.createRecipeDB.colourMaterial.value=selectedMaterial;  
		}
		else
		{
		}
	
}

function sendFormTrack(frm,dest)
{
	document.createRecipeDB.trackCol_frm.value=1;  
	if(dest=='generalColourSelection.php')
	{
		document.createRecipeDB.action = "generalColourSelection.php";
		document.createRecipeDB.submit();
	}
	//make sure there are materials entered before invoking adjusment 
	if(dest=='recWizard_A_Adj.php' && chkForAdj())
	{
		document.createRecipeDB.action = "recWizard_A_Adj.php";
		document.createRecipeDB.submit();
	}
	if(dest=='exportPrint.php')
	{
		document.createRecipeDB.action = "exportPrint.php";
		document.createRecipeDB.submit();
	}
	if(dest=='gsLinks.php')
	{
		document.createRecipeDB.action = "gsLinks.php";
		document.createRecipeDB.submit();
	}
	if(dest=='gallery.php')
	{
		document.createRecipeDB.action = "gallery.php";
		document.createRecipeDB.submit();
	}
}

function sendColourForm(frm)
{
	if(chkTerms())
	{
		document.createRecipeDB.colAtmChange.value=1;
		eval("document."+frm+".submit();");
	}
}


function sendForm(frm)
{
	eval("document."+frm+".submit()");
}

function loadTypes1(typePass,selectName,frm)
{
	
	var name = new Array();
	var type = new Array();
	name = n1();
	type = t1();
	
	eval("document."+frm+"."+selectName+".options.length=0");
	
	var optInd=0;

	for(i=0;i<type.length;i++)
	{		
		if(type[i] != 'xxx')
		{
			if(typePass=='Color-Opacifier')
			{
				if(type[i]=='Colorant' || type[i]=='Opacifier')
				{
					eval("document."+frm+"."+selectName+".options[optInd] = new Option(name[i])");
					optInd++;
				}
			}
			else if(typePass=='Frit')
			{
				if(name[i].indexOf('Frit')!=-1)
				{
					eval("document."+frm+"."+selectName+".options[optInd] = new Option(name[i])");
					optInd++;
				}
			}
			else if(typePass=='Ash')
			{
				if(name[i].indexOf('Ash')!=-1 || name[i].indexOf('Woodash')!=-1)
				{
					eval("document."+frm+"."+selectName+".options[optInd] = new Option(name[i])");
					optInd++;
				}
			}
			else if(typePass=='Feldspar')
			{
				if(name[i].indexOf('Frit')==-1&& type[i]=='Feldspar')
				{
					eval("document."+frm+"."+selectName+".options[optInd] = new Option(name[i])");
					optInd++;
				}
			}
			else
			{
				if(typePass=="all")
				{
					eval("document."+frm+"."+selectName+".options[optInd] = new Option(name[i])");
					optInd++;
				}
				else
				{
					typeSelected=typePass.toLowerCase();
					matType=type[i].toLowerCase();
					if(matType==typeSelected)
					{
						eval("document."+frm+"."+selectName+".options[optInd] = new Option(name[i])");
						optInd++;
					}
				}
			}
		}
	}
}

function n1()
{
	var name1 = new Array();

name1[0]='A-3 Feldspar';
name1[1]='Ajax Kaolin';
name1[2]='Ajax Kaolin Calcined';
name1[3]='Alabama Kaolin';
name1[4]='Alberta Slip';
name1[5]='Alumina Hydrate';
name1[6]='Anhydrous Borax';
name1[7]='APGreen (Miss.) Fireclay';
name1[8]='Arcano Kaolin';
name1[9]='AT Ball Clay';
name1[10]='Australian Spodumene';
name1[11]='Barium Carbonate';
name1[12]='Barnard-Blackbird Slipclay';
name1[13]='Basalt';
name1[14]='Bell Dark Ball';
name1[15]='Bell Feldspar';
name1[16]='Bentonite Clay';
name1[17]='Birch Woodash';
name1[18]='Black Iron Oxide';
name1[19]='Bond Frit';
name1[20]='Bone Ash';
name1[21]='Bone Ash Substitute';
name1[22]='Borax';
name1[23]='BPS Calcium Borate Frit';
name1[24]='BPS Cornish Stone';
name1[25]='BPS High Alkaline Frit';
name1[26]='BPS Low Expansion Frit';
name1[27]='BPS Soda Feldspar';
name1[28]='BPS Standard Borax Frit';
name1[29]='C6 Feldspar';
name1[30]='Calcined Alumina';
name1[31]='Calcined Kaolin';
name1[32]='Calcium Borate Frit';
name1[33]='Calcium Feldspar';
name1[34]='Calvert Clay';
name1[35]='Camadil 95 Dolomite';
name1[36]='CC Ball Clay';
name1[37]='Cedar Heights Fireclay';
name1[38]='Cedar Woodash';
name1[39]='Cherry Woodash';
name1[40]='Chesterfield Feldspar';
name1[41]='China Clay';
name1[42]='Chromium Oxide Green';
name1[43]='Clay 215';
name1[44]='Clay 220';
name1[45]='Clay 222';
name1[46]='Clay 232';
name1[47]='Clay 233';
name1[48]='Clay 244';
name1[49]='Clay 246';
name1[50]='Clay 261';
name1[51]='Cobalt Carbonate';
name1[52]='Cobalt Oxide';
name1[53]='Colemanite';
name1[54]='Colorobia Frit F4';
name1[55]='Colorobia Frit F5';
name1[56]='Common Woodash';
name1[57]='Copper Carbonate';
name1[58]='Copper Oxide';
name1[59]='Cornish Stone';
name1[60]='Cornwall Stone';
name1[61]='Cryolite';
name1[62]='Custer Potash Feldspar';
name1[63]='Dolomite';
name1[64]='Dresden Ball Clay';
name1[65]='Edgar Plastic Kaolin';
name1[66]='Esan Feldspar';
name1[67]='Eureka Feldspar';
name1[68]='F-20 Feldspar';
name1[69]='F2 Ball Clay';
name1[70]='F4 (Soda) Feldspar';
name1[71]='F7 Feldspar';
name1[72]='F7SE Feldspar';
name1[73]='F7SG Feldspar';
name1[74]='Feldspar 632';
name1[75]='Feldspar 635';
name1[76]='Feldspar 645';
name1[77]='Feldspar 661';
name1[78]='Feldspath ICE 10';
name1[79]='Ferro Frit 3110';
name1[80]='Ferro Frit 3124';
name1[81]='Ferro Frit 3134';
name1[82]='Ferro Frit 3185';
name1[83]='Ferro Frit 3195';
name1[84]='Ferro Frit 3225';
name1[85]='Ferro Frit 3226';
name1[86]='Ferro Frit 3227';
name1[87]='Ferro Frit 3247';
name1[88]='Ferro Frit 3249';
name1[89]='Ferro Frit 3264';
name1[90]='Ferro Frit 3269';
name1[91]='Ferro Frit 3270';
name1[92]='Ferro Frit 3271';
name1[93]='Ferro Frit 3278';
name1[94]='Ferro Frit 3289';
name1[95]='Ferro Frit 3291';
name1[96]='Ferro Frit 3292';
name1[97]='Ferro Frit 3819';
name1[98]='Ferro Frit 3824';
name1[99]='Ferro Frit 3831';
name1[100]='Ferro Frit 3851';
name1[101]='Ferro Frit 5301';
name1[102]='FFF Feldspar';
name1[103]='FHC (new)';
name1[104]='FHC (old)';
name1[105]='Flint';
name1[106]='FM6 Feldspar';
name1[107]='FN Feldspar';
name1[108]='Fusion Frit 502';
name1[109]='Fusion Frit f-10';
name1[110]='Fusion Frit F-105';
name1[111]='Fusion Frit F-12';
name1[112]='Fusion Frit F-125';
name1[113]='Fusion Frit F-13';
name1[114]='Fusion Frit F-134';
name1[115]='Fusion Frit F-15';
name1[116]='Fusion Frit F-175';
name1[117]='Fusion Frit F-18';
name1[118]='Fusion Frit F-19';
name1[119]='Fusion Frit F-2';
name1[120]='Fusion Frit F-215';
name1[121]='Fusion Frit F-237';
name1[122]='Fusion Frit F-245';
name1[123]='Fusion Frit F-300';
name1[124]='Fusion Frit F-304';
name1[125]='Fusion Frit F-309';
name1[126]='Fusion Frit F-310';
name1[127]='Fusion Frit F-34';
name1[128]='Fusion Frit F-367';
name1[129]='Fusion Frit F-38';
name1[130]='Fusion Frit F-43';
name1[131]='Fusion Frit F-49';
name1[132]='Fusion Frit F-492';
name1[133]='Fusion Frit F-496';
name1[134]='Fusion Frit F-499';
name1[135]='Fusion Frit F-541';
name1[136]='Fusion Frit F-561';
name1[137]='Fusion Frit F-562';
name1[138]='Fusion Frit F-563';
name1[139]='Fusion Frit F-567';
name1[140]='Fusion Frit F-60';
name1[141]='Fusion Frit F-65';
name1[142]='Fusion Frit F-69';
name1[143]='Fusion Frit F-71';
name1[144]='Fusion Frit F-74';
name1[145]='Fusion Frit F-95';
name1[146]='Fusion Frit F25';
name1[147]='Fusion Frit F294';
name1[148]='Fusion Frit F359';
name1[149]='Fusion Frit F403';
name1[150]='Fusion Frit F498';
name1[151]='Fusion Frit F5';
name1[152]='Fusion Frit F506';
name1[153]='Fusion Frit F524';
name1[154]='Fusion Frit F69';
name1[155]='Fusion Frit FZ-10';
name1[156]='Fusion Frit FZ-14';
name1[157]='Fusion Frit FZ-16';
name1[158]='Fusion Frit FZ-22';
name1[159]='Fusion Frit FZ-24';
name1[160]='Fusion Frit FZ-376 A';
name1[161]='Fusion Frit FZ30';
name1[162]='Fusion.Frit F 79';
name1[163]='G200 (Potash) Feldspar';
name1[164]='Georgia Kaolin';
name1[165]='Gerstley Borate';
name1[166]='Glacier 200 Talc';
name1[167]='Gleason Ball Clay';
name1[168]='Gold Art Clay';
name1[169]='Grog, 20mesh';
name1[170]='Grolleg Kaolin';
name1[171]='Gum CMC (7L2)';
name1[172]='Gunheath Kaolin';
name1[173]='Hardwood Ash';
name1[174]='Hawthorne Bond Fireclay';
name1[175]='Hectalite 200';
name1[176]='Helmer Kaolin';
name1[177]='High Alkaline Frit';
name1[178]='Hommel Frit 259';
name1[179]='Hommel Frit 385';
name1[180]='Hommel Frit 389';
name1[181]='Hommel Frit 3GF61A';
name1[182]='Hommel Frit 400';
name1[183]='Hommel Frit 442';
name1[184]='Hommel Frit 494';
name1[185]='Hommel Frit 497';
name1[186]='Hommel Frit 550';
name1[187]='Hommel Frit 630';
name1[188]='Hommel Frit 698';
name1[189]='Hommel Frit 90';
name1[190]='Hommel Frit K3';
name1[191]='HP 71 Ball Clay';
name1[192]='HVAR Ball Clay';
name1[193]='Hyplas 64 Ball Clay';
name1[194]='Ilmenite';
name1[195]='Imco 400 Fireclay';
name1[196]='Jackson Ball Clay';
name1[197]='Jordan Fireclay';
name1[198]='Kaolin 111';
name1[199]='Kaolin 113';
name1[200]='Kaolin 114';
name1[201]='Kaolin 115';
name1[202]='Kaolin 143';
name1[203]='Kaolin 151';
name1[204]='Kaolin 171';
name1[205]='Kaolin A';
name1[206]='Kaolin SP';
name1[207]='Kent Stone';
name1[208]='Kentucky Stone Clay';
name1[209]='Kingman Feldspar';
name1[210]='KMS Kaolin';
name1[211]='KTS 2 Ball Clay';
name1[212]='Kyanite';
name1[213]='Lepidolite';
name1[214]='Lithium Carbonate';
name1[215]='Lithospar';
name1[216]='Low Expansion Frit';
name1[217]='M&D Ball Clay';
name1[218]='M71 Feldspar';
name1[219]='M74 Feldspar';
name1[220]='Macaloid(Bentonite MA)';
name1[221]='Magnesium Carbonate';
name1[222]='Manganese Dioxide';
name1[223]='Maple Woodash';
name1[224]='Molochite';
name1[225]='Mullite Grog, 48mm';
name1[226]='NC 4 Feldspar';
name1[227]='Nepheline Syenite';
name1[228]='New Spodumene';
name1[229]='Newman Clay';
name1[230]='Nickel Carbonate';
name1[231]='Nickel Oxide';
name1[232]='No. 5 Ball Clay';
name1[233]='Noor Albite';
name1[234]='Noor Hematite';
name1[235]='Noor Talc';
name1[236]='Oak Woodash';
name1[237]='Old Hickory(M-23)Ball Clay';
name1[238]='Old Mine 4 Ball Clay';
name1[239]='Old Spodumene';
name1[240]='Oxford Feldspar';
name1[241]='Pegmatite';
name1[242]='Pemco Frit P-1090';
name1[243]='Pemco Frit P-1409';
name1[244]='Pemco Frit P-1413';
name1[245]='Pemco Frit P-1733';
name1[246]='Pemco Frit P-1836';
name1[247]='Pemco Frit P-1855';
name1[248]='Pemco Frit P-1A43';
name1[249]='Pemco Frit P-1A44';
name1[250]='Pemco Frit P-1J81';
name1[251]='Pemco Frit P-1N72';
name1[252]='Pemco Frit P-1R63';
name1[253]='Pemco Frit P-1V04';
name1[254]='Pemco Frit P-1V31';
name1[255]='Pemco Frit P-2201';
name1[256]='Pemco Frit P-238';
name1[257]='Pemco Frit P-283';
name1[258]='Pemco Frit P-2G63';
name1[259]='Pemco Frit P-311';
name1[260]='Pemco Frit P-318';
name1[261]='Pemco Frit P-3E12';
name1[262]='Pemco Frit P-404';
name1[263]='Pemco Frit P-54';
name1[264]='Pemco Frit P-586';
name1[265]='Pemco Frit P-609';
name1[266]='Pemco Frit P-626';
name1[267]='Pemco Frit P-67';
name1[268]='Pemco Frit P-688';
name1[269]='Pemco Frit P-786';
name1[270]='Pemco Frit P-802';
name1[271]='Pemco Frit P-827';
name1[272]='Pemco Frit P-830';
name1[273]='Pemco Frit P-878';
name1[274]='Pemco Frit P-926';
name1[275]='Pemco Frit P-930';
name1[276]='Pemco Frit P-941';
name1[277]='Pemco Frit P-991';
name1[278]='Pemco Frit P1701';
name1[279]='Petalite';
name1[280]='Pine Lake Fireclay';
name1[281]='Pine Woodash';
name1[282]='Pioneer Kaolin';
name1[283]='Plastic Vitrox';
name1[284]='Potash Feldspar';
name1[285]='PS Feldspar';
name1[286]='Pyrophyllite';
name1[287]='Pyrotrol';
name1[288]='Red Art Clay';
name1[289]='Red Copper Oxide';
name1[290]='Red Earth Clay';
name1[291]='Red Iron Oxide';
name1[292]='Red Stone Clay';
name1[293]='Rice Husk Ash';
name1[294]='Rice Straw Ash';
name1[295]='Rutile';
name1[296]='S-3 Ball Clay';
name1[297]='SGP 1 Ball Clay';
name1[298]='Sil-o-spar';
name1[299]='Silica';
name1[300]='Soda Ash';
name1[301]='Soda Feldspar';
name1[302]='Sodium Silicate';
name1[303]='SP-G Feldspar';
name1[304]='Spluga Talc';
name1[305]='Spruce Woodash';
name1[306]='Std Borate Frit';
name1[307]='Strontium Carbonate';
name1[308]='Talc';
name1[309]='Talc 2C';
name1[310]='Tennessee 9 Ball Clay';
name1[311]='Tile 6 Kaolin';
name1[312]='Tin Oxide';
name1[313]='Titanium Dioxide';
name1[314]='Volcanic Ash';
name1[315]='Whiting';
name1[316]='Wollastonite';
name1[317]='Yellow Iron Oxide';
name1[318]='Zinc Oxide';
name1[319]='Zircopax';
	return name1;
}

function t1()
{
	var type1 = new Array();
		
type1[0]='Feldspar';
type1[1]='Clay';
type1[2]='Clay';
type1[3]='Clay';
type1[4]='Feldspar';
type1[5]='No Category';
type1[6]='Flux';
type1[7]='xxx';
type1[8]='Clay';
type1[9]='Clay';
type1[10]='Feldspar';
type1[11]='Flux';
type1[12]='Feldspar';
type1[13]='Feldspar';
type1[14]='Clay';
type1[15]='Feldspar';
type1[16]='Feldspar';
type1[17]='Flux';
type1[18]='Colorant';
type1[19]='No Category';
type1[20]='Flux';
type1[21]='Flux';
type1[22]='Flux';
type1[23]='Frit';
type1[24]='Feldspar';
type1[25]='Frit';
type1[26]='Frit';
type1[27]='Feldspar';
type1[28]='Frit';
type1[29]='Feldspar';
type1[30]='No Category';
type1[31]='Clay';
type1[32]='Frit';
type1[33]='Feldspar';
type1[34]='Clay';
type1[35]='Flux';
type1[36]='Clay';
type1[37]='Clay';
type1[38]='Flux';
type1[39]='Flux';
type1[40]='Feldspar';
type1[41]='Clay';
type1[42]='Colorant';
type1[43]='Clay';
type1[44]='Clay';
type1[45]='Clay';
type1[46]='Clay';
type1[47]='Clay';
type1[48]='Clay';
type1[49]='Clay';
type1[50]='Clay';
type1[51]='Colorant';
type1[52]='Colorant';
type1[53]='Flux';
type1[54]='Frit';
type1[55]='Frit';
type1[56]='No Category';
type1[57]='Colorant';
type1[58]='Colorant';
type1[59]='Feldspar';
type1[60]='Feldspar';
type1[61]='No Category';
type1[62]='Feldspar';
type1[63]='Flux';
type1[64]='Clay';
type1[65]='Clay';
type1[66]='Feldspar';
type1[67]='Feldspar';
type1[68]='Feldspar';
type1[69]='Feldspar';
type1[70]='Feldspar';
type1[71]='Feldspar';
type1[72]='Feldspar';
type1[73]='Feldspar';
type1[74]='Feldspar';
type1[75]='Feldspar';
type1[76]='Feldspar';
type1[77]='Feldspar';
type1[78]='Feldspar';
type1[79]='No Category';
type1[80]='No Category';
type1[81]='Flux';
type1[82]='Flux';
type1[83]='Feldspar';
type1[84]='No Category';
type1[85]='Flux';
type1[86]='No Category';
type1[87]='No Category';
type1[88]='Feldspar';
type1[89]='No Category';
type1[90]='Feldspar';
type1[91]='No Category';
type1[92]='Flux';
type1[93]='Flux';
type1[94]='No Category';
type1[95]='Feldspar';
type1[96]='Feldspar';
type1[97]='Feldspar';
type1[98]='Flux';
type1[99]='Feldspar';
type1[100]='Feldspar';
type1[101]='Feldspar';
type1[102]='Feldspar';
type1[103]='Clay/Feldspar';
type1[104]='Clay/Feldspar';
type1[105]='Glass';
type1[106]='Feldspar';
type1[107]='Feldspar';
type1[108]='No Category';
type1[109]='No Category';
type1[110]='No Category';
type1[111]='No Category';
type1[112]='Flux';
type1[113]='No Category';
type1[114]='Feldspar';
type1[115]='No Category';
type1[116]='No Category';
type1[117]='No Category';
type1[118]='Feldspar';
type1[119]='Feldspar';
type1[120]='No Category';
type1[121]='No Category';
type1[122]='Flux';
type1[123]='Feldspar';
type1[124]='Feldspar';
type1[125]='No Category';
type1[126]='Feldspar';
type1[127]='Flux';
type1[128]='Flux';
type1[129]='No Category';
type1[130]='No Category';
type1[131]='No Category';
type1[132]='No Category';
type1[133]='No Category';
type1[134]='No Category';
type1[135]='Feldspar';
type1[136]='No Category';
type1[137]='No Category';
type1[138]='No Category';
type1[139]='Feldspar';
type1[140]='Flux';
type1[141]='No Category';
type1[142]='Feldspar';
type1[143]='No Category';
type1[144]='No Category';
type1[145]='No Category';
type1[146]='Feldspar';
type1[147]='No Category';
type1[148]='Feldspar';
type1[149]='No Category';
type1[150]='Feldspar';
type1[151]='No Category';
type1[152]='Feldspar';
type1[153]='No Category';
type1[154]='Feldspar';
type1[155]='Feldspar';
type1[156]='Feldspar';
type1[157]='Flux';
type1[158]='No Category';
type1[159]='Feldspar';
type1[160]='No Category';
type1[161]='Flux';
type1[162]='No Category';
type1[163]='Feldspar';
type1[164]='Clay';
type1[165]='Flux';
type1[166]='Flux';
type1[167]='Clay';
type1[168]='Clay';
type1[169]='xxx';
type1[170]='Clay';
type1[171]='No Category';
type1[172]='Clay';
type1[173]='Flux';
type1[174]='Clay';
type1[175]='Clay';
type1[176]='Clay';
type1[177]='Frit';
type1[178]='Feldspar';
type1[179]='Flux';
type1[180]='Feldspar';
type1[181]='Feldspar';
type1[182]='No Category';
type1[183]='No Category';
type1[184]='No Category';
type1[185]='No Category';
type1[186]='No Category';
type1[187]='No Category';
type1[188]='No Category';
type1[189]='No Category';
type1[190]='Flux';
type1[191]='Clay';
type1[192]='Clay';
type1[193]='Clay';
type1[194]='Colorant';
type1[195]='Clay';
type1[196]='Clay';
type1[197]='Clay';
type1[198]='Clay';
type1[199]='Clay';
type1[200]='Clay';
type1[201]='Clay';
type1[202]='Clay';
type1[203]='Clay';
type1[204]='Clay';
type1[205]='Clay';
type1[206]='Clay';
type1[207]='Clay/Feldspar';
type1[208]='Clay/Feldspar';
type1[209]='Feldspar';
type1[210]='Clay';
type1[211]='Clay/Feldspar';
type1[212]='xxx';
type1[213]='Feldspar';
type1[214]='Flux';
type1[215]='Feldspar';
type1[216]='Frit';
type1[217]='Clay';
type1[218]='Feldspar';
type1[219]='Feldspar';
type1[220]='No Category';
type1[221]='Flux';
type1[222]='Colorant';
type1[223]='Flux';
type1[224]='xxx';
type1[225]='xxx';
type1[226]='Feldspar';
type1[227]='Feldspar';
type1[228]='Feldspar';
type1[229]='Feldspar';
type1[230]='Colorant';
type1[231]='Colorant';
type1[232]='Clay';
type1[233]='Feldspar';
type1[234]='Feldspar';
type1[235]='Flux';
type1[236]='Flux';
type1[237]='Clay';
type1[238]='Clay';
type1[239]='Feldspar';
type1[240]='Feldspar';
type1[241]='Feldspar';
type1[242]='No Category';
type1[243]='Feldspar';
type1[244]='Flux';
type1[245]='Flux';
type1[246]='No Category';
type1[247]='No Category';
type1[248]='Flux';
type1[249]='Flux';
type1[250]='Feldspar';
type1[251]='No Category';
type1[252]='No Category';
type1[253]='No Category';
type1[254]='No Category';
type1[255]='Flux';
type1[256]='Feldspar';
type1[257]='No Category';
type1[258]='No Category';
type1[259]='Feldspar';
type1[260]='Flux';
type1[261]='Feldspar';
type1[262]='Feldspar';
type1[263]='Flux';
type1[264]='No Category';
type1[265]='No Category';
type1[266]='No Category';
type1[267]='Feldspar';
type1[268]='No Category';
type1[269]='No Category';
type1[270]='No Category';
type1[271]='No Category';
type1[272]='Flux';
type1[273]='Flux';
type1[274]='No Category';
type1[275]='No Category';
type1[276]='Feldspar';
type1[277]='Feldspar';
type1[278]='No Category';
type1[279]='No Category';
type1[280]='xxx';
type1[281]='Flux';
type1[282]='Clay';
type1[283]='No Category';
type1[284]='Feldspar';
type1[285]='Feldspar';
type1[286]='No Category';
type1[287]='No Category';
type1[288]='Clay/Feldspar';
type1[289]='Colorant';
type1[290]='Clay/Feldspar';
type1[291]='Colorant';
type1[292]='Clay/Feldspar';
type1[293]='Flux';
type1[294]='Flux';
type1[295]='Colorant';
type1[296]='Clay';
type1[297]='Clay';
type1[298]='Feldspar';
type1[299]='Glass';
type1[300]='Flux';
type1[301]='Feldspar';
type1[302]='No Category';
type1[303]='Feldspar';
type1[304]='Flux';
type1[305]='No Category';
type1[306]='Frit';
type1[307]='Flux';
type1[308]='Flux';
type1[309]='Flux';
type1[310]='Clay';
type1[311]='Clay';
type1[312]='Opacifier';
type1[313]='Opacifier';
type1[314]='Flux';
type1[315]='Flux';
type1[316]='Flux';
type1[317]='Colorant';
type1[318]='Flux';
type1[319]='Opacifier';
	return type1;
}

