<!--
function organsearch(str) {
	var form = document.forms["organinform"];
	var organaction = str;
	var chechksize = 0;
	var tspcecies;
	var tspcecies1;
	
	if(organaction == 'list') {

		for( var i=0; i < form.estspecies.length; i++) { 
			if (form.estspecies[i].checked) { 
				//alert(form.estspecies[i].value);
				chechksize++;
			}
		}
		
		if (chechksize == 0) {
			alert('Please select an organism.');
			return;
		}else{
			form.action = "./library_list.jsp";
			form.submit();
		}
	}else if (organaction == 'download'){
	
		for( var i=0; i < form.estspecies.length; i++) { 
			if (form.estspecies[i].checked) { 
				//alert(form.estspecies[i].value);
				tspcecies = form.estspecies[i].value;
				chechksize++;
			}
		}
		
		if (chechksize == 0) {
			alert('Please select an organism.');
			return;
		}else{
			if (tspcecies == 'otherspecies') {
				for( var j=0; j < form.selectspecies.length; j++) { 
					if (form.selectspecies[j].selected) { 
						tspcecies1 = form.selectspecies[j].value;
					}
				}
			}else{
				tspcecies1 = tspcecies;
			}
				
			//alert(tspcecies1 + " selected.");
			//return;
			
			var url="organism_library_view.jsp?estorgan="+tspcecies1;
			var cleanfocus = window.open(url,'libraryinfo', 'height=450,width=700,top=20,left=150, scrollbars=yes, resizable=yes');	
			cleanfocus.window.focus();
		}	
	}
}	
	function searchtext() {
		var form = document.forms["textsearch"];

		var seartext = form.textorganism.value;

		var numPattern = /[^0-9A-Za-z\-\_\[\[\]\]\.\s]/;
		var searmatch = seartext.match(numPattern);


		if (seartext) {
			if (searmatch != null) {
				alert("Please input appropriate keyword.");
				form.textorganism.value = "";
				form.textorganism.focus();
				return;
			}else{
				form.submit();
			}

		}else{
			alert('Please input an organism.');
			form.textorganism.focus();
			return;	
		}
	}
	
	function cleanestlib(organstr, typestr, libstr) {
		var species = organstr;
		var esttype = typestr;
		var libid = libstr;
    
		var url="cleanestzip.jsp?estorgan="+species+"&esttype="+esttype+"&libid="+libid;
		var cleanfocus = window.open(url,'dziplib', 'height=10,width=10,top=0,left=150,scrollbars=yes, resizable=yes');	
		cleanfocus.window.focus();
	}


	function cleanestspecies(organstr, typestr) {
		var species = organstr;
		var esttype = typestr;
   
		var url="cleanestzip_species.jsp?estorgan="+species+"&esttype="+esttype;
		var cleanfocus = window.open(url,'dziplib', 'height=10,width=10,top=20,left=250,scrollbars=yes, resizable=yes');	
		cleanfocus.window.focus();
	}


	function checkedtopest() {
		var form = document.forms["organinform"];
		var chechknum = 0;

		for( var i=0; i < form.estspecies.length; i++) { 
			if (form.estspecies[i].checked) { 
				chechknum = i;
			}
		}
		form.reset();
		form.estspecies[chechknum].checked = true;
		form.selectspecies.disabled=true;
		return;
	}	
	
	
	function selectedspecies() {
		var form = document.forms["organinform"];

		form.selectspecies.disabled=false;
		form.selectspecies[0].selected = true;
		form.selectspecies.focus();
	}

/*Anatomy Search*/

	function searchterm() {
		var form = document.forms["termsearch"];

		var aseartext = form.textanatomy.value;
		var pseartext = form.textpathology.value;

		var anumPattern = /[^0-9A-Za-z\-\_\[\[\]\]\.\s]/;
		var asearmatch = aseartext.match(anumPattern);
		var psearmatch = pseartext.match(anumPattern);


		if (aseartext) {
			if (asearmatch != null) {
				alert("Please input appropriate keyword.");
				form.textanatomy.value = "";
				form.textanatomy.focus();
				return;
			}
		}else{
			alert('Please input anatomical and pathological  term(s).');
			form.textanatomy.focus();
			return;	
		}

		if (pseartext) {
			if (psearmatch != null) {
				alert("Please input appropriate keyword.");
				form.textpathology.value = "";
				form.textpathology.focus();
				return;
			}
		}else{
			alert('Please input anatomical and pathological term(s).');
			form.textpathology.focus();
			return;	
		}

		form.submit();
	}


function anatomysearch(str) {
	var form = document.forms["anatomyinform"];
	var anatomyaction = str;
	var chechksize = 0;

	if(anatomyaction == 'list') {

		for( var i=0; i < form.aterm.length; i++) { 
			if (form.aterm[i].checked) { 
				chechksize++;
			}
		}
		
		if (chechksize == 0) {
			alert('Please select antomical term(s).');
			return;
		}else{
			form.target = "_self";
			form.action = "./anatomy_list.jsp";
			form.submit();
		}
	}else if (anatomyaction == 'download'){
	
		for( var i=0; i < form.aterm.length; i++) { 
			if (form.aterm[i].checked) { 
				chechksize++;
			}
		}
		
		if (chechksize == 0) {
			alert('Please select antomical term(s).');
			return;
		}else{
			//var cleanfocus = window.open('./anatomy_library_view.jsp','libraryinfo', 'height=450,width=700,top=20,left=150, scrollbars=yes, resizable=yes');	
			//cleanfocus.window.focus();
			var cleanfocus = window.open('','libraryinfo', 'height=450,width=700,top=20,left=150, scrollbars=yes, resizable=yes');
			cleanfocus.window.focus();
			form.target= "libraryinfo";
			form.method= "POST";
			form.action= "./anatomy_library_view.jsp";
			form.submit();
		}	
	}
}	



