/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var theSitetree=[ 
	['PAGE','42301',jdecode('News'),jdecode(''),'/42301.html','true',[],''],
	['PAGE','32',jdecode('Blog+It%21'),jdecode(''),'/32.html','true',[],''],
	['PAGE','71',jdecode('Xbox+360+Files'),jdecode(''),'/71/index.html','true',[ 
		['PAGE','44401',jdecode('Madden+10'),jdecode(''),'/71/44401.html','true',[],''],
		['PAGE','43501',jdecode('NBA+Live+10'),jdecode(''),'/71/43501.html','true',[],''],
		['PAGE','40822',jdecode('NBA+2K10'),jdecode(''),'/71/40822.html','true',[],''],
		['PAGE','39801',jdecode('NHL+2K10'),jdecode(''),'/71/39801.html','true',[],''],
		['PAGE','40801',jdecode('NHL+2010'),jdecode(''),'/71/40801.html','true',[],''],
		['PAGE','40843',jdecode('FIFA+2010'),jdecode(''),'/71/40843.html','true',[],''],
		['PAGE','40864',jdecode('Forza+3'),jdecode(''),'/71/40864.html','true',[],''],
		['PAGE','40885',jdecode('+COD+MW2'),jdecode(''),'/71/40885.html','true',[],''],
		['PAGE','40906',jdecode('Fallout+3'),jdecode(''),'/71/40906.html','true',[],'']
	],''],
	['PAGE','42101',jdecode('Fudge+Forum'),jdecode(''),'/42101.html','true',[],''],
	['PAGE','39001',jdecode('Impressions'),jdecode(''),'/39001.html','true',[],''],
	['PAGE','39022',jdecode('Dev+Teams'),jdecode(''),'/39022/index.html','true',[ 
		['PAGE','45401',jdecode('MLB+The+Show'),jdecode(''),'/39022/45401.html','true',[],'']
	],''],
	['PAGE','125',jdecode('Contact+Me'),jdecode(''),'/125.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='4A587F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10553';
theSitetree.graphicsetId='10449';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='4A587F';
var theTemplate={
				name: 			'Akropolis',
				paletteFamily: 	'4A587F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10553',
				graphicsetId: 	'10449',
				contentColor: 	'FFFFFF',
				contentBGColor: '4A587F',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'4A587F',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '42301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1003']=webappMappings['1003-ahw050in3ble12536c05359']={
webappId:    '1003',
documentId:  '42101',
internalId:  'ahw050in3ble12536c05359',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40885',
internalId:  '',
customField: '20091127-112019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40864',
internalId:  '',
customField: '20091202-165021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20091127-230154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40906',
internalId:  '',
customField: '20091127-112222'
};
webappMappings['7050']=webappMappings['7050-1843']={
webappId:    '7050',
documentId:  '32',
internalId:  '1843',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20091127-113453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40822',
internalId:  '',
customField: '20091127-110845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39022',
internalId:  '',
customField: '20091217-164356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39001',
internalId:  '',
customField: '20091127-115003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40843',
internalId:  '',
customField: '20091127-111412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125',
internalId:  '',
customField: '20070218-054033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39801',
internalId:  '',
customField: '20091127-110916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40801',
internalId:  '',
customField: '20091127-110618'
};
webappMappings['7008']=webappMappings['7008-5708']={
webappId:    '7008',
documentId:  '125',
internalId:  '5708',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42301',
internalId:  '',
customField: '20091127-115409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42101',
internalId:  '',
customField: '20091127-115504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43501',
internalId:  '',
customField: '20091202-163734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44401',
internalId:  '',
customField: '20091211-215810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45401',
internalId:  '',
customField: '20091217-164442'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3BLE';
var companyName   = 'darkfudge.com';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};
