
function type_changed(type)
{
	if( type == "" ) {
		$("innersearchform_catalogid").options.length = 1;
	}
	if( type == "bz" ) fill_catalog(bz_array);
	if( type == "zz" ) fill_catalog(zz_array);
	if( type == "oz" ) fill_catalog(oz_array);
	if( type == "ob" ) fill_catalog(ob_array);
}

function fill_catalog(thearray)
{
	
	$("innersearchform_catalogid").selectedIndex = 0;
	
	var ops = $("innersearchform_catalogid").options;
	ops.length = 1 + thearray.length;

	for( var i=1;i<=thearray.length;++i) {
		var ss = thearray[i-1].split(",");
		ops[i].text =  ss[1];
		ops[i].value = ss[0];
	}
}

function showproductsortby(s) {
	
	if( $("innersearchform_sortby").value == s ) {
	
		if( $("innersearchform_sortdir").value == "asc" )
			$("innersearchform_sortdir").value = "desc";
		else
			$("innersearchform_sortdir").value = "asc";
			
	} else {
		$("innersearchform_sortby").value = s;
		$("innersearchform_sortdir").value = "asc";
		
		if( s == "searchrelease" || s == "searchsellcount" ) 
			$("innersearchform_sortdir").value = "desc";
	}
	
	document.innersearchform.submit();
}

