<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="MyDungeonRunner" 
title_url="http://hosting.gmodules.com//ig/creator?url=http://hosting.gmodules.com/ig/gadgets/file/116650004683272111876/my_dr.xml"
description="__MSG_description__"
author="Jeff Freeman"
author_email="jeff.freeman@gmail.com"
author_link="http://mythicalblog.com/"
thumbnail="http://hosting.gmodules.com/ig/gadgets/file/116650004683272111876/dr_thumb.png"
height="315"
width="260"
screenshot="/ig/gadgets/file/116650004683272111876/dr_screen.png"
scaling="true"
singleton="false" >
<MayRequire type="browser" value="firefox" min_version="2.0"/>
<Require feature="setprefs"/>
<Require feature="tabs" />
<Require feature="settitle"/>
</ModulePrefs>
<UserPref name="fetchName" display_name="Character Name" default_value="dundee" />
<UserPref name="backImg" display_name="Background Image" default_value="/ig/gadgets/file/116650004683272111876/dr_guy.png" />
<UserPref name="brightText" display_name="Bright Text" default_value="#FFFFFF" />
<UserPref name="dullText" display_name="Dull Text" default_value="#cecece" />
<Content type="html" ><![CDATA[
<style type="text/css" >

#popup__MODULE_ID__ {
	background-color:ivory;
color:black;
}

#link__MODULE_ID__ a:link {
color:yellow;
	text-decoration: none;
	font-weight: bold;
}

#link__MODULE_ID__ a:hover {
color: #f17D11;
	text-decoration: none;
	font-weight: bold;
}

#link__MODULE_ID__ a:visited {
color: yellow;
	text-decoration: none;
	font-weight: bold;
}

#link__MODULE_ID__ a:visited:hover {
color: #f17D11;
	font-weight: bold;
}
</style>

<div id="popup__MODULE_ID__" style="width:220px;height:159px;border:none;position:absolute;top:75px;left:15px;">
<div id="content_div" style="cursor: pointer; overflow: hidden;">
<p>Loading...</p>
</div>
</div>

