/*function DoSearch(document,tb_obj,msg){

if (tb_obj.value=='' || Trim(tb_obj.value)==' ')
{
alert(msg)
return 
}


for(var i=0;i<document.forms.length;i++)
{
var theform=document.forms[i]
//alert(theform.id)
	//if(theform.id.indexOf('search_form')>=0)
	if(theform.ExactWord !=null)
	{
		theform.action="/water/console/results_page.aspx";
			
					theform.ExactWord.value=tb_obj.value;
					

					if(document.getElementById('__VIEWSTATE') !=null)
						document.getElementById('__VIEWSTATE').outerHTML="";
					if(document.getElementById('__EVENTARGUMENT') !=null)
											document.getElementById('__EVENTARGUMENT').outerHTML="";
					if(document.getElementById('__EVENTTARGET') !=null)
						document.getElementById('__EVENTTARGET').outerHTML="";	
					
					theform.submit();
	}
}
}*/

function DoSearch(document,tb_obj,msg,not_enough_msg){
if(tb_obj==null)
 {   
 alert('Text Box Not Found');
 return;
 }
 if(tb_obj.length != undefined && tb_obj.length>1)
 {
    tb_obj=tb_obj[0];
 }
 
enter_pressed=0;
if (tb_obj.value=='' || Trim(tb_obj.value)==' ')
{
alert(msg);
return;
}


if (Trim(tb_obj.value).length<3)
{
alert(not_enough_msg)
return 
}

for(var i=0;i<document.forms.length;i++)
{
var theform=document.forms[i]
//alert(theform.id)
	//if(theform.id.indexOf('search_form')>=0)
	if(theform.ExactWord !=null)
	{
		var path="/water/console/result_items.aspx";
		
					if(Trim(tb_obj.value).indexOf(' ')>0)
					{
						path += "&words=" + tb_obj.value;
						path +="&is_words_title=1";
						path +="&is_words_keywords=1";
						path +="&is_words_fields=1";
						path +="&exactly=true";
					}
					else
					{

						path += "&ExactWord=" + Trim(tb_obj.value);
						path +="&is_word_title=1";
						path +="&is_word_keywords=1";
						path +="&is_word_fields=1";
					}
					path +="&current_posting=" + theform.current_posting.value;
					path +="&mysort=11";
					
					path=path.replace("&","?")
					location.href=path;
					
	}
}
}

function clrsearch(tb_obj)
        {
            tb_obj.value = ""
        }


//var qc = String.fromCharCode(34);







