/*
    Real A/V Experence (ra/ve) Error Code Lookup Script
    File: realaverrors.js
    Version: 1.0.3
    Author: Peter Fawcett
    Copyright 2007-2008 RealNetworks
    This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/

/*
Usage:

In a JavaScript file, trap the ra/ve callback 'OnError'.
This callback will be called anytime the ra/ve plugin has an error.
The callback will pass in one paramater, an HXError object.
The HXError object has placeholders for a 'Description' and 'MoreInforURL'
how ever as these would have to be hard coded, making localization or customization
of error messages difficult if not impossible, currently the only populated paramater
is the 'Code' value. This javascript file provides a pure JavaScript object which can
translate this code into a meaningfull string. Simply pass the HXError object in the
raveError constructor and then ask the resulting object for the error string.

Example:

function OnError( hxErrorObj )
{
    var raveErr = new RaveError( hxErrorObj );
    if ( raveErr )
    {
        alert( "You have had an error while using the ea/ve Player.\nThe Error is: " + raveErr.getErrorString() );
    }
}

To localize these error codes, make a copy of this file, name it for the localized language and then
update the strings in the new language.
*/

/*
Master lookup table for hx error codes. 
Structure: Each error code has three components;
    Index 0 - The base 16 error code.
    Index 1 - The 'HX' error code constant.
    Index 2 - The standard text description.
*/