<script type="text/javascript">
var t1=null;
var l1 = new Array();
function doEverything() {
	function dump(arr,level,maxLevel) {
		var dumped_text = "";
		if(!level) level = 0;
		if(!maxLevel) maxLevel = 3;
		
		var level_padding = "";
		for(var j=0;j<level+1;j++)
			level_padding += " ";

		if(typeof(arr) == 'object') {
			for(var item in arr) {
				var value = arr[item];
				if(typeof(value) == 'object') {
					dumped_text += level_padding + "'" + item + "' ...\n";
					if (level < maxLevel) {
						dumped_text += dump(value,level+1,maxLevel);
					}
				} else {
					dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
				}
			}
		} else {
			dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
		}
		return dumped_text;
	}
	function ToolTip(id,isAnimated,aniSpeed) {
		var isInit = -1;
		var div,divWidth,divHeight;
		var xincr=10,yincr=10;
		var animateToolTip = false;
		var htmlTips;
		function initToolTip(id) {
			div = document.getElementById(id);
			if(div==null) return;
			divWidth = parseInt(div.style.width);
			divHeight= parseInt(div.style.height);
			if(div.style.overflow!="hidden")div.style.overflow="hidden";
			if(div.style.display!="none")div.style.display="none";
			if(div.style.position!="absolute")div.style.position="absolute";
			if(isAnimated && aniSpeed>0) {
				xincr = parseInt(divWidth/aniSpeed);
				yincr = parseInt(divHeight/aniSpeed);
				animateToolTip = true;
			}
			isInit++;
		}
		this.Show = function(e,strHTML)
		{
			if(isInit<0) return;
			var newPosx,newPosy,height,width;
			if(typeof( document.documentElement.clientWidth ) == 'number' ){
				width = document.body.clientWidth;
				height = document.body.clientHeight;}
			else
			{
				width = parseInt(window.innerWidth);
				height = parseInt(window.innerHeight);
			}
			var curPosx = (e.x)?parseInt(e.x):parseInt(e.clientX);
			var curPosy = (e.y)?parseInt(e.y):parseInt(e.clientY);
			if(strHTML!=null)
			{htmlTips= strHTML;
				div.innerHTML=htmlTips;}
			if(curPosx > (width/2))
			newPosx= 10;
			else
			newPosx = width-divWidth-10;
			if(curPosy > (height/2))
			newPosy= 10;
			else
			newPosy = height-divHeight-10;
			if(window.pageYOffset)
			{ newPosy= newPosy+ window.pageYOffset;
				newPosx = newPosx + window.pageXOffset;}
			else
			{ newPosy= newPosy+ document.body.scrollTop;
				newPosx = newPosx + document.body.scrollLeft;}
			div.style.display='block';
			div.style.top= newPosy + "px";
			div.style.left= newPosx+ "px";
			div.focus();
			if(animateToolTip){
				div.style.height= "0px";
				div.style.width= "0px";
				ToolTip.animate(div.id,divHeight,divWidth);}
		}
		this.Hide= function(e) {
			div.style.display='none';
			if(!animateToolTip)return;
			div.style.height= "0px";
			div.style.width= "0px";
		}
		this.SetHTML = function(strHTML) {
			htmlTips = strHTML;
			div.innerHTML=htmlTips;
		}
		ToolTip.animate = function(a,iHeight,iWidth) {
			a = document.getElementById(a);
			var i = parseInt(a.style.width)+xincr ;
			var j = parseInt(a.style.height)+yincr;
			if (i <= iWidth) {
				a.style.width = i+"px";
			} else {
				a.style.width = iWidth+"px";
			}
			if (j <= iHeight ) {
				a.style.height = j+"px";
			} else {
				a.style.height = iHeight+"px";
			}
			if ( !((i > iWidth) && (j > iHeight)) )
			setTimeout( "ToolTip.animate('"+a.id+"',"+iHeight+","+iWidth+")",1);
		}
		initToolTip(id);
	}

	var tabs = new _IG_Tabs(__MODULE_ID__, "Stats");
	var prefs = new _IG_Prefs( __MODULE_ID__ );
	var fetchName = prefs.getString("fetchName");
	var bg_img = prefs.getString("backImg");
	var brightText = "color:" + prefs.getString("brightText") + ";";
	var dullText = "color:" + prefs.getString("dullText") + ";";
	var url = "http://www.dungeonrunners.com/characters/" + fetchName;
	var charData = new Array();
	var attackData = new Array();
	var itemData = new Array();
	var skillData = new Array();
	const ITEM_NECK = '1';
	const ITEM_BRACER = '2';
	const ITEM_LEFT_RING = '3';
	const ITEM_RIGHT_RING = '4';
	const ITEM_HELM = '5';
	const ITEM_TORSO = '6';
	const ITEM_BOOT = '7';
	const ITEM_SHOULDER = '8';
	const ITEM_OFF_HAND = '9';
	const ITEM_PRIMARY_HAND = '10';
	const ATTACK_PRIMARY = 'primary';
	const ATTACK_SECONDARY = 'offhand';
	const QUALITY = [ "white", "grey", "green", "blue", "yellow", "purple", "sky", "rainbw" ];
	const QUALITY_COLOR = [ "#FFFFFF", "#736F6E", "#00FF00", "#306EFF", "#FFFF00", "#D462FF", "#A0CFEC", "#FFCCFF" ];
	const QUALITY_TITLE = [ "trash", "Normal", "Superior", "Magic", "Rare", "Unique", "Quest", "Mythical" ];
	const ICON_URL = "http://www.dungeonrunners.com/images/icons/";

	var not_whitespace = new RegExp(/[^\s]/);
	var parent_count;
	function xml2array(xmlDoc,parent_count) {
		function addAttributesToArray( attribArray ) {
			if(xmlDoc.childNodes[i].attributes.length) {
				for(var j=0; j<xmlDoc.childNodes[i].attributes.length; j++) {
					var nname = xmlDoc.childNodes[i].attributes[j].nodeName;
					if(nname) {
						attribArray[nname] = xmlDoc.childNodes[i].attributes[j].nodeValue;
					}
				}
			}
			return attribArray;
		}
		var arr;
		var parent = "";
		parent_count = parent_count || new Object;
		if(xmlDoc.nodeName && xmlDoc.nodeName.charAt(0) != "#") {
			if(xmlDoc.childNodes.length > 1) {
				arr = new Object;
				parent = xmlDoc.nodeName;
			}
		}
		var value = xmlDoc.nodeValue;
		if(xmlDoc.parentNode && xmlDoc.parentNode.nodeName && value) {
			if(not_whitespace.test(value)) {
				arr = new Object;
				arr[xmlDoc.parentNode.nodeName] = value;
			}
		}
		if(xmlDoc.childNodes.length) {
			if(xmlDoc.childNodes.length == 1) {
				arr = xml2array(xmlDoc.childNodes[0],parent_count);
			} else {
				var index = 0;
				for(var i=0; i<xmlDoc.childNodes.length; i++) {
					var temp = xml2array(xmlDoc.childNodes[i],parent_count);
					if(temp) {
						var assoc = false;
						var arr_count = 0;
						for(key in temp) {
							if(isNaN(key)) assoc = true;
							arr_count++;
							if(arr_count>2) break;
						}
						if(assoc && arr_count == 1) {
							if(arr[key]) {
								if(!parent_count || !parent_count[key]) {
									parent_count[key] = 0;
									var temp_arr = arr[key];
									arr[key] = new Object;
									arr[key][0] = temp_arr;
								}
								parent_count[key]++;
								arr[key][parent_count[key]] = addAttributesToArray( temp[key] );
							} else {
								parent_count[key] = 0;
								arr[key] = addAttributesToArray( temp[key] );
							}
						} else {
							arr[index] = addAttributesToArray( temp );
							index++;
						}
					}
				}
			}
		}
		if(parent && arr) {
			var temp = arr;
			arr = new Object;
			arr[parent] = temp;
		}
		return arr;
	}
  
	_IG_FetchXmlContent(url, function (response) {
		if (response == null || typeof(response) != "object" || response.firstChild == null) {
			_gel("content_div").innerHTML = "<a href'http://www.dungeonrunners.com/'><img alt='no reply from the server' src='" + bg_img + "'/></a>";
			return;
		};
 		function statsCallback(tabId) {
			function showAttribute( statName, innateValue, effectiveValue ) {
				html += "<td>" + statName + ": </td>";
				html += "<td><span style='font-size:14px'><b>" + effectiveValue + "</b></span><span style='" + dullText +
				";font-size=10px;'> (" + innateValue + ")</span></td>";
			}
			function displayPwns() {
				if ( charData['PVPWins'] != 0 ) {
					html += "<table align='center' style='width:100%;" + brightText + "font-size:12px;border:ridge 2px red;' cellspacing=4px><tr>";
					html += "<td style='text-align:center;border-bottom:none;" + brightText + "'><b>pwns</b></td></tr><tr>";
					html += "<td style='background-color:red;color:black;text-align:center;border-top:none;font-size:14px;'><b>" + charData['PVPWins'] + "</b></td>";
					html += "</tr></table>";
				} else if (itemData[ITEM_PRIMARY_HAND]){
					strIcon = itemData[ITEM_PRIMARY_HAND]['Icon'];
  					strIcon = strIcon.toLowerCase();
					imgTitle = itemData[ITEM_PRIMARY_HAND]['Name'];
					html += "<img width='24px' src='" + ICON_URL + strIcon + ".png";
					html += "' title='" + imgTitle + "' alt='[" + strIcon + "] '/>";
				}
			}
			function showWeapon( statValMin, statValMax, bgColor ) {
				html += "<td style='text-align:center;font-weight:bold;background-color:" + bgColor;
				if ( statValMax == -1 ) {
					html += ";font-size:12px;border:1px;border-style:inset;'>" + statValMin;
				} else {
					html += ";font-size:14px;border:0px;border-style:none;'>" + statValMin + "-" + statValMax;
				}
				html += "</td>";
			}
			function showElemStats( t, e ) {
				html += "<td style='text-align:left;font-size:12px'>" + t + "</td><td style='border:1px;border-style:inset;'>";
				html += e['Fire'] + "</td><td>";
				html += e['Ice'] + "</td><td style='border:1px;border-style:inset;'>";
				html += e['Poison'] + "</td><td>";
				html += e['Shadow'] + "</td><td style='border:1px;border-style:inset;'>";
				html += e['Divine'] + "</td>";
			}
			var p = document.createElement("p");
			var GenderImage = "background:url(/ig/gadgets/file/116650004683272111876/";
			if ( charData['Gender'] == "Male" ) {
				GenderImage += "male.png";
			} else {
				GenderImage += "female.png";
			};
			GenderImage += ");background-repeat: no-repeat;background-position: center left;"
			var html = "<p style='font-size:10px;font-family:Arial, Helvetica;background:url(" +
			bg_img + ");margin-top:-15px;width:100%;height:100%;' >";
			html += "<TABLE style='text-align:center;padding:10px;width:98%;" + brightText + "'>";
			html += "<tr><TD id=link__MODULE_ID__ style='text-align:left;font-size:16px;padding-left:22px;" + GenderImage;
			html += "'><b><a href='http://threeplanetssoftware.com/software/dr/" + charData['Name'];
			html += "' target='_blank' >" + charData['Name'] + "</a></b></TD>";
			html += "<TD style='text-align:right;'><span style='" + dullText + "'><em>level:</em></span> <b>" +
			charData['Level'] + "</b></TD></tr>";
			html += "<tr><TD colspan=2 style='text-align:center;font-size:10px;'><i><b>" +
			charData['Title'] + "</i></b></TD></tr>";
			html += "</TABLE>";
			html += "<table align='center' style='width:90%;" + brightText + "font-size:14px' cellspacing=0px>";
			html += "<td style='background-color:red;color:white;font-weight:bold;text-align:center'>" + charData['Attributes']['HP']+ "</td>";
			html += "<td style='text-align:left;font-size:10px;'>&nbsp;HP </td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td style='text-align:right;font-size:10px;'>Defense&nbsp;</td>";
			html += "<td style='background-color:yellow;color:black;font-weight:bold;text-align:center'>" + charData['Combat']['DefenseRating']+ "</td>";
			html += "</tr><tr><td style='background-color:blue;color:white;font-weight:bold;text-align:center'>" + charData['Attributes']['Mana'] + "</td>";
			html += "<td style='text-align:left;font-size:10px;'>&nbsp;Mana </td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td style='text-align:right;font-size:10px;'>Block&nbsp;</td>";
			html += "<td style='background-color:orange;color:black;font-weight:bold;text-align:center'>" + charData['Combat']['BlockChance']+ "</td></tr>";
			html += "</table>";
			html += "<table align='center' style='margin-top:5px;" + brightText + "font-size:14px' cellspacing=2px><tr>";
			showAttribute( 'STR', charData['Attributes']['Strength']['Innate'], charData['Attributes']['Strength']['Effective'] );
			html += "<td>&nbsp;</td>";
			showAttribute( 'AGI', charData['Attributes']['Agility']['Innate'], charData['Attributes']['Agility']['Effective'] );
			html += "</tr><tr>";
			showAttribute( 'END', charData['Attributes']['Endurance']['Innate'], charData['Attributes']['Endurance']['Effective'] );
			html += "<td>&nbsp;</td>";
			showAttribute( 'INT', charData['Attributes']['Intellect']['Innate'], charData['Attributes']['Intellect']['Effective'] );
			html += "</tr></table>";
			html += "<table align='center' style='" + brightText + ";margin-top:3px; ' cellpadding=2px cellspacing=2px>";
			html += "<COLGROUP><COL width='64'><COL width='40'><COL width='40'><COL width='40'>";
			html += "<tr style='" + brightText + "text-align:center;font-size:10;border:0px;border-style:none;'>";
			html += "<td style='border:none;background-color:transparent;' rowspan=3>";
			displayPwns();
			html += "</td><td>Attack</td><td>Damage</td><td>Speed</td></tr>";
			html += "<tr style='text-align:center;font-size:10;" + brightText + "'>";
			showWeapon( attackData[ATTACK_PRIMARY]['AttackRating'], -1 , "black" );
			showWeapon( attackData[ATTACK_PRIMARY]['MinDamage'], attackData[ATTACK_PRIMARY]['DamageMax'], "green" );
			showWeapon( attackData[ATTACK_PRIMARY]['AttackSpeed'], -1 , "black" );
			if ( attackData[ATTACK_SECONDARY]['AttackRating'] != 0 ) {
				html += "</tr><tr style='" + dullText + "text-align:center;font-size:10;'>";
				showWeapon( attackData[ATTACK_SECONDARY]['AttackRating'], -1, "black" );
				showWeapon( attackData[ATTACK_SECONDARY]['MinDamage'], attackData[ATTACK_SECONDARY]['DamageMax'], "green");
				showWeapon( attackData[ATTACK_SECONDARY]['AttackSpeed'], -1, "black" );
				html += "</tr></table>";
			} else {
				html += "</tr><tr><td colspan=3>&nbsp;</td></tr></table><br />";
			}
			html += "<table align='center' style='" + brightText + "; ' cellspacing=2px>";
			html += "<COLGROUP><COL width='2'><COLGROUP span='5' width='32'>";
			html += "<tr style='text-align:center;font-size:10;'>";
			html += "<td>&nbsp;</td><td>Fire</td><td>Ice</td><td>Poison</td><td>Shadow</td><td>Divine</td></tr><tr border='2px inset' style='font-size:10;text-align:center;'>";
			showElemStats( "Bonus:", charData['Combat']['ElementBonuses'] );
			html += "</tr><tr style='font-size:10;text-align:center;'>";
			showElemStats( "Resist", charData['Combat']['ElementResistances'] );
			html += "</tr></table>";
			html += "</p>";
			p.innerHTML = html;
			_gel(tabId).appendChild(p);
		};
		function skillsCallback(tabId) {
			function displaySkillImage(strIcon, skillTitle, marginSetting) {
				html += "<td><div style='z-index:0'><img src='" + ICON_URL + strIcon.toLowerCase() + bg_style + marginSetting;
				html += "' title='" + skillTitle + "' alt='[" + strIcon.toLowerCase() + "]' /></div></td>";
			}
			function displaySkillTitle(strName, skillTitle, marginSetting) {
				var strPageName = strName.replace(/ /g, "_")
				html += "<td id=link__MODULE_ID__ ><div style='z-index:1;" + marginSetting + "color:yellow;font-size:";
				if ( strName.length > 20 ) {
					html += "12px;";
				} else {
					html += "14px;";
				};
				html += "'><b><a target='_blank' href='http://www.thetownstons.com/thetownstons/index.php/" + strPageName + "' ";
				html += "title='" + skillTitle + "'>";
				html += strName + "</a></b></div></td>";
			}
			var p = document.createElement("p");
			var html = "<p style='margin-top:-15px;font-size:10px;font-family:Arial, Helvetica;width:100%;height:100%;"+
			"background:url(" + bg_img + ");' >";
			var bg_style = ".png' align='center' style='z-index:0;width=48px;height:48px;";
			html += "<table align='center' colpadding='2px' width='95%' style='font-size:10px;margin:5px 2% 2% 2%;padding:0px;'><tr>";
			var lastSkill=false;
			var evenNum = true;
			var snum = 0;
			for(key in skillData) {
				var strName = skillData[key]['Name'];
				var strIcon = skillData[key]['Icon'];
				var strLevel = skillData[key]['Level'];
				var skillTitle = strName + " [level " + strLevel + "]";
				if (evenNum) {
					displaySkillImage(strIcon, skillTitle, "margin-left:10%;" );
					displaySkillTitle(strName, skillTitle, "text-align:left;margin-left:-15%;margin-right:40%;");
				} else {
					displaySkillImage(strIcon, skillTitle, "margin-left:90%;" );
					displaySkillTitle(strName, skillTitle, "text-align:right;margin-right:95%;margin-left:-100%;");
					if ( snum != 9 ) {
						html += "</tr><tr>";
					} else if (snum==9) {
						html += "</tr>";
					}
				}
				evenNum = !evenNum;
				snum++;
			};
			html += "</table>";
			html += "</p>";
			p.innerHTML = html;
			_gel(tabId).appendChild(p);
		};
		function equipCallback(tabId) {
			function makeMoverTooltip( itemInfo ) {
				var qt = itemInfo['Quality'];
				var qualColor = "color:" + QUALITY_COLOR[qt] + ";";
				if ( qt==7 ) {
					qualColor = "color:black;background:url(/ig/gadgets/file/116650004683272111876/rainbow_hd.gif) white;";
				} else {
					qualColor += "background-color:black;'";
				}
				var itemName= itemInfo['Name'];
				var fsize = "12px;";
				if (itemName.length > 70 ) fsize = "10px;";
				var mHTML = "<table style='font-size:10px;width:100%;' cellspacing=0px cellpadding=2px'>";
				mHTML += "<tr style='text-align:left;font-size:" + fsize + qualColor + "' ><td colspan='3'><b>" + itemName;
				mHTML += "</b></td></tr><tr style='font-size:10px;text-align:center;font-weight:bold;background-color:#663300;color:#FFCC99'>";
				mHTML += "<td style='text-align:left;'>Level " + itemInfo['Level'];
				var sb = itemInfo['SoulBound'] == 'yes' ? "<i>Soulbound</i>" : "";
				mHTML += "</td><td style='text-align:center;color:#FFCCFF;'>" + sb;
				mHTML += "</td><td style='text-align:right;color:" + QUALITY_COLOR[qt];
				mHTML += ";'><b>" + QUALITY_TITLE[qt];
				mHTML += "</b></td></tr><tr><td style='font-size:10px;text-align:left' colspan='3'>";
				for (key in itemInfo['Mod']) {
					mHTML += itemInfo['Mod'][key] + "<br/>";
				};
				mHTML += "</tr></table>";
				return mHTML;
			}
			function displayItemIcon( itemObject, strStyle ) {
				if (itemData[itemObject]) {
					strIcon = itemData[itemObject]['Icon'];
					strIcon = strIcon.toLowerCase();
					strTitle = itemData[itemObject]['Name'];
					l1[itemObject] = makeMoverTooltip( itemData[ itemObject ]);
					html += "<span class='ttip' onmouseover=if(t1)t1.Show(event,l1["+itemObject+"]) onmouseout=if(t1)t1.Hide(event) >";
					html += "<img src='" + ICON_URL + strIcon + ".png'";
					html += " style='" + strStyle + "padding:0px; float:left;";
					html += "background:url(/ig/gadgets/file/116650004683272111876/" + QUALITY[ itemData[itemObject]['Quality'] ] + "_bg.png) white;";
					if ( itemData[itemObject]['SoulBound']=='yes' ) {
						html += "border:ridge 2px;";
					} else {
						html += "border:outset 2px;";
					}
					html += "border-color:" + QUALITY_COLOR[ itemData[itemObject]['Quality'] ];
					html += ";' /></span>";
				} else {
					if (itemObject == ITEM_OFF_HAND) {
						if (itemData[ITEM_PRIMARY_HAND]) {
							strIcon = itemData[ITEM_PRIMARY_HAND]['Icon'];
  							strIcon = strIcon.toLowerCase();
							strTitle = "(no secondary weapon)";
							html += "<img src='" + ICON_URL + strIcon + ".png'"
							+ " title='" + strTitle + "' alt='[" + strIcon + "]'"
							+ " style='" + strStyle + "padding:0px; float:left;border:outset 2px;"
							+ "-moz-opacity:0.7;filter:alpha(opacity:70);' />";
						}
					}
				}
			}
			var p = document.createElement("p");
			function formatGold( num ) {
				for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
				num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));
				return num;
			}
			var html = "<p style='margin-top:-15px;font-size:10px;font-family:Arial, Helvetica;width:100%;height:100%;"+
			"background:url(" + bg_img + ");' >";
			html += "<table align='left' style='width:60px;height:32px;" + brightText + "font-size:10px;position: absolute; left:12px; top:36px;border:inset 2px;' cellspacing=1px><tr>";
			html += "<td style='text-align:center;font-size:10px;border-bottom:none'><b>GOLD</b></td></tr><tr>";
			var goldVal = "none";
			if (charData['Equipment']['Gold']) goldVal = charData['Equipment']['Gold'];
			if (goldVal.length > 6) {
				goldVal = "<span title='" + formatGold( goldVal ) + "'>lots</a>";
			} else {
				goldVal = formatGold( goldVal );
			}
			html += "<td style='background-color:yellow;color:black;font-weight:bold;text-align:center;border-top:none;'>" + goldVal+ "</td>";
			html += "</tr></table>";
			displayItemIcon( ITEM_NECK, "position: absolute; left:78px; top:42px; height:32px; width:32px; ");
			displayItemIcon( ITEM_PRIMARY_HAND, "position: absolute; left:10px; top:83px; width:64px; ");
			displayItemIcon( ITEM_BRACER, "position: absolute; left:10px; top:238px; height:64px; width:64px; ");
			displayItemIcon( ITEM_HELM, "position: absolute; left:118px; top:27px; height:48px; width:48px; ");
			displayItemIcon( ITEM_TORSO, "position: absolute; left:84px; top:82px; height:160px; width:80px; ");
			displayItemIcon( ITEM_BOOT, "position: absolute; left:100px; top:248px; height:48px; width:48px; ");
			displayItemIcon( ITEM_RIGHT_RING, "position: absolute; left:175px; top:34px; height:32px; width: 32px; ");
			displayItemIcon( ITEM_LEFT_RING, "position: absolute; left:218px; top:34px; height:32px; width: 32px;");
			displayItemIcon( ITEM_OFF_HAND, "position: absolute; left:172px; top:83px; width: 64px; ");
			displayItemIcon( ITEM_SHOULDER, "position: absolute;left:172px; top:238px; width:64px; height:64px;");
			p.innerHTML = html +"</p>";
			_gel(tabId).appendChild(p);
		};

		charData = xml2array(response);
  		if (charData==null || charData['DRCharacter']==null) {
  			_gel("content_div").innerHTML = "<a href'http://www.dungeonrunners.com/'><img alt='the server responded but not with character data' src='" + bg_img + "'/></a>";
			return;
		};

  
  
		charData = charData['DRCharacter'];
		for ( var index = 0; index < 2; index++ )
		attackData[ charData['Combat']['Weapon'][index]['hand'] ] = charData['Combat']['Weapon'][index];
		for ( var index = 0; index < 10; index++ ) {
			if ( charData['Equipment']['Item'][index] )
			itemData[ charData['Equipment']['Item'][index]['SlotID'] ] = charData['Equipment']['Item'][index];
		};
		for ( var index = 0; index < 10; index++ ) {
			if ( charData['Skills']['Skill'][index] )
			skillData[ charData['Skills']['Skill'][index]['SlotID'] ] = charData['Skills']['Skill'][index];
		};
		statsCallback( tabs.addTab("Stats") );
		skillsCallback( tabs.addTab("Skills") );
		equipCallback( tabs.addTab("Equip") );
		t1 = new ToolTip("popup__MODULE_ID__");
	});

};
_IG_RegisterOnloadHandler(doEverything);
</script>
]]>
</Content>
</Module>



