function selectCombinationId ( tocId )
{
	var optionValueIds = new Array;
	var optionGroups = document.getElementsByName ( 'option_value_ids_' + tocId );
	
	for ( var i = 0; i < optionGroups.length; i ++ )
	{
		if ( optionGroups[ i ].value != 0 ) optionValueIds.push ( optionGroups[ i ].value );
		else return false;
	}
	
	var cId = tocId  + '.' + optionValueIds.join ( '.' );
	var url = window.location.href;
	
	if ( url.match ( /_cid=(.+)/ ) )
	{
		url = url.replace ( RegExp.$1, RegExp.$1.replace ( new RegExp ( tocId + '[^-]*' ), cId ) );
	}
	else
	{
		url += '&_cid=' + cId;
	}
	
	window.location.href = url;
}

function selectPackagingUnit ( packagingUnit, combinationIdWithoutPackagingUnit )
{	
	var url = window.location.href;
	
	if ( url.match ( /(_cid=(.+))/ ) )
	{
		var urlCIdVar = RegExp.$1;
		var urlCIdVarValue = RegExp.$2;
		url = url.replace ( urlCIdVar, '_cid=' + urlCIdVarValue.replace ( new RegExp ( '(.+_)?' + combinationIdWithoutPackagingUnit ), packagingUnit + '_' + combinationIdWithoutPackagingUnit ) );
	}
	else
	{
		url += '&_cid=' + packagingUnit + '_' + combinationIdWithoutPackagingUnit;
	}
	
	// if ( confirm ( 'Goto: ' + url ) )
		window.location.href = url;
}