






{
function getCpiFromNameValueConsequetivePathSegments (path, cpiName)
{
  var lcCpiName = cpiName.toLowerCase();
  var segments = path.split("/");
  for (var i = 0; i < segments.length; ++i)
  {
    if ((unescape(segments[i])).toLowerCase() == lcCpiName && typeof(segments[i + 1]) != typeof(undefined))
      return unescape(segments[i + 1]);
  }
  return "";
}

function getCpi (containerUrl, cpiName)
{
  var urlParts = containerUrl.split("?");

  return getCpiFromNameValueConsequetivePathSegments(urlParts[0], cpiName);
}

var cpi = getCpi(location.href, "features");
if (cpi.length == 0)
  cpi = "unknown";
document.write('<script src="http://content.webcollage.net/_sites/vanns/smart-button/index.jsp?channel-product-id=' + escape(cpi) + '&wccgsite=vanns&wccgfunc=smart-button"><\/script>');
}

