// By publishing this widget code, you must agree to our Terms of Service (http://sustainlane.com/widgetTOS.jsp). 

function sl_product_search() {
	var sl_product_keyWords = document.getElementById('sl_product_keyword').value;
	sl_product_keyWords = encodeURIComponent(sl_product_keyWords);

	sl_product_searchURL = "http://www.sustainlane.com/ext/sw.do?tab=product";
	sl_product_searchURL += "&keyWords="+sl_product_keyWords;
	sl_product_searchURL += "&utm_campaign=productwidget&utm_content=graphic&utm_medium=widget";

	window.location = sl_product_searchURL;
}

function sl_product_detectSubmit(e) {
	var keynum;
	var keychar;

	if(window.event) // IE 
	{
		keynum = e.keyCode
	}
	else if(e.which) // Netscape/Firefox/Opera
	{
		keynum = e.which
	}
	
	keychar = String.fromCharCode(keynum)
	if (keychar == '\r' || keychar == '\n') {
		sl_product_search();
		return false;
	}
	return true;
}

document.write('<div style="background: url(http://ext.sustainlane.com.s3.amazonaws.com/widget/img/products_widget.gif) no-repeat; width: 120px; height: 240px; overflow: hidden;">');
document.write('<fieldset style="border:0; margin:0; padding: 0;">');
document.write('<input type="text" onkeypress="return sl_product_detectSubmit(event)" id="sl_product_keyword" name="sl_product_keyWords" style="width: 100px; font-family: arial, sans-serif; font-size: 12px; position: relative; left: 7px; top: 96px; border: 1px solid #999966; padding: 1px 3px 3px 3px;"/>');
document.write('<input type="image" src="http://ext.sustainlane.com.s3.amazonaws.com/widget/img/widget_search_btn.gif" style="position: relative; left: 52px; top: 100px" id="sl_product_searchButton" onclick="sl_product_search(); return false;"/>');
document.write('</fieldset>');
document.write('<a href="http://www.sustainlane.com/?utm_campaign=productwidget&amp;utm_content=graphic&amp;utm_medium=widget" style="position:relative; left: 6px; top: 145px; width: 107px; height: 33px; display: block"></a>');
document.write('</div>');

