function validation()
{

	if((document.microarray.upGenes.value == "") && (document.microarray.downGenes.value == ""))
	{
	   alert("Please enter atleast up regulated Gene IDs or down regulated Gene IDs. Both the fields can't be empty!");
	   return false;	
	}

	var flag = 0;
	var flat = 0;

	var tempStr  = 	document.microarray.upGenes.value;
	if((tempStr.match(/[a-z]/ig)))
	{
		flag = 1;
	}
	if(tempStr.match("[~!#$%^&*()?/\\';{}]"))
	{
		alert("Please enter Gene ID or Gene symbol!");
		return false;
	}
	var tempStrD = document.microarray.downGenes.value;
	if((tempStrD.match(/[a-z]/ig)))
	{
		flat = 1;
	}
	if(tempStrD.match("[~!#$%^&*()?/\\';{}]"))
	{
		alert("Please enter Gene ID or Gene symbol!");
		return false;
	}	
	if((flat ==1) && (flag ==1))
	{
		document.microarray.action="collectorSym.php";
		document.microarray.method="post";
		document.microarray.submit();
	}
	else if(((flat ==1) && (tempStr == "")) || ((flag ==1) && (tempStrD == "")))
	{
		document.microarray.action="collectorSym.php";
		document.microarray.method="post";
		document.microarray.submit();
	}
	else if(((flat ==1) && (tempStr.match(/[0-9]/ig))) || ((flag ==1) && (tempStrD.match(/[0-9]/ig))))
	{
		alert("Please input either Gene IDs or Symbols!");
		return false;
	}
	else{
	document.microarray.action="collector.php";
	document.microarray.method="post";
	document.microarray.submit();
	}
	
}
/*	
function showEngine()
{
	var status = document.getElementById("SearchEng").style.display;
	if(status == "none")
	{
		document.getElementById("SearchEng").style.display = 'block';
	        document.statusImg.src = "images/up.gif";

	}
	else{
		document.getElementById("SearchEng").style.display = 'none';
	        document.statusImg.src = "images/down.gif";
	}
}
*/
