function onSilverlightError(sender, args) 
{
  var appSource = "";
  if (sender != null && sender != 0) 
  {
    appSource = sender.getHost().Source;
  } 
  
  var errorType = args.ErrorType;
  var iErrorCode = args.ErrorCode;
            
  var errMsg = "Unhandled Error in Silverlight 2 Application " +  appSource + "\n" ;

  errMsg += "Code: "+ iErrorCode + "    \n";
  errMsg += "Category: " + errorType + "       \n";
  errMsg += "Message: " + args.ErrorMessage + "     \n";

  if (errorType == "ParserError")
  {
    errMsg += "File: " + args.xamlFile + "     \n";
    errMsg += "Line: " + args.lineNumber + "     \n";
    errMsg += "Position: " + args.charPosition + "     \n";
  }
  else if (errorType == "RuntimeError")
  {           
    if (args.lineNumber != 0)
    {
      errMsg += "Line: " + args.lineNumber + "     \n";
      errMsg += "Position: " +  args.charPosition + "     \n";
    }
    errMsg += "MethodName: " + args.methodName + "     \n";
  }
  throw new Error(errMsg);
}

function EmbedApi_Launch(arg)
{
  window.location = "http://app.contentvision.com/WebSearch/index.php?srch="+arg;  
}

function EmbedApi_LaunchPlayer(uuid, clip) 
{
  window.location = "http://app.contentvision.com/WebPlayer/index.php?clip="+uuid + "_Clip_" + clip;
}