/*
 * Copyright IPVision, Inc 2007 - .   All rights reserved.
 */

function GetQuickSearchHeadHtml()
{
	return '<table><tr><td style="vertical-align: top;">'
			+       GetQuickSearchLogoHtml()
			+   '<td style="padding-left: 1in; padding-top: 0.05in; vertical-align: middle;">'
			+       GetQuickSearchFieldHtml()
	        +   '</tr></table>';
}

function GetQuickSearchLogoHtml(mainPageUrl)
{
    if(!mainPageUrl) {
        mainPageUrl = "/";
    }
    var onclick = "window.open('" + mainPageUrl + "');";
    
    return ' \
		<table width="0%" style="display: table-cell; font-family: Arial; color: darkBlue;" onclick="' + onclick + '"> \
			<tr>    \
				<td colspan="2" nowrap>    \
					<font style="vertical-align: middle; font-size: 24pt; font-weight: bold;">  \
						<img style="width: 32; height: 32" src="/IPV Search/ipv.jpg"/>&nbsp;IPVision<font style="font-size: 12pt; vertical-align: 35%;">™</font>    \
				</td>   \
			</tr>   \
			<tr>    \
				<td align="left"><font style="font-size: 10pt; font-weight: bold;">Patent Analytics</td>    \
				<td align="right"><font style="font-size: 8pt;  font-weight: bold;  color: gray;  ">BETA</font></td>    \
			</tr>   \
		</table>    \
	';
}

function GetQuickSearchFieldHtml(formName, searchValue, onlyTreesLogo, actionUrl)
{
    var searchType = "indexed";
    
    if(!formName)
		formName = "";
	if(!searchValue)
		searchValue = "";
	if(!actionUrl)
		actionUrl = "http://www.see-the-forest.com/QuickSearch.act";

	return '   \
		<div style="display: table-cell; font-family: Arial; color: darkBlue;">   \
			<form name="' + formName + '" target="_self" method="post" action="' + actionUrl + '"   \
			      onsubmit="return QuickSearchArgsOk(this);">   \
				<table width="0%" style="color: darkBlue;">   \
					<tr>   \
						<td nowrap align="left" colspan="2">   \
							<font style="font-size: 12pt; font-weight: bold; ">' +  (onlyTreesLogo ? 'Find the Trees' : 'See the Forest™') +  '  \
					</tr>   \
					<tr>    \
						<td nowrap>   \
                            <input id="ref" name="ref" type="hidden" value="refId=ipv_searchHead"/>   \
                            <input id="searchHandoff" name="searchHandoff" type="text" size="45" value="' + searchValue +'"></input>   \
							<input id="q" name="q" type="hidden" value="' + searchValue + '"></input>   \
							<input name="searchType" type="hidden" value="' + searchType + '"></input>   \
							<input name="snMapEngine" type="hidden" value="none"></input>   \
						</td>   \
						<td nowrap align="left">   \
							<input type="submit" value="Search Patents">&nbsp;</input>   \
							<a target="_self" href="/IPV Search/About Patent Analytics Main.html"><font style="font-size: 9pt;">Help</a>   \
						</td>   \
					</tr>   \
				</table>   \
			</form>   \
		</div>   \
	';
}


function GetQuickSearchAnalysisLabelHtml()
{
	return '<font style="color: darkBlue; font-size: 12pt; font-weight: bold; ">See the Forest™</font>';
}


function QuickSearchArgsOk(form)
{
	var value = form.searchHandoff.value + "";
	if(!value)
	{
		alert("Please enter a search topic");
		return false;
	}
	form.q.value = value;
	return true;
}

