//
// Copyright IPVision, Inc 2008 - .   All rights reserved.
//
// <!-- Javascript for IPVision search widget

function GetQuickSearchHtml(baseUrl)
{
	return '<div style="display: table-cell; font-family: Arial; color: darkBlue;"> \
		<form target="_ipvQuickSearch" method="post" action="' + baseUrl + '/QuickSearch2.act" \
		      onsubmit="return QuickSearchArgsOk(this);"> \
		      	<table width="100%" height="100%" cellspacing="0" cellpadding="0" style="color: darkBlue; background-color: white; border: darkBlue 2px solid; padding: 3px 8px;"><tr><td> \
			<table width="0%" cellspacing="0" cellpadding="0" style="color: darkBlue; background-color: white;"> \
				<tr> \
					<td nowrap> \
						<img style="border-width: 0; vertical-align: middle" src="/favicon.ico"/> \
						<font style="vertical-align: middle; font-size: 10pt; font-weight: bold;"> \
							IPVision<font style="font-size: 8pt; vertical-align: 35%;">™</font> \
						</font> \
					</td> \
					<td width="4px"></td> \
					<td align="left"> \
						<table width="0%" border="0" cellspacing="0" cellpadding="0" style="color: darkBlue; background-color: white;"> \
							<tr><td><font style="font-size: 6pt; font-weight: bold">Patent</font></td></tr> \
							<tr><td><font style="font-size: 6pt; font-weight: bold">Analytics</font></td></tr> \
						</table> \
					</td> \
				</tr> \
				<tr> \
					<td nowrap colspan="3"> \
						<input id="ref" name="ref" type="hidden" value=""/> \
						<input id="searchHandoff" name="searchHandoff" type="hidden" value=""/> \
						<input id="q" name="q" type="text" value="" style="width: 120px; height: 18px; font-size: 7pt; font-family: Arial;"/> \
						<input type="submit" value="GO" style="width: 25px; height: 20px; font-size: 7pt; font-weight: bold; font-family: Arial;"/> \
					</td> \
				</tr> \
			</table> \
			</td></tr></table> \
		</form> \
	</div>';
}

function QuickSearchArgsOk(form)
{
	var value = form.q.value + "";
	if(!value)
	{
		alert("Please enter a search topic");
		return false;
	}
	var i = document.URL.indexOf("?");
	form.ref.value = (i > 0) ? document.URL.substring(i + 1) : "";
	form.searchHandoff.value = value;
	form.q.value = "";
	return true;
}

var docElem = document.getElementById("_searchIPVision_");
if(docElem) {
	docElem.innerHTML = GetQuickSearchHtml("http://www.see-the-forest.com");
}

// End Javascript for IPVision search widget -->
