var sets = eval({"commercial":["Proj_1","Mol_1"],"clinical":["Proj_4","Mol_3","Proj_3","Mol_2"],"preclinical":["Proj_6","Mol_5"],"Ind_3":["Proj_1","Mol_1"],"Mol_1":["Proj_1","Mol_1"],"Ind_1":["Proj_4","Mol_3"],"Mol_3":["Proj_4","Mol_3"],"Ind_4":["Proj_3","Mol_2"],"Mol_2":["Proj_3","Mol_2"],"Ind_2":["Proj_6","Mol_5"],"Mol_5":["Proj_6","Mol_5"]});
		
	
		function arraySearch(needle, haystack){
			for (var x in haystack){
				if(needle == haystack[x]){
					return true;		
				}
			}
			return false;
		}

		
		function filter(type){
			var filter = type.options[type.selectedIndex].value;
			if(filter == 'all' || checkAllBlank()){
				showAllRows();
				return;
			}else if(filter == "ol"){
				document.getElementById('olBox').style.display = "block";
				document.getElementById('pipeTable').style.display = "none"
				//document.getElementById('olHead').style.display = "block";
				document.getElementById('pipeHead').style.display = "none"
				return;
			}else{
				document.getElementById('olBox').style.display = "none";
				document.getElementById('pipeTable').style.display = "block"
				//document.getElementById('olHead').style.display = "none";
				document.getElementById('pipeHead').style.display = "block"
			}
			switch (type.id){
				case 'pipeType':
					document.getElementById('filtProg').selectedIndex = 0;
					document.getElementById('filtInd').selectedIndex = 0;
					break;
				case 'filtProg':
					document.getElementById('pipeType').selectedIndex = 0;
					document.getElementById('filtInd').selectedIndex = 0;
					break;
				case 'filtInd':
					document.getElementById('pipeType').selectedIndex = 0;
					document.getElementById('filtProg').selectedIndex = 0;
					break;
			}
			filterRows(sets[filter]);
			return;
		}
			
		function checkAllBlank(){
			if(document.getElementById('pipeType').selectedIndex == 0 &&
			   document.getElementById('filtProg').selectedIndex == 0 &&
			   document.getElementById('filtInd').selectedIndex == 0){
					return true;
			}
			return false;
		}
		
		function showAllRows(){
			resetSels();
			var table = document.getElementById('pipeTable');
			var rows = table.rows;
			var numRows = rows.length;
			for(var i = 0 ; i < numRows ; i++){
				try{
					rows[i].style.display = "table-row";
				}catch(e){ // since IE doesn't support css2
					rows[i].style.display = "block";
				}
			}
			//makew sure both tables are showing
			document.getElementById('olBox').style.display = "block";
			document.getElementById('pipeTable').style.display = "block"
			//document.getElementById('olHead').style.display = "block";
			document.getElementById('pipeHead').style.display = "block"
		}
		
		function filterRows(filter){
			var table = document.getElementById('pipeTable');
			var rows = table.rows;
			var numRows = rows.length;
			for(var i = 0 ; i < numRows ; i++){
				if(rows[i].id == "head" || arraySearch(rows[i].id, filter)){
					try{
						rows[i].style.display = "table-row";
					}catch(e){// since IE doesn't support css2
						rows[i].style.display = "block";
					}
				}else{
					rows[i].style.display = "none";
				}
			}
		}
		
		
		function resetSels(){
			document.getElementById('pipeType').selectedIndex = 1;
			document.getElementById('filtProg').selectedIndex = 0;
			document.getElementById('filtInd').selectedIndex = 0;
		}
	