/*Pathology Search*/

function pathologysearch(str) {
	var form = document.forms["pathologyinform"];
	var pathologyaction = str;
	var chechksize = 0;

	if(pathologyaction == 'list') {

		for( var i=0; i < form.aterm.length; i++) { 
			if (form.aterm[i].checked) { 
				chechksize++;
			}
		}
		
		if (chechksize == 0) {
			alert('Please select pathological term(s).');
			return;
		}else{
			form.target = "_self";
			form.action = "./pathology_list.jsp";
			form.submit();
		}
	}else if (pathologyaction == 'download'){
	
		for( var i=0; i < form.aterm.length; i++) { 
			if (form.aterm[i].checked) { 
				chechksize++;
			}
		}
		
		if (chechksize == 0) {
			alert('Please select pathological term(s).');
			return;
		}else{
			//var cleanfocus = window.open('./anatomy_library_view.jsp','libraryinfo', 'height=450,width=700,top=20,left=150, scrollbars=yes, resizable=yes');	
			//cleanfocus.window.focus();
			var cleanfocus = window.open('','libraryinfo', 'height=450,width=700,top=20,left=150, scrollbars=yes, resizable=yes');
			cleanfocus.window.focus();
			form.target= "libraryinfo";
			form.method= "POST";
			form.action= "./pathology_library_view.jsp";
			form.submit();
		}	
	}
}	


/*Anatomy and Pathology Search*/

function anapathsearch(str) {
	var aform = document.forms["anatomyinform"];
	var pform = document.forms["pathologyinform"];

	var anapathaction = str;
	var achechksize = 0;
	var pchechksize = 0;


	var achechkvalue = "";
	var pchechkvalue = "";


	if(anapathaction == 'list') {

		for( var i=0; i < aform.aterm.length; i++) { 
			if (aform.aterm[i].checked) { 
				achechkvalue += aform.aterm[i].value + "|";
				achechksize++;
			}
		}
		
		if (achechksize == 0) {
			alert('Please select anatomical and pathological term(s).');
			return;
		}
		
		
		for( var i=0; i < pform.aterm.length; i++) { 
			if (pform.aterm[i].checked) { 
				pchechkvalue += pform.aterm[i].value + "|";
				pchechksize++;
			}
		}
		
		if (pchechksize == 0) {
			alert('Please select anatomical and pathological term(s).');
			return;
		}

			var url= "./anapath_list.jsp?anaterm=" + achechkvalue.substr(0, achechkvalue.length - 1) + "&pathterm="+ pchechkvalue.substr(0, pchechkvalue.length - 1);
			var cleanfocus = window.open(url,'_self');
			//cleanfocus.window.focus();

		
	}else if (anapathaction == 'download'){
	
		for( var i=0; i < aform.aterm.length; i++) { 
			if (aform.aterm[i].checked) { 
				achechkvalue += aform.aterm[i].value + "|";
				achechksize++;
			}
		}
		
		if (achechksize == 0) {
			alert('Please select anatomical and pathological term(s).');
			return;
		}
		
		
		for( var i=0; i < pform.aterm.length; i++) { 
			if (pform.aterm[i].checked) { 
				pchechkvalue += pform.aterm[i].value + "|";
				pchechksize++;
			}
		}
		
		if (pchechksize == 0) {
			alert('Please select anatomical and pathological term(s).');
			return;
		}

			var url= "./anapath_library_view.jsp?anaterm=" + achechkvalue.substr(0, achechkvalue.length - 1) + "&pathterm="+ pchechkvalue.substr(0, pchechkvalue.length - 1);
			var cleanfocus = window.open(url,'libraryinfo', 'height=450,width=700,top=20,left=150, scrollbars=yes, resizable=yes');
			cleanfocus.window.focus();

	}
}	



	function cleanestanatomy(termstr, typestr) {
		var esttype = typestr;
		var terms = termstr;
   
		var url="cleanestzip_anatomy.jsp?terms="+terms+"&esttype="+esttype;
		var cleanfocus = window.open(url,'dziplib', 'height=10,width=10,top=20,left=250,scrollbars=yes, resizable=yes');	
		cleanfocus.window.focus();
	}

	function cleanestpathology(termstr, typestr) {
		var esttype = typestr;
		var terms = termstr;
   
		var url="cleanestzip_pathology.jsp?terms="+terms+"&esttype="+esttype;
		var cleanfocus = window.open(url,'dziplib', 'height=10,width=10,top=20,left=250,scrollbars=yes, resizable=yes');	
		cleanfocus.window.focus();
	}


	function cleanestanapath(termstr, termstrpath,  typestr) {
		var esttype = typestr;
		var terms = termstr;
		var termspath = termstrpath;
   
		var url="cleanestzip_anapath.jsp?esttype="+esttype+"&aterms="+terms+"&pterms="+termspath;
		var cleanfocus = window.open(url,'dziplib', 'height=10,width=10,top=20,left=250,scrollbars=yes, resizable=yes');	
		cleanfocus.window.focus();
	}

//-->