var HXErrorDefTable = new Array(
    new Array( "80004001", "HXR_NOTIMPL", "The function is not implemented." ),
    new Array( "8007000e", "HXR_OUTOFMEMORY", "Out of memory. You may need to close some other applications to play this content." ),
    new Array( "80070057", "HXR_INVALID_PARAMETER", "Invalid parameter. Unable to process request." ),
    new Array( "80004002", "HXR_NOINTERFACE", "The creation function did not recognize the requested interface." ),
    new Array( "80004003", "HXR_POINTER", "A NULL pointer was passed to the method." ),
    new Array( "80070006", "HXR_HANDLE", "" ),
    new Array( "80004004", "HXR_ABORT", "The process was cancelled before it finished." ),
    new Array( "80004005", "HXR_FAIL", "An unspecified, general error has occurred." ),
    new Array( "80070005", "HXR_ACCESSDENIED", "The local file can not be accessed." ),
    new Array( "80000006", "HXR_IGNORE", "" ),
    new Array( "00000000", "HXR_OK", "The operation completed successfully." ),
    new Array( "80040004", "HXR_INVALID_OPERATION", "You performed an unsupported operation." ),
    new Array( "80040005", "HXR_INVALID_VERSION", "Invalid file version number." ),
    new Array( "80040006", "HXR_INVALID_REVISION", "An invalid RealMedia file version was specified." ),
    new Array( "80040007", "HXR_NOT_INITIALIZED", "The component has not been initialized." ),
    new Array( "80040008", "HXR_DOC_MISSING", "Requested file not found. The link you followed may be outdated or inaccurate." ),
    new Array( "80040009", "HXR_UNEXPECTED", "" ),
    new Array( "8004000c", "HXR_INCOMPLETE", "" ),
    new Array( "8004000d", "HXR_BUFFERTOOSMALL", "" ),
    new Array( "8004000e", "HXR_UNSUPPORTED_VIDEO", "The file contains an unsupported video format. The required codec is not installed on your system." ),
    new Array( "8004000f", "HXR_UNSUPPORTED_AUDIO", "The file contains an unsupported audio format. The required codec is not installed on your system." ),
    new Array( "80040010", "HXR_INVALID_BANDWIDTH", "The bandwidth you specified was not in the range allowed." ),
    new Array( "80040011", "HXR_MISSING_COMPONENTS", "Some components are not available to provide playback of this presentation on your system." ),
    new Array( "00040012", "HXR_ELEMENT_NOT_FOUND", "An element was not found." ),
    new Array( "00040013", "HXR_NOCLASS", "" ),
    new Array( "00040014", "HXR_CLASS_NOAGGREGATION", "This component does not support aggregation." ),
    new Array( "80040015", "HXR_NOT_LICENSED", "The operation being attempted was not licensed." ),
    new Array( "80040016", "HXR_NO_FILESYSTEM", "The requested file system was not found." ),
    new Array( "80040017", "HXR_REQUEST_UPGRADE", "" ),
    new Array( "80040018", "HXR_CHECK_RIGHTS", "Viewing time for this playback has expired. Check for more plays in View Content Rights." ),
    new Array( "80040019", "HXR_RESTORE_SERVER_DENIED", "Server has denied your restore request." ),
    new Array( "8004001a", "HXR_DEBUGGER_DETECTED", "Please quit any debuggers before attempting to play secure content." ),
    new Array( "8004005c", "HXR_RESTORE_SERVER_CONNECT", "Connection to restoration server could not be established. You may be experiencing network problems." ),
    new Array( "8004005d", "HXR_RESTORE_SERVER_TIMEOUT", "Connection to restoration server has timed out. You may be experiencing network problems." ),
    new Array( "8004005e", "HXR_REVOKE_SERVER_CONNECT", "Connection to revocation server to get the updated revocation list could not be established. You may be experiencing network problems. Playback cannot continue until a connection is established." ),
    new Array( "8004005f", "HXR_REVOKE_SERVER_TIMEOUT", "Connection to revocation server to get the updated revocation list has timed out. You may be experiencing network problems. Playback cannot continue until a connection is established." ),
    new Array( "800401cd", "HXR_VIEW_RIGHTS_NODRM", "None of the installed Digital Rights Managers support viewing rights." ),
    new Array( "800401d3", "HXR_VSRC_NODRM", "Play some secure content to upgrade to a secure DRM." ),
    new Array( "80040024", "HXR_WM_OPL_NOT_SUPPORTED", "The content requires an output protection level that is not supported by this application." ),
    new Array( "8004001b", "HXR_RESTORATION_COMPLETE", "Your rights have been restored successfully." ),
    new Array( "8004001c", "HXR_BACKUP_COMPLETE", "Your rights have been backed up successfully." ),
    new Array( "8004001d", "HXR_TLC_NOT_CERTIFIED", "This application is not certified to play secure content." ),
    new Array( "8004001e", "HXR_CORRUPTED_BACKUP_FILE", "The backup file is invalid." ),
    new Array( "8004001f", "HXR_AWAITING_LICENSE", "" ),
    new Array( "80040020", "HXR_ALREADY_INITIALIZED", "" ),
    new Array( "80040021", "HXR_NOT_SUPPORTED", "" ),
    new Array( "00040022", "HXR_S_FALSE", "" ),
    new Array( "00040023", "HXR_WARNING", "" ),
    new Array( "00040024", "HXR_PARTIALPLAYBACK", "" ),
    new Array( "00040025", "HXR_AUDIODEVICETAKEN", "" ),
    new Array( "80040026", "HXR_DEVVIDEO_FATAL_ERROR", "" ),
    new Array( "80040027", "HXR_DEVVIDEO_RESOURCE_LOST", "" ),
    new Array( "80040028", "HXR_DEVVIDEO_RESOURCE_RESTORED", "" ),
    new Array( "80040029", "HXR_NOT_SUPPORTED_FOR_LINEAR_FILE_SYSTEMS", "This file contains unsupported content." ),
    new Array( "00040040", "HXR_BUFFERING", "The request is deferred until after buffering is complete." ),
    new Array( "00040041", "HXR_PAUSED", "The clip has been paused." ),
    new Array( "00040042", "HXR_NO_DATA", "No more data was available." ),
    new Array( "00040043", "HXR_STREAM_DONE", "The specified stream has finished streaming." ),
    new Array( "80040043", "HXR_NET_SOCKET_INVALID", "Invalid socket error." ),
    new Array( "80040044", "HXR_NET_CONNECT", "Connection to server could not be established. You may be experiencing network problems." ),
    new Array( "80040045", "HXR_BIND", "An error occurred binding to the network socket." ),
    new Array( "80040046", "HXR_SOCKET_CREATE", "An error occurred while creating a network socket." ),
    new Array( "80040047", "HXR_INVALID_HOST", "A connection with the server could not be established." ),
    new Array( "80040048", "HXR_NET_READ", "An error occurred while reading data from the network." ),
    new Array( "80040049", "HXR_NET_WRITE", "An error occurred while writing data to the network." ),
    new Array( "8004004a", "HXR_NET_UDP", "UDP data packets cannot be received. You may want to try the TCP data option in Settings. You may also want to configure ra/ve to use a firewall proxy. For more information, contact your system administrator." ),
    new Array( "8004004b", "HXR_RETRY", "" ),
    new Array( "8004004c", "HXR_SERVER_TIMEOUT", "Connection to server has timed out. You may be experiencing network problems." ),
    new Array( "8004004d", "HXR_SERVER_DISCONNECTED", "Connection to server has been lost. You may be experiencing network problems." ),
    new Array( "8004004e", "HXR_WOULD_BLOCK", "The nonblocking call was not able to complete." ),
    new Array( "8004004f", "HXR_GENERAL_NONET", "Cannot find winsock services.  Please remove old Internet software from your system and try again." ),
    new Array( "80040050", "HXR_BLOCK_CANCELED", "The blocking call was cancelled." ),
    new Array( "80040051", "HXR_MULTICAST_JOIN", "An error occurred attempting to join a multicast session." ),
    new Array( "80040052", "HXR_GENERAL_MULTICAST", "An error occurred accessing a multicast session." ),
    new Array( "80040053", "HXR_MULTICAST_UDP", "Cannot receive audio data from this multicast session. You may wish to try the TCP option in Settings. Please contact your system administrator for more information." ),
    new Array( "80040054", "HXR_AT_INTERRUPT", "The process did not occur because an interrupt is currently in progress." ),
    new Array( "80040055", "HXR_MSG_TOOLARGE", "" ),
    new Array( "80040056", "HXR_NET_TCP", "TCP data packets cannot be received. You may want to configure the ra/ve client to use a firewall proxy. For more information, contact your system administrator." ),
    new Array( "80040057", "HXR_TRY_AUTOCONFIG", "Could not connect to server. Check network transport settings or use Auto-Transport." ),
    new Array( "80040058", "HXR_NOTENOUGH_BANDWIDTH", "You cannot receive this content because you do not have enough network bandwidth." ),
    new Array( "80040059", "HXR_HTTP_CONNECT", "Could not connect to the server using HTTP." ),
    new Array( "8004005a", "HXR_PORT_IN_USE", "The RTSP port was already in use and therefore could not be opened." ),
    new Array( "8004005b", "HXR_LOADTEST_NOT_SUPPORTED", "" ),
    new Array( "00040060", "HXR_TCP_CONNECT", "" ),
    new Array( "00040061", "HXR_TCP_RECONNECT", "" ),
    new Array( "80040062", "HXR_TCP_FAILED", "" ),
    new Array( "80040063", "HXR_AUTH_SOCKET_CREATE_FAILURE", "" ),
    new Array( "80040064", "HXR_AUTH_TCP_CONNECT_FAILURE", "" ),
    new Array( "80040065", "HXR_AUTH_TCP_CONNECT_TIMEOUT", "" ),
    new Array( "80040066", "HXR_AUTH_FAILURE", "" ),
    new Array( "80040067", "HXR_AUTH_REQ_PARAMETER_MISSING", "" ),
    new Array( "80040068", "HXR_DNS_RESOLVE_FAILURE", "" ),
    new Array( "00040068", "HXR_AUTH_SUCCEEDED", "" ),
    new Array( "80040069", "HXR_PULL_AUTHENTICATION_FAILED", "" ),
    new Array( "8004006a", "HXR_BIND_ERROR", "" ),
    new Array( "8004006b", "HXR_PULL_PING_TIMEOUT", "" ),
    new Array( "8004006c", "HXR_AUTH_TCP_FAILED", "" ),
    new Array( "8004006d", "HXR_UNEXPECTED_STREAM_END", "The operation you specified was not expected." ),
    new Array( "8004006e", "HXR_AUTH_READ_TIMEOUT", "" ),
    new Array( "8004006f", "HXR_AUTH_CONNECTION_FAILURE", "" ),
    new Array( "80040070", "HXR_BLOCKED", "" ),
    new Array( "80040071", "HXR_NOTENOUGH_PREDECBUF", "" ),
    new Array( "80040072", "HXR_END_WITH_REASON", "The playback is aborted by the server." ),
    new Array( "80040073", "HXR_SOCKET_NOBUFS", "" ),
    new Array( "80040074", "HXR_NET_SUSPENDED", "" ),
    new Array( "80040075", "HXR_NET_RESOURCES_IN_USE", "" ),
    new Array( "80040076", "HXR_ACCESSPOINT_NOT_FOUND", "" ),
    new Array( "00040080", "HXR_AT_END", "The end of the file was already reached." ),
    new Array( "80040081", "HXR_INVALID_FILE", "Unsuppported document type." ),
    new Array( "80040082", "HXR_INVALID_PATH", "The requested URL is not valid." ),
    new Array( "80040083", "HXR_RECORD", "" ),
    new Array( "80040084", "HXR_RECORD_WRITE", "" ),
    new Array( "80040085", "HXR_TEMP_FILE", "" ),
    new Array( "80040086", "HXR_ALREADY_OPEN", "A file you are trying to access is already open." ),
    new Array( "80040087", "HXR_SEEK_PENDING", "A seek was issued while another seek was already pending." ),
    new Array( "80040088", "HXR_CANCELLED", "A pending operation was cancelled." ),
    new Array( "80040089", "HXR_FILE_NOT_FOUND", "The file you were trying to open does not exist." ),
    new Array( "8004008a", "HXR_WRITE_ERROR", "An error occurred when you tried to perform a write." ),
    new Array( "8004008b", "HXR_FILE_EXISTS", "The file you were trying to create already exists." ),
    new Array( "8004008c", "HXR_FILE_NOT_OPEN", "The file you were trying to read or write is not open." ),
    new Array( "0004008d", "HXR_ADVISE_PREFER_LINEAR", "The file uses linear access instead of random access." ),
    new Array( "8004008e", "HXR_PARSE_ERROR", "" ),
    new Array( "0004008f", "HXR_ADVISE_NOASYNC_SEEK", "" ),
    new Array( "80040090", "HXR_HEADER_PARSE_ERROR", "" ),
    new Array( "80040091", "HXR_CORRUPT_FILE", "" ),
    new Array( "80040092", "HXR_NO_MORE_FILES", "" ),
    new Array( "80040093", "HXR_READ_ERROR", "" ),
    new Array( "80040094", "HXR_FULL_DOWNLOAD_NEEDED", "This file is not optimized for Progressive Download." ),
    new Array( "80040095", "HXR_PROGRESSIVE_DOWNLOAD_TIMEOUT", "" ),
    new Array( "00040096", "HXR_ADVISE_LOCAL_ACCESS", "" ),
    new Array( "800400c0", "HXR_BAD_SERVER", "This server is not using a recognized protocol." ),
    new Array( "800400c1", "HXR_ADVANCED_SERVER", "You need a newer version of this product to access the requested server. Please upgrade." ),
    new Array( "800400c2", "HXR_OLD_SERVER", "The connection was closed because the host's version of the RealNetworks server is too old for this client." ),
    new Array( "000400c3", "HXR_REDIRECTION", "" ),
    new Array( "800400c4", "HXR_SERVER_ALERT", "Server alert." ),
    new Array( "800400c5", "HXR_PROXY", "Proxy status error." ),
    new Array( "800400c6", "HXR_PROXY_RESPONSE", "Proxy invalid response error." ),
    new Array( "800400c7", "HXR_ADVANCED_PROXY", "You need a newer version of this product to access the requested proxy. Please upgrade." ),
    new Array( "800400c8", "HXR_OLD_PROXY", "Connection closed. The proxy is too old for this client." ),
    new Array( "800400c9", "HXR_INVALID_PROTOCOL", "Invalid protocol specified in URL. URLs should typically start with \"rtsp://\", \"pnm://\", or \"http://\"." ),
    new Array( "800400ca", "HXR_INVALID_URL_OPTION", "Invalid option specified in URL." ),
    new Array( "800400cb", "HXR_INVALID_URL_HOST", "Invalid host string in requested URL." ),
    new Array( "800400cc", "HXR_INVALID_URL_PATH", "Invalid resource path string in requested URL." ),
    new Array( "800400cd", "HXR_HTTP_CONTENT_NOT_FOUND", "" ),
    new Array( "800400ce", "HXR_NOT_AUTHORIZED", "Access Denied" ),
    new Array( "800400cf", "HXR_UNEXPECTED_MSG", "" ),
    new Array( "800400d0", "HXR_BAD_TRANSPORT", "Bad transport, check Preferences to ensure all network transports are selected." ),
    new Array( "800400d1", "HXR_NO_SESSION_ID", "The RTSP session is not valid." ),
    new Array( "800400d2", "HXR_PROXY_DNR", "Unable to locate proxy server. This proxy server does not have a DNS entry. Check the proxy server name and try again." ),
    new Array( "800400d3", "HXR_PROXY_NET_CONNECT", "Connection to proxy server could not be established. You may be experiencing network problems." ),
    new Array( "800400d4", "HXR_AGGREGATE_OP_NOT_ALLOWED", "" ),
    new Array( "800400d5", "HXR_RIGHTS_EXPIRED", "Your rights to view this content have expired." ),
    new Array( "800400d6", "HXR_NOT_MODIFIED", "" ),
    new Array( "800400d7", "HXR_FORBIDDEN", "Connection forbidden by server." ),
    new Array( "800400d8", "HXR_PROTOCOL_DOES_NOT_SUPPORT_DATATYPE", "Protocold does not support this datatype." ),
    new Array( "000406a2", "HXR_RTSP_RESP_SINK_MESSAGE", "" ),
    new Array( "80040100", "HXR_AUDIO_DRIVER", "Cannot open the audio device. Another application may be using it." ),
    new Array( "80040101", "HXR_LATE_PACKET", "The packet arrived too late to be processed." ),
    new Array( "80040102", "HXR_OVERLAPPED_PACKET", "The packet could not be written because of overlapping time stamps." ),
    new Array( "80040103", "HXR_OUTOFORDER_PACKET", "The packet could not be written because of out of order time stamps." ),
    new Array( "80040104", "HXR_NONCONTIGUOUS_PACKET", "The packet was not received in the proper order." ),
    new Array( "80040140", "HXR_OPEN_NOT_PROCESSED", "The open command has not been processed (probably because too many connections are already open)." ),
    new Array( "80040141", "HXR_WINDRAW_EXCEPTION", "An error occurred with the video subsystem. Playback may continue with decreased performance." ),
    new Array( "80040180", "HXR_EXPIRED", "The product you are using has expired.  You can upgrade to the latest version by visiting http://www.real.com/realav." ),
    new Array( "80040fc0", "HXR_INVALID_INTERLEAVER", "The deinterleaving process necessary for this stream is not present." ),
    new Array( "80040fc1", "HXR_BAD_FORMAT", "Unknown data format." ),
    new Array( "80040fc2", "HXR_CHUNK_MISSING", "While parsing a file, a critical structure was not found." ),
    new Array( "80040fc3", "HXR_INVALID_STREAM", "An invalid RealMedia stream was specified." ),
    new Array( "80040fc4", "HXR_DNR", "The server could not be located.  This server does not have a DNS entry.  Check the server name in the URL and try again." ),
    new Array( "80040fc5", "HXR_OPEN_DRIVER", "The network drivers cannot be opened." ),
    new Array( "80040fc6", "HXR_UPGRADE", "" ),
    new Array( "80040fc7", "HXR_NOTIFICATION", "" ),
    new Array( "80040fc8", "HXR_NOT_NOTIFIED", "Indicates the client did not request to recieve the notification." ),
    new Array( "80040fc9", "HXR_STOPPED", "The end of the clip has been reached, or the clip has been terminated." ),
    new Array( "80040fca", "HXR_CLOSED", "The action requested could not be performed because the file is already closed." ),
    new Array( "80040fcb", "HXR_INVALID_WAV_FILE", "" ),
    new Array( "80040fcc", "HXR_NO_SEEK", "Seeking is not possible." ),
    new Array( "80040200", "HXR_DEC_INITED", "Decoder was found and initialized." ),
    new Array( "80040201", "HXR_DEC_NOT_FOUND", "File compression is not supported because the decoder cannot be located." ),
    new Array( "80040202", "HXR_DEC_INVALID", "The requested decoder is not valid." ),
    new Array( "80040203", "HXR_DEC_TYPE_MISMATCH", "Decoder type mismatch. Cannot load the requested decoder." ),
    new Array( "80040204", "HXR_DEC_INIT_FAILED", "Requested decoder cannot be found or cannot be used on this computer." ),
    new Array( "80040205", "HXR_DEC_NOT_INITED", "Decoder was not initialized before attempting to use it." ),
    new Array( "80040206", "HXR_DEC_DECOMPRESS", "Unable to decompress this content." ),
    new Array( "80040207", "HXR_OBSOLETE_VERSION", "" ),
    new Array( "00040208", "HXR_DEC_AT_END", "" ),
    new Array( "80040281", "HXR_PROP_NOT_FOUND", "The property was not found." ),
    new Array( "80040282", "HXR_PROP_NOT_COMPOSITE", "You were trying to perform a composite action on a noncomposite key." ),
    new Array( "80040283", "HXR_PROP_DUPLICATE", "The property already exists." ),
    new Array( "80040284", "HXR_PROP_TYPE_MISMATCH", "The method you used does not match the property type." ),
    new Array( "80040285", "HXR_PROP_ACTIVE", "The registry property could not be modified because it is an active property. Use IHXActiveRegistry instead of IHXRegistry to modify this entry." ),
    new Array( "80040286", "HXR_PROP_INACTIVE", "The property is not active." ),
    new Array( "80040287", "HXR_PROP_VAL_UNDERFLOW", "" ),
    new Array( "80040288", "HXR_PROP_VAL_OVERFLOW", "" ),
    new Array( "80040289", "HXR_PROP_VAL_LT_LBOUND", "" ),
    new Array( "8004028a", "HXR_PROP_VAL_GT_UBOUND", "" ),
    new Array( "0004028b", "HXR_PROP_DELETE_PENDING", "" ),
    new Array( "800401c1", "HXR_COULDNOTINITCORE", "A failure occurred during the initialization of the player core." ),
    new Array( "800401c2", "HXR_PERFECTPLAY_NOT_SUPPORTED", "The requested server does not support PerfectPlay." ),
    new Array( "800401c3", "HXR_NO_LIVE_PERFECTPLAY", "PerfectPlay is not supported for live streams." ),
    new Array( "800401c4", "HXR_PERFECTPLAY_NOT_ALLOWED", "PerfectPlay not allowed on this clip." ),
    new Array( "800401c5", "HXR_NO_CODECS", "No codecs have been installed on your system." ),
    new Array( "800401c6", "HXR_SLOW_MACHINE", "Your CPU is unable to decode this content in real time. Try closing other applications, or setting your connection speed lower to receive less complex content." ),
    new Array( "800401c7", "HXR_FORCE_PERFECTPLAY", "Force PerfectPlay for this presentation." ),
    new Array( "800401c8", "HXR_INVALID_HTTP_PROXY_HOST", "Invalid hostname for HTTP proxy." ),
    new Array( "800401c9", "HXR_INVALID_METAFILE", "Invalid metafile." ),
    new Array( "800401ca", "HXR_BROWSER_LAUNCH", "" ),
    new Array( "800401cb", "HXR_VIEW_SOURCE_NOCLIP", "No clip is available." ),
    new Array( "800401cc", "HXR_VIEW_SOURCE_DISSABLED", "The provider of this content has not granted permission to view the source." ),
    new Array( "800401ce", "HXR_TIMELINE_SUSPENDED", "" ),
    new Array( "800401cf", "HXR_BUFFER_NOT_AVAILABLE", "" ),
    new Array( "800401d0", "HXR_COULD_NOT_DISPLAY", "" ),
    new Array( "800401d4", "HXR_SET_SECURE_OUT_FAIL", "" ),
    new Array( "80040301", "HXR_RESOURCE_NOT_CACHED", "" ),
    new Array( "80040302", "HXR_RESOURCE_NOT_FOUND", "" ),
    new Array( "80040303", "HXR_RESOURCE_CLOSE_FILE_FIRST", "" ),
    new Array( "80040304", "HXR_RESOURCE_NODATA", "" ),
    new Array( "80040305", "HXR_RESOURCE_BADFILE", "" ),
    new Array( "80040306", "HXR_RESOURCE_PARTIALCOPY", "" ),
    // Auto Upgrade - RealUpdate Messages
    new Array( "80040340", "HXR_UPG_AUTH_FAILED", "Download of the AutoUpdate component failed because it could not be verified as an authentic update distributed by RealNetworks." ),
    new Array( "80040341", "HXR_UPG_CERT_AUTH_FAILED", "The certificate portion of the AutoUpdate package (RUP file) is damaged." ),
    new Array( "80040342", "HXR_UPG_CERT_EXPIRED", "The certificate of the AutoUpdate package (RUP file) is expired." ),
    new Array( "80040343", "HXR_UPG_CERT_REVOKED", "The certificate of the AutoUpdate package (RUP file) is revoked." ),
    new Array( "80040344", "HXR_UPG_RUP_BAD", "The RUP file structure is invalid." ),
    new Array( "80040345", "HXR_UPG_SYSTEM_BUSY", "" ),
    // Server Error Messages
    new Array( "80041800", "HXR_SE_MIN_VALUE", "" ),
    new Array( "80041901", "HXR_SE_NO_ERROR", "" ),
    new Array( "80041902", "HXR_SE_INVALID_VERSION", "Please download a new ra/ve version to play this content." ),
    new Array( "80041903", "HXR_SE_INVALID_FORMAT", "" ),
    new Array( "80041904", "HXR_SE_INVALID_BANDWIDTH", "You cannot receive this content. Either your network bandwidth is not fast enough to receive this data or your CPU is not powerful enough to decode it." ),
    new Array( "80041905", "HXR_SE_INVALID_PATH", "" ),
    new Array( "80041906", "HXR_SE_UNKNOWN_PATH", "" ),
    new Array( "80041907", "HXR_SE_INVALID_PROTOCOL", "" ),
    new Array( "80041908", "HXR_SE_INVALID_PLAYER_ADDR", "" ),
    new Array( "80041909", "HXR_SE_LOCAL_STREAMS_PROHIBITED", "This server is not configured to play local streams." ),
    new Array( "8004190a", "HXR_SE_SERVER_FULL", "This server has reached its capacity for the requested url." ),
    new Array( "8004190b", "HXR_SE_REMOTE_STREAMS_PROHIBITED", "This server is not configured to play remote streams." ),
    new Array( "8004190c", "HXR_SE_EVENT_STREAMS_PROHIBITED", "This server is not configured to play event streams." ),
    new Array( "8004190d", "HXR_SE_INVALID_HOST", "Invalid server host specified in the URL." ),
    new Array( "8004190e", "HXR_SE_NO_CODEC", "You need to obtain a new ra/ve player to play this clip. Please point your web browser to http://www.real.com/realav and download the latest player from RealNetworks. Once you have installed it you should try this clip again." ),
    new Array( "8004190f", "HXR_SE_LIVEFILE_INVALID_BWN", "That stream is not available with the requested codec and/or bandwidth" ),
    new Array( "80041910", "HXR_SE_UNABLE_TO_FULFILL", "Unable to fulfill request" ),
    new Array( "80041911", "HXR_SE_MULTICAST_DELIVERY_ONLY", "This server is configured to support only multicast connections. Please contact the content provider for more information on listening to this broadcast." ),
    new Array( "80041912", "HXR_SE_LICENSE_EXCEEDED", "Server has reached its capacity and can serve no more streams. Please try again later." ),
    new Array( "80041913", "HXR_SE_LICENSE_UNAVAILABLE", "Server does not have the license for the requested streams. Please try again later." ),
    new Array( "80041914", "HXR_SE_INVALID_LOSS_CORRECTION", "" ),
    new Array( "80041915", "HXR_SE_PROTOCOL_FAILURE", "You have connected to a RealServer that only supports players newer than the one you are using. To download the latest ra/ve player, point your Web Browser to http://www.real.com/realav." ),
    new Array( "80041916", "HXR_SE_REALVIDEO_STREAMS_PROHIBITED", "This server is not configured to play RealVideo streams." ),
    new Array( "80041917", "HXR_SE_REALAUDIO_STREAMS_PROHIBITED", "This server is not configured to play RealAudio streams." ),
    new Array( "80041918", "HXR_SE_DATATYPE_UNSUPPORTED", "This server is not configured to play the data type you requested. Please contact the RealServer Administrator for assistance." ),
    new Array( "80041919", "HXR_SE_DATATYPE_UNLICENSED", "This server is not licensed to play one or more of the data types you requested. Please contact the RealServer Administrator for assistance." ),
    new Array( "8004191a", "HXR_SE_RESTRICTED_PLAYER", "You do not have access to the requested URL." ),
    new Array( "8004191b", "HXR_SE_STREAM_INITIALIZING", "The URL you have requested is initializing. Please try again in a few moments." ),
    new Array( "8004191c", "HXR_SE_INVALID_PLAYER", "You need to obtain a new player to play this clip. Please point your web browser to http://www.real.com/realav and download the latest ra/ve player from RealNetworks. Once you have installed it you should try this clip again." ),
    new Array( "8004191d", "HXR_SE_PLAYER_PLUS_ONLY", "The content you requested is available exclusively to SuperPass service members. Please point your web browser to http://www.real.com/ for upgrade information." ),
    new Array( "8004191e", "HXR_SE_NO_EMBEDDED_PLAYERS", "This server is not licensed to play content to embedded players. Please contact the RealServer Administrator for assistance." ),
    new Array( "8004191f", "HXR_SE_PNA_PROHIBITED", "The file you requested cannot be streamed using the PNM protocol. Please make sure you have downloaded the latest ra/ve player from http://www.real.com/realav and try this clip again using rtsp:// instead of pnm:// in the URL." ),
    new Array( "80041920", "HXR_SE_AUTHENTICATION_UNSUPPORTED", "You need to obtain a new ra/ve to play this clip. Please point your web browser to http://www.real.com/realav and download the latest ra/ve player from RealNetworks. Once you have installed it you should try this clip again." ),
    new Array( "80041921", "HXR_SE_MAX_FAILED_AUTHENTICATIONS", "Unable to access this clip with the specified username and password. Please contact the Site Administrator for assistance." ),
    new Array( "80041922", "HXR_SE_AUTH_ACCESS_DENIED", "Access to secure content denied." ),
    new Array( "80041923", "HXR_SE_AUTH_UUID_READ_ONLY", "Registration failed, your account cannot be modified at this time." ),
    new Array( "80041924", "HXR_SE_AUTH_UUID_NOT_UNIQUE", "Registration failed, there already exists a user with the same GUID." ),
    new Array( "80041925", "HXR_SE_AUTH_NO_SUCH_USER", "Registration failed, the specified user does not exist." ),
    new Array( "80041926", "HXR_SE_AUTH_REGISTRATION_SUCCEEDED", "You have successfully registered." ),
    new Array( "80041927", "HXR_SE_AUTH_REGISTRATION_FAILED", "Registration failed, contact your content provider for assistance." ),
    new Array( "80041928", "HXR_SE_AUTH_REGISTRATION_GUID_REQUIRED", "You must enable GUIDs in your player preferences. For more info on GUIDs and privacy, please search RealNetworks' website." ),
    new Array( "80041929", "HXR_SE_AUTH_UNREGISTERED_PLAYER", "You must register your ra/ve player before viewing this content. Please contact your content provider for assistance." ),
    new Array( "8004192a", "HXR_SE_AUTH_TIME_EXPIRED", "Your account has expired, contact your content provider for more information." ),
    new Array( "8004192b", "HXR_SE_AUTH_NO_TIME_LEFT", "Your account has expired, contact your content provider for more information." ),
    new Array( "8004192c", "HXR_SE_AUTH_ACCOUNT_LOCKED", "Your account has been locked, contact your content provider for more information." ),
    new Array( "8004192d", "HXR_SE_AUTH_INVALID_SERVER_CFG", "This commerce server has been configured incorrectly, and is unable to serve secure content. Please contact the Site Administrator for assistance." ),
    new Array( "8004192e", "HXR_SE_NO_MOBILE_DOWNLOAD", "This server does not support mobile download." ),
    new Array( "8004192f", "HXR_SE_NO_MORE_MULTI_ADDR", "File not found" ),
    new Array( "80041930", "HXR_PE_PROXY_MAX_CONNECTIONS", "A proxy has exceeded its maximum number of connections. Please try again later." ),
    new Array( "80041931", "HXR_PE_PROXY_MAX_GW_BANDWIDTH", "A proxy has exceeded its maximum gateway bandwidth. Please try again later." ),
    new Array( "80041932", "HXR_PE_PROXY_MAX_BANDWIDTH", "A proxy has exceeded its maximum bandwidth. Please try again later." ),
    new Array( "80041933", "HXR_SE_BAD_LOADTEST_PASSWORD", "You have entered an incorrect load test password or load testing is not enabled." ),
    new Array( "80041934", "HXR_SE_PNA_NOT_SUPPORTED", "PNA protocol not supported by this server." ),
    new Array( "80041935", "HXR_PE_PROXY_ORIGIN_DISCONNECTED", "Proxy to origin server connection lost" ),
    new Array( "80041936", "HXR_SE_INTERNAL_ERROR", "Unable to play request. Internal stream error." ),
    new Array( "80041937", "HXR_SE_MAX_VALUE", "" ),
    // Proxy Error Messages
    new Array( "80040680", "HXR_PE_BAD_REQUEST", "Bad Request (Proxy Error)" ),
    new Array( "80040681", "HXR_PE_UNAUTHORIZED", "Unauthorized Access (Proxy Error)" ),
    new Array( "80040682", "HXR_PE_PAYMENT_REQUIRED", "Payment Required (Proxy Error)" ),
    new Array( "80040683", "HXR_PE_FORBIDDEN", "Forbidden (Proxy Error)" ),
    new Array( "80040684", "HXR_PE_NOT_FOUND", "Not Found (Proxy Error)" ),
    new Array( "80040685", "HXR_PE_METHOD_NOT_ALLOWED", "Method Not Allowed (Proxy Error)" ),
    new Array( "80040686", "HXR_PE_NOT_ACCEPTABLE", "Not Acceptable (Proxy Error)" ),
    new Array( "80040687", "HXR_PE_PROXY_AUTHENTICATION_REQUIRED", "Proxy Authentication Required (Proxy Error)" ),
    new Array( "80040688", "HXR_PE_REQUEST_TIMEOUT", "Requrest Time-out (Proxy Error)" ),
    new Array( "80040689", "HXR_PE_GONE", "Gone (Proxy Error)" ),
    new Array( "8004068a", "HXR_PE_LENGTH_REQUIRED", "Length Required (Proxy Error)" ),
    new Array( "8004068b", "HXR_PE_PRECONDITION_FAILED", "Precondition Failed (Proxy Error)" ),
    new Array( "8004068c", "HXR_PE_REQUEST_ENTITY_TOO_LARGE", "Request Entity Too Large (Proxy Error)" ),
    new Array( "8004068d", "HXR_PE_REQUESTURI_TOO_LARGE", "Request-URI Too Large (Proxy Error)" ),
    new Array( "8004068e", "HXR_PE_UNSUPPORTED_MEDIA_TYPE", "Unsupported Media Type (Proxy Error)" ),
    new Array( "8004068f", "HXR_PE_PARAMETER_NOT_UNDERSTOOD", "Parameter Not Understood (Proxy Error)" ),
    new Array( "80040690", "HXR_PE_CONFERENCE_NOT_FOUND", "Conference Not Found (Proxy Error)" ),
    new Array( "80040691", "HXR_PE_NOT_ENOUGH_BANDWIDTH", "Not Enough Bandwidth (Proxy Error)" ),
    new Array( "80040962", "HXR_PE_SESSION_NOT_FOUND", "Session Not Found (Proxy Error)" ),
    new Array( "80040693", "HXR_PE_METHOD_NOT_VALID_IN_THIS_STATE", "Method Not Valid In This State (Proxy Error)" ),
    new Array( "80040694", "HXR_PE_HEADER_FIELD_NOT_VALID_FOR_RESOURCE", "Header Field Not Valid For Resource (Proxy Error)" ),
    new Array( "80040695", "HXR_PE_INVALID_RANGE", "Invalid Range (Proxy Error)" ),
    new Array( "80040696", "HXR_PE_PARAMETER_IS_READONLY", "Parameter Is Read-Only (Proxy Error)" ),
    new Array( "80040697", "HXR_PE_AGGREGATE_OPERATION_NOT_ALLOWED", "Aggregate Operation Not Allowed (Proxy Error)" ),
    new Array( "80040698", "HXR_PE_ONLY_AGGREGATE_OPERATION_ALLOWED", "Only Aggregate Operation Allowed (Proxy Error)" ),
    new Array( "80040699", "HXR_PE_UNSUPPORTED_TRANSPORT", "Unsupported Transport (Proxy Error)" ),
    new Array( "8004069a", "HXR_PE_DESTINATION_UNREACHABLE", "Desination Unreachable (Proxy Error)" ),
    new Array( "8004069b", "HXR_PE_INTERNAL_SERVER_ERROR", "Internal Server Error (Proxy Error)" ),
    new Array( "8004069c", "HXR_PE_NOT_IMPLEMENTED", "Not Implemented (Proxy Error)" ),
    new Array( "8004069d", "HXR_PE_BAD_GATEWAY", "Bad Gateway (Proxy Error)" ),
    new Array( "8004069e", "HXR_PE_SERVICE_UNAVAILABLE", "Service Unavailable (Proxy Error)" ),
    new Array( "8004069f", "HXR_PE_GATEWAY_TIMEOUT", "Gateway Time-out (Proxy Error)" ),
    new Array( "800406a0", "HXR_PE_RTSP_VERSION_NOT_SUPPORTED", "RTSP Version Not Supported (Proxy Error)" ),
    new Array( "800406a1", "HXR_PE_OPTION_NOT_SUPPORTED", "Option Not Supported (Proxy Error)" ),
    // Socket Error Messages
    new Array( "80040600", "HXR_SOCK_INTR", "Interrupted Function Call" ),
    new Array( "80040601", "HXR_SOCK_BADF", "The file handle supplied is not valid" ),
    new Array( "80040602", "HXR_SOCK_ACCES", "Permission Denied" ),
    new Array( "80040603", "HXR_SOCK_FAULT", "Bad Address" ),
    new Array( "80040604", "HXR_SOCK_INVAL", "Invalid Argument" ),
    new Array( "80040605", "HXR_SOCK_MFILE", "Too Many Open Files" ),
    new Array( "80040606", "HXR_SOCK_WOULDBLOCK", "Resource Temporarily Unavailable" ),
    new Array( "80040607", "HXR_SOCK_INPROGRESS", "Operaion Now In Progress" ),
    new Array( "80040608", "HXR_SOCK_ALREADY", "Operation Already In Progress" ),
    new Array( "80040609", "HXR_SOCK_NOTSOCK", "Socket Operation on Non-Socket" ),
    new Array( "8004060a", "HXR_SOCK_DESTADDRREQ", "Destination Address Required" ),
    new Array( "8004060b", "HXR_SOCK_MSGSIZE", "Message Too Long" ),
    new Array( "8004060c", "HXR_SOCK_PROTOTYPE", "Protocol Wrong Type for Socket" ),
    new Array( "8004060d", "HXR_SOCK_NOPROTOOPT", "Bad Protocol Option" ),
    new Array( "8004060e", "HXR_SOCK_PROTONOSUPPORT", "Protocol Not Supported" ),
    new Array( "8004060f", "HXR_SOCK_SOCKTNOSUPPORT", "Socket Type Not Supported" ),
    new Array( "80040610", "HXR_SOCK_OPNOTSUPP", "Operation Not Supported" ),
    new Array( "80040611", "HXR_SOCK_PFNOSUPPORT", "Protocol Family Not Supported" ),
    new Array( "80040612", "HXR_SOCK_AFNOSUPPORT", "Address Family Not Supported" ),
    new Array( "80040613", "HXR_SOCK_ADDRINUSE", "Address Already In Use" ),
    new Array( "80040614", "HXR_SOCK_ADDRNOTAVAIL", "Cannot Assign Requested Address" ),
    new Array( "80040615", "HXR_SOCK_NETDOWN", "Network is Down" ),
    new Array( "80040616", "HXR_SOCK_NETUNREACH", "Network is Unreachable" ),
    new Array( "80040617", "HXR_SOCK_NETRESET", "Network Dropped Connection on Reset" ),
    new Array( "80040618", "HXR_SOCK_CONNABORTED", "Software Caused Connection Abort" ),
    new Array( "80040619", "HXR_SOCK_CONNRESET", "Connection Reset by Peer" ),
    new Array( "8004061a", "HXR_SOCK_NOBUFS", "No Buffer Space Available" ),
    new Array( "8004061b", "HXR_SOCK_ISCONN", "Socket Is Already Connected" ),
    new Array( "8004061c", "HXR_SOCK_NOTCONN", "Socket Is Not Connected" ),
    new Array( "8004061d", "HXR_SOCK_SHUTDOWN", "Cannot Send After Socket Shutdown:An attempt to send or receive data failed because the socket has already been shut down" ),
    new Array( "8004061e", "HXR_SOCK_TOOMANYREFS", "Too many references to some kernel object" ),
    new Array( "8004061f", "HXR_SOCK_TIMEDOUT", "A connection attempt failed because the connected party did not properly respond after a period of time" ),
    new Array( "80040620", "HXR_SOCK_CONNREFUSED", "No connection could be made because the target machine actively refused it" ),
    new Array( "80040621", "HXR_SOCK_LOOP", "Cannot translate name" ),
    new Array( "80040622", "HXR_SOCK_NAMETOOLONG", "Name component or name was too long" ),
    new Array( "80040623", "HXR_SOCK_HOSTDOWN", "A socket operation failed because the destination host was down" ),
    new Array( "80040624", "HXR_SOCK_HOSTUNREACH", "A socket operation was attempted to an unreachable host" ),
    new Array( "80040625", "HXR_SOCK_PIPE", "" ),
    new Array( "80040626", "HXR_SOCK_ENDSTREAM", "" ),
    new Array( "00040627", "HXR_SOCK_BUFFERED", "" ),
    new Array( "80040628", "HXR_SOCK_NOTEMPTY", "The directory is not empty" ),
    new Array( "80040629", "HXR_SOCK_PROCLIM", "The Winsock implementation has exceeded the number of applications it can use simultaneously" ),
    new Array( "8004062a", "HXR_SOCK_USERS", "There are too many users" ),
    new Array( "8004062b", "HXR_SOCK_DQUOT", "Disk quota exceeded" ),
    new Array( "8004062c", "HXR_SOCK_STALE", "File handle reference is no longer valid" ),
    new Array( "8004062d", "HXR_SOCK_REMOTE", "Too many levels of remote in path" ),
    new Array( "8004062e", "HXR_SOCK_SYSNOTREADY", "The underlying system to provide network services is unavailable" ),
    new Array( "8004062f", "HXR_SOCK_VERNOTSUPPORTED", "The Winsock implementation does not support the requested Winsock version" ),
    new Array( "80040630", "HXR_SOCK_NOTINITIALISED", "The calling application has not successfully called WSAStartup to initiate a Winsock session" ),
    new Array( "80040631", "HXR_SOCK_DISCON", "The remote party has initiated a graceful shutdown sequence" ),
    new Array( "80040632", "HXR_SOCK_NOMORE", "There is no more data available" ),
    new Array( "80040633", "HXR_SOCK_CANCELLED", "The call has been cancelled" ),
    new Array( "80040634", "HXR_SOCK_INVALIDPROCTABLE", "The procedure call table is invalid" ),
    new Array( "80040635", "HXR_SOCK_INVALIDPROVIDER", "Invalid service provider version number" ),
    new Array( "80040636", "HXR_SOCK_PROVIDERFAILEDINIT", "Unable to initialize a service provider" ),
    new Array( "80040637", "HXR_SOCK_SYSCALLFAILURE", "System call failure" ),
    new Array( "80040638", "HXR_SOCK_SERVICE_NOT_FOUND", "Service not found" ),
    new Array( "80040639", "HXR_SOCK_TYPE_NOT_FOUND", "The specified class was not found" ),
    new Array( "8004063a", "HXR_SOCK_E_NO_MORE", "There is no more data available" ),
    new Array( "80040633", "HXR_SOCK_E_CANCELLED", "The call has been cancelled" ),
    new Array( "8004063b", "HXR_SOCK_REFUSED", "A database query failed because it was actively refused" ),
    new Array( "8004063c", "HXR_SOCK_HOST_NOT_FOUND", "No such host is known" ),
    new Array( "8004063d", "HXR_SOCK_TRY_AGAIN", "Local server did not receive a response from an authoritative server" ),
    new Array( "8004063e", "HXR_SOCK_NO_RECOVERY", "This is a nonrecoverable error" ),
    new Array( "8004063f", "HXR_SOCK_NO_DATA", "Valid name, no data record of requested type" ),
    new Array( "80040640", "HXR_RSLV_NONAME", "Server name did not resolve. The link is likely invalid." ),
    new Array( "80040641", "HXR_RSLV_NODATA", "" ),
    // rave UI Failed To Load Error
    new Array( "800406c0", "HXR_RAVE_UI_FAIL", "The required interface for this content cannot be shown.  Please contact the server administrator." ) );

