/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','56101',jdecode('UFC+2010+RELEASE+TOURNAMENT'),jdecode(''),'/56101.html','true',[],''],
	['PAGE','47801',jdecode('Membership+Information'),jdecode(''),'/47801/index.html','true',[ 
		['PAGE','47822',jdecode('Rental+Policy'),jdecode(''),'/47801/47822.html','true',[],'']
	],''],
	['PAGE','12122',jdecode('Tournaments'),jdecode(''),'/12122/index.html','true',[ 
		['PAGE','37922',jdecode('Vote+on+Tournaments'),jdecode(''),'/12122/37922.html','true',[],'']
	],''],
	['PAGE','38301',jdecode('Member+Promotions'),jdecode(''),'/38301.html','true',[],''],
	['PAGE','46401',jdecode('Repair+Services'),jdecode(''),'/46401.html','true',[],''],
	['PAGE','14422',jdecode('How+to+Find+Us'),jdecode(''),'/14422/index.html','true',[ 
		['PAGE','14401',jdecode('Store+Hours'),jdecode(''),'/14422/14401.html','true',[],''],
		['PAGE','38501',jdecode('Email+Us'),jdecode(''),'/14422/38501.html','true',[],'']
	],''],
	['PAGE','37901',jdecode('Forums'),jdecode(''),'/37901.html','true',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='1243CC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10588';
theSitetree.graphicsetId='10562';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Circulation',
				paletteFamily: 	'1243CC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10588',
				graphicsetId: 	'10562',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20090417-144121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56101',
internalId:  '',
customField: '20100429-114114'
};
webappMappings['7008']=webappMappings['7008-15642']={
webappId:    '7008',
documentId:  '38501',
internalId:  '15642',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37922',
internalId:  '',
customField: '20090416-210606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20100325-191052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14422',
internalId:  '',
customField: '20090416-203858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12122',
internalId:  '',
customField: '20100429-114726'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '56101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1003']=webappMappings['1003-aendu0in2iip120b04b4757']={
webappId:    '1003',
documentId:  '37901',
internalId:  'aendu0in2iip120b04b4757',
customField: 'en:US'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '56101',
internalId:  '1501',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '14422',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['7005']=webappMappings['7005-1851']={
webappId:    '7005',
documentId:  '37922',
internalId:  '1851',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20090416-150010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38501',
internalId:  '',
customField: '20090416-150452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38301',
internalId:  '',
customField: '20100429-114929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46401',
internalId:  '',
customField: '20090417-125556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47801',
internalId:  '',
customField: '20090417-142736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47822',
internalId:  '',
customField: '20090417-143958'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2IIP';
var companyName   = 'GAMER%27S+CHOICE%2C+INC.';
var htmlTitle	  = 'Gamers+Choice+INC.';
var metaKeywords  = 'Gamers+Choice%2C+Gamers+Choice%2C+Game+Choice%2C+gamers+choice%2C+GAMERS+CHOICE%2C+gamers+choice%2C+GAMERS+CHOICE%2CPs3%2C+ps3%2C+ps2%2C+Ps2%2C+PS2%2C+PS3%2C+XBOX%2C+360%2C+Nintendo%2C+Gamecube%2C+Wii%2C+wii%2C+WII%2C+PSP%2C+PsP%2C+psp%2C+DS%2C+ds%2C+accessories%2C+video%2C+games%2C+console%2C+consoles%2C+controllers%2C+wired%2C+wireless%2C+gaming%2C+MLG%2C+mlg%2C+halo+3+%2C+halo%2C+guitar+hero%2C+guitar+hero+3%2C+rock+band%2C+madden%2C+madden+09%2C+madden+08%2C+gamerschoice.com%2C+gamerschoice.net%2C+gamers+choice+inc.%2C+gamers+choice+pekin%2C+gamers+choice+derby+street%2C+gamers+choice+il%2C+atari%2C+sega%2C+games%2C+video%2C+gamers+sanctuary%2C+sanctuary%2C+choice%2C+gamers%2C+gamer%2C+video+game+store';
var metaContents  = 'Retail+sales+of+video+games+consoles+and+accessories.++Nintendo+Wii%2C+XBOX+360%2C+Playstation+2%2C+Playstation+3%2C+Nintendo+DS%2C+Gamecube%2C+XBOX%2C+Playstation+Portable+and+much+more.';
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();
};
