/////////////////////////////////////////////////////////////////////////////////////////
//////////////////// Update Parse XML Function for Cobalt//////////////////////////////
//////////////////// Copyright (c) 2009-2010 Tropper Technologies, Inc. /////////////////
//////////////////// www.troppertech.com ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////

function parseXmlDoc()
{

	//alert ("In parseXmlData()");
	
	var data = "";
	
	var myNodeList = null;


	myNodeList = xmlDoc.getElementsByTagName("packet");

	
	// Zero-based index		
	PacketNumber = myNodeList[0].childNodes[0].firstChild.nodeValue; // packetnumber
	TelephoneNumber = myNodeList[0].childNodes[1].firstChild.nodeValue; // telephonenumber
	Timestamp = myNodeList[0].childNodes[2].firstChild.nodeValue; // timestamp
	Longitude = myNodeList[0].childNodes[3].firstChild.nodeValue; // longitude
	Latitude = myNodeList[0].childNodes[4].firstChild.nodeValue; // latitude
	Speed = myNodeList[0].childNodes[5].firstChild.nodeValue; // speed
	NetworkOperatorName = myNodeList[0].childNodes[6].firstChild.nodeValue; // networkoperatorname	
	//MCC = myNodeList[0].childNodes[7].firstChild.nodeValue; // mcc	
	//MNC = myNodeList[0].childNodes[8].firstChild.nodeValue; // mnc	
	NetworkTechnology = myNodeList[0].childNodes[9].firstChild.nodeValue; // networktechnology
	Power = myNodeList[0].childNodes[10].firstChild.nodeValue; // power	
	Power_Max = myNodeList[0].childNodes[11].firstChild.nodeValue; // power_max	
	Power_Min = myNodeList[0].childNodes[12].firstChild.nodeValue; // power_min		
	CallState = myNodeList[0].childNodes[13].firstChild.nodeValue; // callstate		
	DataDownloadingStatus = myNodeList[0].childNodes[14].firstChild.nodeValue; // DataDownloadingStatus	
	TotalFilesToBeTested = myNodeList[0].childNodes[15].firstChild.nodeValue; // TotalFilesToBeTested		
	FileIndex = myNodeList[0].childNodes[16].firstChild.nodeValue; // FileIndex	
	DownloadInterval = myNodeList[0].childNodes[17].firstChild.nodeValue; // DownloadInterval	
	DownloadDataRateFile = myNodeList[0].childNodes[18].firstChild.nodeValue; // DownloadDataRateFile	
	DownloadDataRateAvg = myNodeList[0].childNodes[19].firstChild.nodeValue; // DownloadDataRateAvg	
	DownloadDataIOExceptions = myNodeList[0].childNodes[20].firstChild.nodeValue; // DownloadDataIOExceptions	
	DownloadDataRateMax = myNodeList[0].childNodes[21].firstChild.nodeValue; // DownloadDataRateMax
	DownloadDataRateMin = myNodeList[0].childNodes[22].firstChild.nodeValue; // DownloadDataRateMin	
	UploadDataRateFile = myNodeList[0].childNodes[23].firstChild.nodeValue; // UploadDataRateFile	
	UploadDataRateAvg = myNodeList[0].childNodes[24].firstChild.nodeValue; // UploadDataRateAvg	
	UploadDataIOExceptions = myNodeList[0].childNodes[25].firstChild.nodeValue; // UploadDataIOExceptions	
	UploadDataRateMax = myNodeList[0].childNodes[26].firstChild.nodeValue; // UploadDataRateMax	
	UploadDataRateMin = myNodeList[0].childNodes[27].firstChild.nodeValue; // UploadDataRateMin		
	LatencyDataRateFile = myNodeList[0].childNodes[28].firstChild.nodeValue; // LatencyDataRateFile	
	LatencyDataRateAvg = myNodeList[0].childNodes[29].firstChild.nodeValue; // LatencyDataRateAvg	
	LatencyDataIOExceptions = myNodeList[0].childNodes[30].firstChild.nodeValue; // LatencyDataIOExceptions		
	LatencyDataRateMax = myNodeList[0].childNodes[31].firstChild.nodeValue; // LatencyDataRateMax	
	LatencyDataRateMin = myNodeList[0].childNodes[32].firstChild.nodeValue; // LatencyDataRateMin		
	Latency_Ping_DataRateFile = myNodeList[0].childNodes[33].firstChild.nodeValue; // Latency_Ping_DataRateFile	
	Latency_Ping_DataRateAvg = myNodeList[0].childNodes[34].firstChild.nodeValue; // Latency_Ping_DataRateAvg	
	Latency_Ping_DataIOExceptions = myNodeList[0].childNodes[35].firstChild.nodeValue; // Latency_Ping_DataIOExceptions	
	Latency_Ping_DataRateMax = myNodeList[0].childNodes[36].firstChild.nodeValue; // Latency_Ping_DataRateMax	
	Latency_Ping_DataRateMin = myNodeList[0].childNodes[37].firstChild.nodeValue; // Latency_Ping_DataRateMin	
	CallDoctorStatus = myNodeList[0].childNodes[38].firstChild.nodeValue; // calldoctorstatus	
	CallDoctorOriginationAttempts = myNodeList[0].childNodes[39].firstChild.nodeValue; // calldoctororiginationattempts
	CallDoctorOriginationSuccesses = myNodeList[0].childNodes[40].firstChild.nodeValue; // calldoctororiginationsuccesses
	CallDoctorOriginationSetupTime = myNodeList[0].childNodes[41].firstChild.nodeValue; // calldoctororiginationsetuptime
	CallDoctorOriginationFailures = myNodeList[0].childNodes[42].firstChild.nodeValue; // calldoctororiginationfailures
	CallDoctorDroppedCalls = myNodeList[0].childNodes[43].firstChild.nodeValue; // calldoctordroppedcalls	
	SVAD = myNodeList[0].childNodes[44].firstChild.nodeValue; // svad		
	DataPushIOSuccesses = myNodeList[0].childNodes[45].firstChild.nodeValue; // datapushiosuccesses
	DataPushIOExceptions = myNodeList[0].childNodes[46].firstChild.nodeValue; // datapushioexceptions	
	DataPushTimeout = myNodeList[0].childNodes[47].firstChild.nodeValue; // datapushtimeout	
	CellID = myNodeList[0].childNodes[48].firstChild.nodeValue; // cellid
	LAC = myNodeList[0].childNodes[49].firstChild.nodeValue; // lac	
	BaseStationLon = myNodeList[0].childNodes[50].firstChild.nodeValue; // BaseStationLon	
	BaseStationLat = myNodeList[0].childNodes[51].firstChild.nodeValue; // BaseStationLat		
	NeighborCount = myNodeList[0].childNodes[52].firstChild.nodeValue; // neighborcount
	Neighbor_ID_RSSI_Array[0] = myNodeList[0].childNodes[53].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[0]
	Neighbor_ID_RSSI_Array[1] = myNodeList[0].childNodes[54].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[1]
	Neighbor_ID_RSSI_Array[2] = myNodeList[0].childNodes[55].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[2]
	Neighbor_ID_RSSI_Array[3] = myNodeList[0].childNodes[56].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[3]
	Neighbor_ID_RSSI_Array[4] = myNodeList[0].childNodes[57].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[4]
	Neighbor_ID_RSSI_Array[5] = myNodeList[0].childNodes[58].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[5]
	Neighbor_ID_RSSI_Array[6] = myNodeList[0].childNodes[59].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[6]
	Neighbor_ID_RSSI_Array[7] = myNodeList[0].childNodes[60].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[7]
	Neighbor_ID_RSSI_Array[8] = myNodeList[0].childNodes[61].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[8]
	Neighbor_ID_RSSI_Array[9] = myNodeList[0].childNodes[62].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[9]	
	Neighbor_ID_RSSI_Array[10] = myNodeList[0].childNodes[63].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[10]
	Neighbor_ID_RSSI_Array[11] = myNodeList[0].childNodes[64].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[11]
	Neighbor_ID_RSSI_Array[12] = myNodeList[0].childNodes[65].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[12]
	Neighbor_ID_RSSI_Array[13] = myNodeList[0].childNodes[66].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[13]
	Neighbor_ID_RSSI_Array[14] = myNodeList[0].childNodes[67].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[14]
	Neighbor_ID_RSSI_Array[15] = myNodeList[0].childNodes[68].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[15]
	Neighbor_ID_RSSI_Array[16] = myNodeList[0].childNodes[69].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[16]
	Neighbor_ID_RSSI_Array[17] = myNodeList[0].childNodes[70].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[17]
	Neighbor_ID_RSSI_Array[18] = myNodeList[0].childNodes[71].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[18]
	Neighbor_ID_RSSI_Array[19] = myNodeList[0].childNodes[72].firstChild.nodeValue; // Neighbor_ID_RSSI_Array[19]	
	//RadioBufferDataRaw = myNodeList[0].childNodes[73].firstChild.nodeValue; // RadioBufferDataRaw		
	PhoneManufacturer = myNodeList[0].childNodes[74].firstChild.nodeValue; // phonemanufacturer
	PhoneDevice = myNodeList[0].childNodes[75].firstChild.nodeValue; // phonedevice	
	PhoneName = myNodeList[0].childNodes[76].firstChild.nodeValue; // phonename
	FieldTestMode_Array[0] = myNodeList[0].childNodes[77].firstChild.nodeValue; // FieldTestMode_Array[0]
	FieldTestMode_Array[1] = myNodeList[0].childNodes[78].firstChild.nodeValue; // FieldTestMode_Array[1]
	FieldTestMode_Array[2] = myNodeList[0].childNodes[79].firstChild.nodeValue; // FieldTestMode_Array[2]
	FieldTestMode_Array[3] = myNodeList[0].childNodes[80].firstChild.nodeValue; // FieldTestMode_Array[3]
	FieldTestMode_Array[4] = myNodeList[0].childNodes[81].firstChild.nodeValue; // FieldTestMode_Array[4]	
	FieldTestMode_Array[5] = myNodeList[0].childNodes[82].firstChild.nodeValue; // FieldTestMode_Array[5]
	FieldTestMode_Array[6] = myNodeList[0].childNodes[83].firstChild.nodeValue; // FieldTestMode_Array[6]
	FieldTestMode_Array[7] = myNodeList[0].childNodes[84].firstChild.nodeValue; // FieldTestMode_Array[7]
	FieldTestMode_Array[8] = myNodeList[0].childNodes[85].firstChild.nodeValue; // FieldTestMode_Array[8]
	FieldTestMode_Array[9] = myNodeList[0].childNodes[86].firstChild.nodeValue; // FieldTestMode_Array[9]	
	FieldTestMode_Array[10] = myNodeList[0].childNodes[87].firstChild.nodeValue; // FieldTestMode_Array[10]
	FieldTestMode_Array[11] = myNodeList[0].childNodes[88].firstChild.nodeValue; // FieldTestMode_Array[11]
	FieldTestMode_Array[12] = myNodeList[0].childNodes[89].firstChild.nodeValue; // FieldTestMode_Array[12]
	FieldTestMode_Array[13] = myNodeList[0].childNodes[90].firstChild.nodeValue; // FieldTestMode_Array[13]
	FieldTestMode_Array[14] = myNodeList[0].childNodes[91].firstChild.nodeValue; // FieldTestMode_Array[14]	
	FieldTestMode_Array[15] = myNodeList[0].childNodes[92].firstChild.nodeValue; // FieldTestMode_Array[15]
	FieldTestMode_Array[16] = myNodeList[0].childNodes[93].firstChild.nodeValue; // FieldTestMode_Array[16]
	FieldTestMode_Array[17] = myNodeList[0].childNodes[94].firstChild.nodeValue; // FieldTestMode_Array[17]
	FieldTestMode_Array[18] = myNodeList[0].childNodes[95].firstChild.nodeValue; // FieldTestMode_Array[18]
	FieldTestMode_Array[19] = myNodeList[0].childNodes[96].firstChild.nodeValue; // FieldTestMode_Array[19]	
	FieldTestMode_Array[20] = myNodeList[0].childNodes[97].firstChild.nodeValue; // FieldTestMode_Array[20]
	FieldTestMode_Array[21] = myNodeList[0].childNodes[98].firstChild.nodeValue; // FieldTestMode_Array[21]
	FieldTestMode_Array[22] = myNodeList[0].childNodes[99].firstChild.nodeValue; // FieldTestMode_Array[22]
	FieldTestMode_Array[23] = myNodeList[0].childNodes[100].firstChild.nodeValue; // FieldTestMode_Array[23]
	FieldTestMode_Array[24] = myNodeList[0].childNodes[101].firstChild.nodeValue; // FieldTestMode_Array[24]	
	FieldTestMode_Array[25] = myNodeList[0].childNodes[102].firstChild.nodeValue; // FieldTestMode_Array[25]
	FieldTestMode_Array[26] = myNodeList[0].childNodes[103].firstChild.nodeValue; // FieldTestMode_Array[26]
	FieldTestMode_Array[27] = myNodeList[0].childNodes[104].firstChild.nodeValue; // FieldTestMode_Array[27]
	FieldTestMode_Array[28] = myNodeList[0].childNodes[105].firstChild.nodeValue; // FieldTestMode_Array[28]
	FieldTestMode_Array[29] = myNodeList[0].childNodes[106].firstChild.nodeValue; // FieldTestMode_Array[29]	
	FieldTestMode_Array[30] = myNodeList[0].childNodes[107].firstChild.nodeValue; // FieldTestMode_Array[30]
	FieldTestMode_Array[31] = myNodeList[0].childNodes[108].firstChild.nodeValue; // FieldTestMode_Array[31]
	FieldTestMode_Array[32] = myNodeList[0].childNodes[109].firstChild.nodeValue; // FieldTestMode_Array[32]
	FieldTestMode_Array[33] = myNodeList[0].childNodes[110].firstChild.nodeValue; // FieldTestMode_Array[33]
	FieldTestMode_Array[34] = myNodeList[0].childNodes[111].firstChild.nodeValue; // FieldTestMode_Array[34]	
	FieldTestMode_Array[35] = myNodeList[0].childNodes[112].firstChild.nodeValue; // FieldTestMode_Array[35]
	FieldTestMode_Array[36] = myNodeList[0].childNodes[113].firstChild.nodeValue; // FieldTestMode_Array[36]
	FieldTestMode_Array[37] = myNodeList[0].childNodes[114].firstChild.nodeValue; // FieldTestMode_Array[37]
	FieldTestMode_Array[38] = myNodeList[0].childNodes[115].firstChild.nodeValue; // FieldTestMode_Array[38]
	FieldTestMode_Array[39] = myNodeList[0].childNodes[116].firstChild.nodeValue; // FieldTestMode_Array[39]
	

	 //Data_Collection_Mechanism = myNodeList[0].childNodes[117].firstChild.nodeValue; // Data_Collection_Mechanism
	// Data_Collection_Mechanism is not a declared variable in Cobalt -- This is just a placeholder here 
	
	
	
SpeedArray[0] = SpeedArray[1];
SpeedArray[1] = SpeedArray[2];
SpeedArray[2] = SpeedArray[3];
SpeedArray[3] = SpeedArray[4];
SpeedArray[4] = Speed;	
	
DownloadDataRateFileArray[0] = DownloadDataRateFileArray[1];
DownloadDataRateFileArray[1] = DownloadDataRateFileArray[2];
DownloadDataRateFileArray[2] = DownloadDataRateFileArray[3];
DownloadDataRateFileArray[3] = DownloadDataRateFileArray[4];
DownloadDataRateFileArray[4] = DownloadDataRateFile;

UploadDataRateFileArray[0] = UploadDataRateFileArray[1];
UploadDataRateFileArray[1] = UploadDataRateFileArray[2];
UploadDataRateFileArray[2] = UploadDataRateFileArray[3];
UploadDataRateFileArray[3] = UploadDataRateFileArray[4];
UploadDataRateFileArray[4] = UploadDataRateFile;

DataPushLatencyPacketArray[0] = DataPushLatencyPacketArray[1];
DataPushLatencyPacketArray[1] = DataPushLatencyPacketArray[2];
DataPushLatencyPacketArray[2] = DataPushLatencyPacketArray[3];
DataPushLatencyPacketArray[3] = DataPushLatencyPacketArray[4];
DataPushLatencyPacketArray[4] = LatencyDataRateFile;	

DataPushLatency_Ping_PacketArray[0] = DataPushLatency_Ping_PacketArray[1];
DataPushLatency_Ping_PacketArray[1] = DataPushLatency_Ping_PacketArray[2];
DataPushLatency_Ping_PacketArray[2] = DataPushLatency_Ping_PacketArray[3];
DataPushLatency_Ping_PacketArray[3] = DataPushLatency_Ping_PacketArray[4];
DataPushLatency_Ping_PacketArray[4] = Latency_Ping_DataRateFile;	


PowerArray[0] = PowerArray[1];
PowerArray[1] = PowerArray[2];
PowerArray[2] = PowerArray[3];
PowerArray[3] = PowerArray[4];
PowerArray[4] = Power;	



	
}
