document.write('<form name="frm_search" method="post" onsubmit="return empt(frm_search)" action="searchresults.php">');
document.write('<td width="33%"><input type="text" name="search" size="20" value=""></td>');
document.write('<td width="34%" align="center"><a onclick="javascript:empt(frm_search)"><img border="0" src="images/go.jpg" width="19" height="19" style="cursor=hand"></a></td>');
document.write('</form>');

function trim(str)
{

        str=str.replace(/^[\s]+/,'');
        return (str.replace(/[\s]+$/,''));
}

function empt(obj)
{
 if(trim(obj.search.value)=="")
 {   alert("Please enter search string/query !");
    return false
    }
    obj.submit();

}
