/* [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 POS_TARGET=8;
var theSitetree=[ 
	['PAGE','701',jdecode('Home'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','10901',jdecode('Products'),jdecode(''),'/10901/index.html','true',[ 
		['PAGE','773',jdecode('Sports+Cards'),jdecode(''),'/10901/773.html','true',[],'',''],
		['PAGE','794',jdecode('Card+Games'),jdecode(''),'/10901/794.html','true',[],'',''],
		['PAGE','815',jdecode('Role+Playing+'),jdecode(''),'/10901/815.html','true',[],'',''],
		['PAGE','836',jdecode('Video+Games'),jdecode(''),'/10901/836.html','true',[],'',''],
		['PAGE','857',jdecode('DVD%26%23x27%3BS'),jdecode(''),'/10901/857.html','true',[],'',''],
		['PAGE','878',jdecode('Board+Games'),jdecode(''),'/10901/878.html','true',[],'',''],
		['PAGE','899',jdecode('Miniatures+Games'),jdecode(''),'/10901/899.html','true',[],'','']
	],'',''],
	['PAGE','962',jdecode('Tournaments'),jdecode(''),'/962.html','true',[],'',''],
	['PAGE','920',jdecode('Directions'),jdecode(''),'/920.html','true',[],'',''],
	['PAGE','1004',jdecode('Forums'),jdecode(''),'/1004.html','true',[],'',''],
	['PAGE','941',jdecode('About+Us'),jdecode(''),'/941/index.html','true',[ 
		['PAGE','15815',jdecode('Special+Thanks'),jdecode(''),'/941/15815.html','true',[],'','']
	],'',''],
	['PAGE','983',jdecode('Buying'),jdecode(''),'/983.html','true',[],'',''],
	['PAGE','15689',jdecode('Guestbook'),jdecode(''),'/15689/index.html','true',[ 
		['PAGE','15688',jdecode('Read+Guestbook'),jdecode(''),'/15689/15688.html','false',[],'','']
	],'',''],
	['PAGE','20701',jdecode('Jobs'),jdecode(''),'/20701.html','true',[],'',''],
	['PAGE','31849',jdecode('Contact+Info'),jdecode(''),'/31849.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'353',
				contentColor: 	'FFFFFF',
				contentBGColor: '003390',
				a_color: 		'003390',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '983',
internalId:  '',
customField: '20090829-145745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1004',
internalId:  '',
customField: '20100424-165607'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '962',
internalId:  '',
customField: '20100424-165714'
};
webappMappings['1002']=webappMappings['1002-15689ahw050inehi0']={
webappId:    '1002',
documentId:  '15689',
internalId:  '15689ahw050inehi0',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100424-165331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '920',
internalId:  '',
customField: '20100428-154944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '941',
internalId:  '',
customField: '20081111-152621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31849',
internalId:  '',
customField: '20100513-172744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15815',
internalId:  '',
customField: '20081211-002304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20100424-160725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '899',
internalId:  '',
customField: '20100424-164540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '878',
internalId:  '',
customField: '20100424-164357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '836',
internalId:  '',
customField: '20081211-000539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '815',
internalId:  '',
customField: '20100424-165946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20100428-155626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20081210-234422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20100309-150519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15689',
internalId:  '',
customField: '20080725-012017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15688',
internalId:  '',
customField: '20080725-012017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20100428-154843'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INEHI0';
var companyName   = '%22We+are+Batty+about+Games%22';
var htmlTitle	  = 'Mind+Games';
var metaKeywords  = 'Mind+Games+MindGames+Oneida+Oneida+NY+New+York+13421+Madison+St.+Star+Wars+Miniatures+Magic+Yu+gi+oh+Naruto+UFS+card+games+dungeons+and+dragons+sport+cards+baseball+cards+football+cards+basketball+cards+hockey+cards+Heroclix+Axis%26Allies+minis+Heroclix+video+video+game+video+games++DVDS+dvds+movies+supplies+magic+the+gathering+games+Mind+';
var metaContents  = 'Mind+Games+Oneida+NY+Madison+St.+13421+video+games+card+games+board+games+rpg+games+miniatures+games';
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();
};
