
function getElem(elName)
{
	return document.getElementById?document.getElementById(elName):null;
}

function gotosite(loc)
{
	if(loc != null && loc != '')
	{
		location.href = loc;
	}
}
/*BROWSER CHECK*/

var browser = navigator.appName;
var appVer = parseInt(navigator.appVersion);
var ie = "Microsoft Internet Explorer";
var ns = "Netscape";
if (navigator.appVersion.indexOf("Macintosh") != -1) {
	isMac = true;
} else {
	isMac = false;
}
/*****
 * Javascript Array methods for 5.0 browser
 */

function Array_splice(index, delTotal) {
	var temp = new Array();
	var response = new Array();
	var A_s = 0;
	for (A_s = 0; A_s < index; A_s++) {
		temp[temp.length] = this[A_s];
	}
	for (A_s = 2; A_s < arguments.length; A_s++) {
		temp[temp.length] = arguments[A_s];
	}
	for (A_s = index + delTotal; A_s < this.length; A_s++) {
		temp[temp.length] = this[A_s];
	}
	for (A_s = 0; A_s < delTotal; A_s++) {
		response[A_s] = this[index + A_s];
	}
	this.length = 0;
	for (A_s = 0; A_s < temp.length; A_s++) {
		this[this.length] = temp[A_s];
	}
	return response;
}

if (typeof Array.prototype.splice == "undefined") {
	Array.prototype.splice = Array_splice
}

function Array_push() {
	var A_p = 0;
	for (A_p = 0; A_p < arguments.length; A_p++) {
		this[this.length] = arguments[A_p];
	}
	return this.length;
}

if (typeof Array.prototype.push == "undefined") {
	Array.prototype.push = Array_push;
}
/*****
 * Javascript utilities to Get, Set and Delete cookies
 */

var today = new Date();
var oneYear = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);
var oneMonth = new Date(today.getTime() + 30 * 24 * 60 *60 * 1000);
var oneWeek = new Date(today.getTime() + 7 * 24 * 60 *60 * 1000);

function GetCookieUtil (name) {
	var result = null;
	var myCookie = " " + document.cookie + ";";
	var searchName = " " + name + "=";
	var startOfCookie = myCookie.indexOf(searchName);
	var endOfCookie;
	if (startOfCookie != -1) {
		startOfCookie += searchName.length;
		endOfCookie = myCookie.indexOf(";", startOfCookie);
		result = unescape(myCookie.substring(startOfCookie, endOfCookie));
	}
	return result;
}

function SetCookieUtil (name,value,expires,path,domain,secure) {
	document.cookie = name + "=" + escape (value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "; path=/") +
	((domain) ? "; domain=" + domain : "; domain=espn.go.com") +
	((secure) ? "; secure" : "");
}