function RaveError( inError )
{
    // Declare our member variables.
    var hxErrorObj;    // The input HX Error object if an object is passed in.
    var errorCode;	   // Raw error number
    var hxErrorCode;   // Base 16 converted code
    var errorConstant; // The HX Error Constant
    var errorString;   // The Error Text String
    var exceptionErr;  // If a try/catch block is triggered, exception string will be stored here.
    // Initialize the variables as part of the object.
    this.hxErrorObj = "";
    this.errorCode = "";
    this.hxErrorCode = "";
    this.errorConstant = "";
    this.errorString = "";
    this.exceptionErr = "";
    this.setError( inError );
}

// Define the objects interface
RaveError.prototype = {
    setError : function( inError )
    {
        /*
            inError may be either the HXError object passed into the OnError callback
            or it may be the HXError.code property of the HXError object. The RaveError
            will check the input value for type and will handle it accordingly.
        */
        try
        {
            var errorData = null;
            var base16Code = null;
            if ( typeof( inError ) == "string" ) inError = parseInt( inError );
            if ( typeof( inError ) == "number" )
            {
                this.errorCode = inError;
                base16Code = this.toHex( inError );
            }
            else if ( typeof( inError ) == "object" )
            {
                var errNum = inError.Code;
                this.hxErrorObj = inError;
                this.errorCode = inError.Code;
                base16Code = this.toHex( errNum );
            }
            else if ( inError.Code )
            {
                // Fix for Safari. Apparently it does not see an HXError object as an actual JavaScript object...
                var errNum = inError.Code;
                this.hxErrorObj = inError;
                this.errorCode = inError.Code;
                base16Code = this.toHex( errNum );
            }
            if ( base16Code )
            {
                errorData = this.getErrorData( base16Code );
                if ( ( errorData ) && ( errorData.length ) && ( errorData.length == 3 ) )
                {
                    this.hxErrorCode = base16Code;
                    this.errorConstant = errorData[1];
                    if ( errorData[2] != "" ) this.errorString = errorData[2];
                    else this.errorString = errorData[1]; // For now, if no error string is defined, we will return the HX_XXX error constant.
                }
                else
                {
                    this.errorCode = "";
                    this.hxErrorCode = base16Code;
                    this.errorConstant = "";
                    this.errorString = "An unknown error has occured.";
                }
            }
        }
        catch (err)
        {
            this.exceptionErr = err.description;
        }
    },
    
    // Convert HXError Object codes to base 16 string
    toHex : function( inCode )
    {
        var base16val = "";
        try
        {
            if ( typeof( inCode == "string" ) ) inCode = parseInt( inCode );
            base16val = inCode.toString(16);
        }
        catch (err)
        {
            this.exceptionErr = err.description;
        }
        return base16val;
    },
    
    // inCode must be the actual base 16 error code number
    // Do not call directly. Instead use SetError() or the
    // RaveError constructor.
    getErrorData : function( inCode )
    {
        var outData = null;
        try
        {
            for ( i = 0; i < HXErrorDefTable.length; i++ )
            {
                var tmpData = HXErrorDefTable[i];
                if ( tmpData[0] == inCode ) return tmpData;
            }
        }
        catch (err)
        {
            this.exceptionErr = err.description;
        }
        return outData;
    },
    // get the error string for the HXError code.
    getErrorString : function()
    {
        return this.errorString;
    },
    // get the base 16 error code.
    getErrorCode : function()
    {
        return this.hxErrorCode;
    },
    // get the HX_XXX_XXX error constant.
    getErrorConstant : function()
    {
        return this.errorConstant;
    },
    // if there was an error during the error conversion process, this
    // function returns the error message or caught excpetion message.
    getExceptionMsg : function()
    {
        return this.exceptionErr;
    }
}
