// redirects to same page replacing existing querystring argument with new one specified, keeping all other arguments the same
function go_url(_argument, value){
	var current_url = unescape(location.href);
	var q_pos = current_url.indexOf('?');
	var querystring = current_url.substring(q_pos + 1);
	var new_querystring = '';
	var found__argument = false;
	_arguments = querystring.split('&');
	for (i = 0; i < _arguments.length ; i++){
		if (_arguments[i].indexOf(_argument + '=') >= 0){
			_arguments[i] = _argument + '=' + value;
			found__argument = true;
		}
		new_querystring += _arguments[i] + '&';
	}
	//eliminate trailing ampersand
	new_querystring = new_querystring.substring(0, new_querystring.length - 1);
	if (found__argument == false){
		new_querystring = querystring + '&' + _argument + '=' + value;
	}
	newLocationString = '?' + new_querystring;
	location.href= newLocationString;
}

function specials_change_make(value) {
	var current_url = unescape(location.href);
	var q_pos = current_url.indexOf('&make=')+1;
	var newLocation = current_url.substring(0,q_pos);
	newLocation = newLocation + 'make=' + value + '&model=all';
	location.href = newLocation;
}

function add_list_item(ob, value, text){
	var option = document.createElement("OPTION");
	IE = ((document.all)&&(navigator.appVersion.indexOf("MSIE")!=-1)) ? true : false;

	option.value = value;
	option.text = text;

	if (IE)
		ob.add(option);
	else
		ob.add(option, null);
}
		
function empty_list(ob){
	while(ob.length){
		ob.remove(0);
	}
}