function DeleteCookieUtil (name,path,domain) {
	if (GetCookieUtil(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}
function correctPng() {
	for(var i=0; i<document.images.length; i++) {
		var img = document.images[i];
		var imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
			var imgID = (img.id) ? "id='" + img.id + "' " : "";
			var imgClass = (img.className) ? "class='" + img.className + "' " : "";
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
			var imgStyle = "display:inline-block;" + img.style.cssText;
			var imgAttribs = img.attributes;
			for (var j=0; j<imgAttribs.length; j++) {
				var imgAttrib = imgAttribs[j];
				if (imgAttrib.nodeName == "align") {		  
					if (imgAttrib.nodeValue == "left") imgStyle = "float:left;" + imgStyle;
					if (imgAttrib.nodeValue == "right") imgStyle = "float:right;" + imgStyle;
					break;
				}
			}
			var strNewHTML = "<span " + imgID + imgClass + imgTitle;
			strNewHTML += " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";";
			strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader";
			strNewHTML += "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" ;
			img.outerHTML = strNewHTML;
			i = i-1;
		}
	}
}

if (navigator.appName == "Microsoft Internet Explorer") {
	window.attachEvent("onload", correctPng);
}

function pollNav()
{
	var htmlRoot = getElem('gNav');
	var func;
	
	if(!htmlRoot)
	{
		setTimeout('pollNav();',1000);
	}
	else if(htmlRoot)
	{
		executeXML('/nhl/xml/xmlNav?sport=nhl', 'nav', loadNav, []);
	}
}

function loadNav()
{
	var el = getElem('gNav');
	var doc = this.getXMLDoc('nav');
	var node = doc.getElementsByTagName('nav')[0];
	var value = node.childNodes[0].nodeValue;
	value = value.replace(/#b#/g,'\'');
	el.innerHTML = value;
	navLoaded = true;
	setNav();
}

/*
ESPN.com Horizontal dropdown nav
Last Updated 08.01.2005
*/



hideElements = new Array();

// hides selectors when user rolls over horizontal dropdown
function findForm() {
	//alert('this is ie');
	//hideElements = new Array();
	for (var f=0; f<window.document.forms.length; f++) {
		var theForm = window.document.forms[f];
		for (var e=0; e<theForm.elements.length; e++) {
			var theElem = theForm.elements[e];
			if (theElem.type.substr(0,6) == "select") {
				hideElements.push(theElem);
			}
		}
	}
}


// set up month rollover scripts
function setNav() {

	// decide if dropdown should hide any flash objects on the page
	var av = navigator.appVersion.toLowerCase();
	var ua = navigator.userAgent.toLowerCase();
	var platform;
	var browser;
	var hideFlash = false;
	var hideAd = false;
	if (av.indexOf("mac") != -1) {
		platform = "mac";
	} else if (av.indexOf("windows") != -1) {
		platform = "win";
	}
	if (ua.indexOf("firefox") != -1) {
		browser = "firefox";
	}

	// if firefox...
	if (browser == "firefox") {
		//alert('user has firefox');
		hideFlash = true;
	}
	
	if (browser == "firefox" || ua.indexOf("safari") != -1) {
		hideAd = true;
	}



	// swfPresent will be defined if hiding swfs
	if (window.swfList) {
		swfPresent = true;
		//alert('hiding: '+swfsToHide);
		//alert(swfList.length);
	} else {
		swfPresent = false;
		//alert('nothing to hide');
	}
	


	// drop down
	if (document.getElementById && document.getElementById("topNav")) {
		navRoot = document.getElementById("topNav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.className == "collapsed") {
			
				node.onmouseover = function() {
					this.className = 'expanded';
					
					// testing form thing
					if (isIE) {
						for (e=0; e<hideElements.length; e++) {
							var formElem = document.getElementById(hideElements[e].id);
							if (formElem != null) {
								formElem.style.visibility = 'hidden';
							}
						}
						
					}
					
					// This hides the flash object(s)
					if (hideFlash && swfPresent) {
						for (var s=0; s<swfList.length; s++) {
							var flashobject = document.getElementById(swfList[s]);
							flashobject.style.visibility = 'hidden';
						}
					}
					
					/*
					// hides wide ad
					if (hideAd) {
						if (document.getElementById('adWrap') != null) {
							var adDiv = document.getElementById('hideThisDiv');
							var adWrap = document.getElementById('adWrap');
							adWrap.style.height = '46px';
							//adWrap.style.backgroundColor = '#48AF38';
							adDiv.style.display = 'none';
						}
					}
					*/
					
					// hides ad
					if (hideAd && this.childNodes[1] != null && this.childNodes[1].innerHTML == "More [+]") {
						if (document.getElementById('ad_InContent') != null) {
							document.getElementById('ad_InContent').style.height = '262px';
						} else if (document.getElementById('ad_Poster') != null) {
							document.getElementById('ad_Poster').style.height = '612px';
						}
						var adObj1 = document.getElementById('ad');
						var adObj2 = document.getElementById('adslug');
						if (adObj1 != null) {
							adObj1.style.display = 'none';
						}
						if (adObj2 != null) {
							adObj2.style.display = 'none';
						}
					}
				}
				
				node.onmouseout = function() {
				this.className = 'collapsed';
					
					// testing form thing
					if (isIE) {
						for (e=0; e<hideElements.length; e++) {
							var formElem = document.getElementById(hideElements[e].id);
							if (formElem != null) {
								formElem.style.visibility = 'visible';
							}
						}
						
					}
					
					// This unhides the flash object(s)
					if (hideFlash && swfPresent) {
						for (var s=0; s<swfList.length; s++) {
							var flashobject = document.getElementById(swfList[s]);
							flashobject.style.visibility = 'visible';
						}
					}
					
					/*
					// unhides wide ad
					if (hideAd) {
						if (document.getElementById('adWrap') != null) {
							var adDiv = document.getElementById('hideThisDiv');
							var adWrap = document.getElementById('adWrap');
							adWrap.style.height = '46px';
							adDiv.style.display = 'block';
						}
					}
					*/
					
					// unhides ad
					if (hideAd && this.childNodes[1] != null && this.childNodes[1].innerHTML == "More [+]") {
						var adObj1 = document.getElementById('ad');
						var adObj2 = document.getElementById('adslug');
						if (adObj1 != null) {
							adObj1.style.display = 'block';
						}
						if (adObj2 != null) {
							adObj2.style.display = 'block';
						}
					}
					
				}
				
				for (j=0; j<node.childNodes.length; j++) {
					if (node.childNodes[j].className == "dropContainer") {
						elem = node.childNodes[j];
						for (k=0; k<elem.childNodes.length; k++) {
						
							// find 1st tier dropdowns
							if (elem.childNodes[k].className == "dropMenu" || elem.childNodes[k].className == "anchorDropMenu") {
								menuElem = elem.childNodes[k];
						
								for (q=0; q<menuElem.childNodes.length; q++) {

						
									if (menuElem.childNodes[q].className == "dropItem") {
										dropElem = menuElem.childNodes[q];
										dropElem.onmouseover = function() {
											//
											this.className = 'dropItemHi';
										}
										dropElem.onmouseout = function() {
											//
											this.className = 'dropItem';
										}
									
										// find 1st tier drop items that are also 2nd tier dropdowns
										for (d=0; d<dropElem.childNodes.length; d++) {
											if (dropElem.childNodes[d].className == "dropMenu2") {
												// found one
												tier2Item = dropElem.childNodes[d];
												// assign rollovers
												for (r=0; r<tier2Item.childNodes.length; r++) {
													if (tier2Item.childNodes[r].className != "rule") {
														tier2Item.childNodes[r].onmouseover = function() {
															this.className = 'dropItemHi';
														
														}
														tier2Item.childNodes[r].onmouseout = function() {
															this.className = 'dropItem';
														}
													}
												}
											}
										}
									} else if (menuElem.childNodes[q].className == "dropItem_s") { // special drop item, i.e. partner sites
										dropElem = menuElem.childNodes[q];
										dropElem.onmouseover = function() {
											//
											this.className = 'dropItemHi_s';
										}
										dropElem.onmouseout = function() {
											//
											this.className = 'dropItem_s';
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	
	if (navigator.appName == "Microsoft Internet Explorer" && platform != "mac") {
		isIE = true;
		window.attachEvent("onload", findForm);
		//window.onload = findForm;
	}	
	
	
}


function goTo(where) {
	window.location = where;
}

function goToNew(where,winName,features) {
	window.open(where,winName,features);
}


// do it
window.onload = setNav;

// unrelated for html dropdowns
function gotosite(site) {
    if (site != "") {
        window.location=site;
    }
}

pollNav();

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               // Danny Mavromatis, Mike Davidson
// Version: 2.06.4
// Created: 10/29/2001
// Updated: 7/13/2005
// ESPN.com FLASH detection system
	var f2 = false;
	var f3 = false;
	var f4 = false;
	var f5 = false;
	var f6 = false;
	var f7 = false;	
	var f8 = false;
	var cId = 0;
	var mV = 8;
	var aV = 0;
	var hRV = false;
	var jsV = 1.0;
	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
	jsV = 1.1;
if(isIE && isWin){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('f2 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('f3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('f4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('f5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
	document.write('f6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
	document.write('f7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	document.write('f8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
	document.write('</SCR' + 'IPT\> \n');
}
function checkFlash(rV){
	var ua=navigator.userAgent.toLowerCase();
	this.webtv = (ua.indexOf("webtv")>-1);
	this.ie = (parseFloat(ua.slice(ua.indexOf("msie")+5)));
	this.nn = (parseFloat(ua.slice(ua.indexOf("mozilla/")+8)));
	var browser = navigator.appName.toLowerCase();
	if (browser=="netscape"){
	this.netscape = true;
	}else{
	this.netscape = false;
	}
	this.mac = (ua.indexOf("mac")>-1);
	this.flash = false;
	
	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"]
		|| navigator.plugins["Shockwave Flash"]){
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var fD = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var fV = parseInt(fD.charAt(fD.indexOf(".") - 1));
			f2 = fV == 2;
			f3 = fV == 3;
			f4 = fV == 4;
			f5 = fV == 5;
			f6 = fV == 6;
			f7 = fV == 7;
			f8 = fV == 8;
		}
	}
	for (var i = 2; i <= mV; i++) {
		if (eval("f" + i) == true) aV = i;
	}
	// alert("version detected: " + aV);
	if (aV >= rV) {
		if (this.netscape && this.IEonly == 'TRUE' || this.mac && this.IEonly == 'TRUE'){
			this.flash = false;
		} else {
			this.flash = true;
		}
	}
}
function flashObj() {
	cId += 1;
	this.flashFile = "/flash/blank.swf";
	this.LiveConnect = "FALSE";
	this.IEonly = null;
      	this.wmode = "opaque";
      	this.redirect = null;
	this.DenyIEdl = "FALSE";
	this.altImg = "/i/blank.gif";
	this.bgcolor = null;
	this.altTxt = null;
	this.height = "400";
	this.width = "520";
	this.salign="lt";
	this.align="left";
	this.flashVars = null;
	this.ID = "flash"+ cId;
	this.name = "flash"+ cId;
	this.webTV = "true";
	this.quality = "best";
	this.scale = "exactfit";
	this.menu = "false";
	this.deviceFont = "false";
	this.FlashVer = 5;
	this.cabVersion = "5,0,0,0";
	this.render = writeFlashComponent;
}
function writeFlashComponent() {
	var Ticket=new checkFlash(this.FlashVer);
	var sCR;
	if (Ticket.flash) {
		if (Ticket.mac || Ticket.netscape) {
		
			sCR="<EMBED SRC="+this.flashFile+" swLiveConnect="+this.LiveConnect+" WIDTH="+this.width+" HEIGHT="+this.height+" QUALITY="+this.quality+" SCALE="+this.scale+" FlashVars="+ this.flashVars +" wmode="+this.wmode+" ID="+this.ID+" NAME="+this.name+" MENU="+this.menu+" DEVICEFONT="+this.deviceFont;
			if (this.bgcolor) {
				sCR += " BGCOLOR="+this.bgcolor;
			}
			if (this.salign) {
				sCR += " SALIGN="+this.salign;
			}
			sCR += " TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED>";
		} else if (this.DenyIEdl=='TRUE') {
			sCR="<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version="+this.FlashVer+",0,0,0\" ID=\""+this.ID+"\" WIDTH=\""+this.width+"\" HEIGHT=\""+this.height+"\">\n";
			sCR+="<PARAM NAME=movie VALUE=\""+this.flashFile+"\">\n";						
			sCR+="<PARAM NAME=quality VALUE=\""+this.quality+"\">\n";
			sCR+="<PARAM NAME=scale VALUE=\""+this.scale+"\">\n";
			sCR+="<PARAM NAME=menu VALUE=\""+this.menu+"\">\n";
			sCR+="<PARAM NAME=wmode VALUE=\""+this.wmode+"\">\n";
			if (this.bgcolor){
				sCR+="<PARAM NAME=bgcolor VALUE=\""+this.bgcolor+"\">\n";
			}
			if (this.flashVars){
				sCR+="<PARAM NAME=FlashVars VALUE=\""+this.flashVars+"\">\n";
			}
			if (this.salign) {
				sCR+="<PARAM NAME=salign VALUE=\""+this.salign+"\">\n";
			}
			sCR+="<PARAM NAME=devicefont VALUE=\""+this.deviceFont+"\">\n";
			if (this.bgcolor){
			sCR+="<EMBED SRC="+this.flashFile+" swLiveConnect="+this.LiveConnect+" WIDTH="+this.width+" HEIGHT="+this.height+" QUALITY="+this.quality+" SCALE="+this.scale+" wmode="+this.wmode+" ID="+this.ID+" NAME="+this.name+" MENU="+this.menu+" DEVICEFONT="+this.deviceFont+" FlashVars="+ this.flashVars +" BGCOLOR="+this.bgcolor+" TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED></OBJECT>";
			} else {
			sCR+="<EMBED SRC="+this.flashFile+" swLiveConnect="+this.LiveConnect+" WIDTH="+this.width+" HEIGHT="+this.height+" QUALITY="+this.quality+" SCALE="+this.scale+" wmode="+this.wmode+" ID="+this.ID+" NAME="+this.name+" MENU="+this.menu+" DEVICEFONT="+this.deviceFont+" FlashVars="+ this.flashVars +" TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED></OBJECT>";
			}
		} else if (Ticket.ie>=4 && this.DenyIEdl=='FALSE') {
			sCR="<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version="+this.cabVersion+"\" ID=\""+this.ID+"\" WIDTH=\""+this.width+"\" HEIGHT=\""+this.height+"\">\n";
			sCR+="<PARAM NAME=movie VALUE=\""+this.flashFile+"\">\n";						
			sCR+="<PARAM NAME=quality VALUE=\""+this.quality+"\">\n";
			sCR+="<PARAM NAME=scale VALUE=\""+this.scale+"\">\n";
			sCR+="<PARAM NAME=menu VALUE=\""+this.menu+"\">\n";
			sCR+="<PARAM NAME=wmode VALUE=\""+this.wmode+"\">\n";
			if (this.flashVars){
				sCR+="<PARAM NAME=FlashVars VALUE=\""+this.flashVars+"\">\n";
			}
			if (this.bgcolor){
				sCR+="<PARAM NAME=bgcolor VALUE=\""+this.bgcolor+"\">\n";
			}
			if (this.salign) {
				sCR+="<PARAM NAME=salign VALUE=\""+this.salign+"\">\n";
			}
			sCR+="<PARAM NAME=devicefont VALUE=\""+this.deviceFont+"\">\n";
			sCR+="</OBJECT>\n";
		} else if (Ticket.webtv) {
			sCR="<EMBED SRC="+this.flashFile+" swLiveConnect=TRUE WIDTH="+this.width+" HEIGHT="+this.height+" QUALITY="+this.quality+" SCALE="+this.scale+" wmode="+this.wmode+" ID="+this.ID+" NAME="+this.name+" MENU="+this.menu+" DEVICEFONT="+this.deviceFont+" FlashVars="+ this.flashVars +" TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED>";
		}
	} else {
	if (this.redirect){
	 top.location.href = this.redirect;
	} else {
			if (this.altTxt){
			sCR = this.altTxt;
			} else {
			sCR="<IMG SRC="+this.altImg+" WIDTH="+this.width+" HEIGHT="+this.height+" BORDER=0>";
			}
		}
		}
	return sCR;
}
function getElem(elName)
{
	return document.getElementById?document.getElementById(elName):null;
}

function gotosite(loc)
{
	if(loc != null && loc != '')
	{
		location.href = loc;
	}
}

var requests = new Object();
var xmlReqInProgress = false;

function RequestFactory(){}

RequestFactory.prototype.createRequest = function(rID, url)
{
	var r;
	if(!requests[rID])
	{
		if(window.XMLHttpRequest)
		{
			r = new XMLHttpRequest();
			requests[rID] = new XMLRequest(r,rID);
       		requests[rID].req.open('GET', url, true);
			requests[rID].req.send(null);
		}
		else if(window.ActiveXObject)
		{
			r = new ActiveXObject('Microsoft.XMLHTTP');
			if(r)
			{
				requests[rID] = new XMLRequest(r,rID);
				requests[rID].req.open('GET', url, true);
				requests[rID].req.send();
			}
		}
		else
		{
			requests[rID] = null;
		}
	}

	return requests[rID];
}
function getOffSets()
{
	var x,y;
	if (self.pageYOffset) // all except Explorer
	{
		x = self.pageXOffset;
		y = self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)// Explorer 6 Strict
	{
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;
	}
	else if (document.body) // all other Explorers
	{
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}
	
	return new Array(x,y);
}
var selfXMLR = new Object();

function XMLRequest(req,id)
{
	selfXMLR[id] = this;
	selfXMLR[id].req = req;
	selfXMLR[id].isInit = false;
	selfXMLR[id].methodReady = false;
	selfXMLR[id].interval = 0;
	selfXMLR[id].isFirstRun = true;
	selfXMLR[id].func = null;
	selfXMLR[id].args = new Array();
	selfXMLR[id].init(id);
}

XMLRequest.prototype.init = function(counter)
{
	if(selfXMLR[counter].req.readyState == 4)
	{
		if(selfXMLR[counter].req.status == 200)
		{
			selfXMLR[counter].isInit = true;
		}
	}
	
	if(!selfXMLR[counter].isInit)
	{	
		setTimeout('selfXMLR[\'' + counter + '\'].init(\'' + counter + '\');', 2);
	}
	else
	{ 
		if(selfXMLR[counter].methodReady)
		{
			selfXMLR[counter].execute(counter);
		}
		else
		{
			setTimeout('selfXMLR[\'' + counter + '\'].init(\'' + counter + '\');', 2);
		}
	}
}
	
XMLRequest.prototype.createMethod = function(func, args, counter)
{
	selfXMLR[counter].func = func;
	selfXMLR[counter].args = args;
	selfXMLR[counter].methodReady = true;
	if(!selfXMLR[counter].isInit)
	{
		selfXMLR[counter].init(counter);
	}
}
	
XMLRequest.prototype.getXMLDoc = function(id)
{
	return selfXMLR[id].req.responseXML;
}
	
XMLRequest.prototype.execute = function(counter)
{
	selfXMLR[counter].func.apply(selfXMLR[counter],selfXMLR[counter].args);
	selfXMLR[counter].methodReady = false;
	selfXMLR[counter].isInit = false;
}
var rf = new RequestFactory();
var rque = new Array();
var ids = new Object();
var currentReq = null;

function proxyReq()
{
	this.url = null;
	this.id = null;
	this.f = null;
	this.args = null;
}

function executeXML(url, id, func, args)
{
	var req = null;
	var newArgs;
	var success = false;
		
	if(id != null && id != '')
	{
		if(ids[id] == null)
		{
			ids[id] = new proxyReq();
			ids[id].url = url;
			ids[id].id = id;
			ids[id].f = func;		
			
			if(!args || typeof args != 'object')
			{
				newArgs = 'new Array(\'\')';
			}
			else
			{
				newArgs = 'new Array(';
				for(var i = 0; i < i.length; i++)
				{
					if(i < i.length -1)
					{
						newArgs += '\'' + args[i] + '\',';
					}
					else
					{
						newArgs += '\'' + args[i] + '\'';
					}
				}
				newArgs += ')';
			}
			ids[id].args = newArgs;
		}
		
		req = rf.createRequest(id, url);
		if(req != null)
		{
			req.createMethod(func,args,id);
			success = true;
		}
		else if(ids[id] != null)
		{
			if(currentReq == ids[id] || currentReq == null)
			{
				setTimeout('executeXML(\'' + ids[id].url + '\',\'' + ids[id].id + '\',' + ids[id].f + ',' + ids[id].args + ');',2);
			}
		}
	}
	currentReq = ids[id];
	return success;
}