function link(link) {
	document.location.href = link;
}

function basket(link) {
	document.location.href = "/basket?add=" + link;
	return false;
}

function winopen (popupURL,width,height) {
        var popup = window.open(popupURL,"popup",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + width + ',height=' + height );
        popup.focus();
        if( navigator.appName.substring(0,8) == "Netscape" ) {
                popup.location = popupURL;
        }
}

function winopen_mess (popupURL,width,height) {
        var popup = window.open(popupURL,"popup",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height );
        popup.focus();
        if( navigator.appName.substring(0,8) == "Netscape" ) {
                popup.location = popupURL;
        }
}

$(document).ready(function(){
	
	function liFormat (row) {
		var result = row[0] + '<p class="qnt">' + row[1] + '</p>';
		return result;
	}

    $("#str").result(function(event, data, formatted) {
        document.str.hidid.value = data[1];
        document.str.submit();
    });

	$("#str").autocomplete("/in_auto.php", {
		delay:400,
		minChars:2,
		matchSubset:1,
		autoFill:false,
		matchContains:1,
		cacheLength:1,
		selectFirst:true,
		formatItem:liFormat,
		maxItemsToShow:4
	});

});
