
<!--
function buttonfocus(btn, event){
	if (document.all)
	{
		if (event.keyCode == 13)
		{
			event.returnValue=false;
			event.cancel = true;
			btn.click();
		}
	}
	else if (document.getElementById)
	{
		if (event.which == 13)
		{
			event.returnValue=false;
			event.cancel = true;
			btn.click();
		}
	}
	else if(document.layers)
	{
		if(event.which == 13)
		{
			event.returnValue=false;
			event.cancel = true;
			btn.click();
		}
	}
}
// -->

function URLencodeUTF8(string) {
	string = string.replace(/\r\n/g, "\n");
	var utftext = "";
	for (var n = 0; n < string.length; n++) {
		var c = string.charCodeAt(n);
		if (c < 128) {
			utftext += String.fromCharCode(c);
		} else {
			if ((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			} else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
		}
	}
	return escape(utftext);
};

function search1(relativepath)
{
    var str = document.getElementById("search").value;
    window.location = relativepath + "/products/search.aspx?stype=3&key="+URLencodeUTF8(str);
}

function searchBtnKeydown(event, path1)
{
    if (event.keyCode == 13)
    {
        event.returnValue=false;
        event.cancel = true;
        search1(path1);
    }
}

function clearBox(box)
{
	if(box.value==box.defaultValue)
	{
 		box.value = "";
	}
}
