function post_search()
{
	var search_str = document.topsearch.search_str.value;
	var section = document.topsearch.cid.value;
	
	if(search_str.length < 3)
	{
		alert("Please enter minimum 3 characters for search");
		return false;
	}
	else
	{
		if(document.topsearch.search_cat.value=="")
		{
			
			switch (section)
			{
				case "3": // News
				{
					document.topsearch.action = "/mccode/news/searchresult.php";
					break;
				}
				case "0": //Markets
				{
					document.topsearch.action = "/stocks/cptmarket/compsearchnew.php?fname=price&companyname="+document.topsearch.search_str.value;
					break;
				}
				case "7": //MMB
				{
					document.topsearch.action = "/india/messageboard/mmb_search_result.php?f_criteria=Topic&f_Period=4&f_search="+document.topsearch.search_str.value;
					break;
				}
				case "2": //MF
				{
					document.topsearch.action = "/mf/mf_info/mfsearch.php?AMCname="+document.topsearch.search_str.value;
					break;
				}
				default:
				{
					//document.topsearch.action = "/news/newssearch/newscat.php";
					document.topsearch.action = "/stocks/cptmarket/compsearchnew.php?fname=price&companyname="+document.topsearch.search_str.value;
					break;
				}
			}
		}
		else
		{
			var search_val=document.topsearch.search_str.value
			var search_cat=document.topsearch.search_cat.value;
			if(search_cat == "News")
			{
				//document.topsearch.action = "/news/newssearch/newscat.php";
				document.topsearch.action = "/mccode/news/searchresult.php";
			}
			else if(search_cat == "Price")
			{
				document.topsearch.action = "/stocks/cptmarket/compsearchnew.php?fname=price&companyname="+document.topsearch.search_str.value;
			}
			else if(search_cat == "MFs")
			{
				document.topsearch.action = "/mf/mf_info/mfsearch.php?AMCname="+document.topsearch.search_str.value;
			}
			else if(search_cat == "Topic")
			{
				document.topsearch.mbsearch_str.value = search_val;
				document.topsearch.action = "/msgboard/viewmsg/find_topic.php";
			}
			else if(search_cat == "Boarder")
			{
				document.topsearch.mbsearch_str.value = search_val;
				document.topsearch.action="/msgboard/viewmsg/find_boarders.php";
			}
			else if(search_cat == "Stock")
			{
				document.topsearch.mbsearch_str.value = search_val;
				document.topsearch.action="/msgboard/viewmsg/find_topic_stock.php";
			}
			else if(search_cat == "Keyword")
			{
				document.topsearch.mbsearch_str.value = search_val;
				document.topsearch.action="/india/messageboard/mmb_search_result.php?f_criteria=Keyword&f_Period=1&f_search="+document.topsearch.search_str.value;
			}
			
			return true;
		}
	}
}