///////////////////////////////////////////////////////////////
//                                                           //
// Sprite Ctrl JavaScript Version 1.6.1.0 - 20031120         //
//                                                           //
//                                 Programming By Lance Moon //
//                                                           //
///////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////
// Global Variable

//var g_ActiveX = null;
//var g_AvatarNodes = null;
//var g_CurrentAvatarID = -1;


///////////////////////////////////////////////////////////////
// JS - Javascript related function

// XMLHTTP

var g_XMLHttp, alerted

/*@cc_on @*/
/*@if (@_jscript_version >= 5)

	// JScript gives us Conditional compilation, we can cope with old IE versions.
	try
	{
		g_XMLHttp=new ActiveXObject("Msxml2.XMLHTTP")
	}
	catch (e)
	{
		try
		{
			g_XMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
		catch (E)
		{
			JS_Message("You must have Microsoft XML parsers available")
		}
	}
	
@else

	JS_Message("You must have JScript version 5 or above.")
	g_XMLHttp=false
	alerted=true
	
@end @*/

if( !g_XMLHttp && !alerted )
{
	// Non ECMAScript Ed. 3 will error here (IE<5 ok), nothing I can 
	// realistically do about it, blame the w3c or ECMA for not
	// having a working versioning capability in  <SCRIPT> or ECMAScript.
	
	try
	{
		g_XMLHttp = new XMLHttpRequest();
	}
	catch( e )
	{
		alert( "You need a browser which supports an XMLHttpRequest Object.\nMozilla build 0.9.5 has this Object and IE5 and above" )
	}
}


// XMLDOM

var g_XMLDom = new ActiveXObject('Microsoft.XMLDOM');
g_XMLDom.async = false;
g_XMLDom.resolveExternals = false;

function JS_ParseXML( xmlstring )
{
	if( g_XMLDom.loadXML( xmlstring ) )
	{
		return g_XMLDom.documentElement;
	}
	else
	{
		var error = g_XMLDom.parseError;
		
		if ( error.srcText != "" )
		{
			var errorinfo = error.srcText + '\n';
			errorinfo += "Reason : " + error.reason;
			errorinfo += "\nLine : " + error.line + ", position : " + error.linepos + '\n';
			alert( errorinfo + "\nFailed To Parse XML String - ");	
		}
	}
}