$skin-name: "CMS_Black";

$QUOTE: unquote('"');
$EMPTY_STRING: unquote( "" );
$SLASH: unquote("/");

$SKINS_PATH: unquote("/CMS/Skins");
$URL_SEPARATOR: $SLASH;
$URL_PREFIX: $EMPTY_STRING;
$URL_SUFFIX: $EMPTY_STRING;

$_URL_PREFIX: $URL_PREFIX + $EMPTY_STRING;
$_URL_SUFFIX: $URL_SUFFIX + $EMPTY_STRING;
$_URL_SEPARATOR: $URL_SEPARATOR + $EMPTY_STRING;
$_SKINS_PATH: $SKINS_PATH + $EMPTY_STRING;

@function webresource-image-url( $skin, $control, $file ) 
{
	$_url: $EMPTY_STRING;
	$_path: $_SKINS_PATH $skin $control;

	@each $_part in $_path {
		$_url: $_url + $_part + $_URL_SEPARATOR
	}

	@return $_URL_PREFIX + $QUOTE + $_url + $file + $QUOTE + $_URL_SUFFIX;
}

@function global-image-url( $skin, $control, $file ) {
	@return webresource-image-url( $skin, $control, $file );
}

@function skin-image-url( $control, $file ) {
	@return global-image-url( $skin-name, $control, $file );
}

$actions-sprite: skin-image-url( "Common", "radActionsSprite.png" );

.test 
{
	background-image: url( $actions-sprite );
}

