/* [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','42',jdecode('Home'),jdecode(''),'/42.html','true',[],'',''],
	['PAGE','117',jdecode('RGP+League'),jdecode(''),'/117/index.html','true',[ 
		['PAGE','126',jdecode('The+RGPL+Scores'),jdecode(''),'/117/126.html','true',[],'',''],
		['PAGE','6846',jdecode('The+League+Rules'),jdecode(''),'/117/6846.html','true',[],'',''],
		['PAGE','144',jdecode('Who+we+are'),jdecode(''),'/117/144.html','true',[],'','']
	],'',''],
	['PAGE','26001',jdecode('Pinball+Reviews'),jdecode(''),'/26001/index.html','true',[ 
		['PAGE','27001',jdecode('Lord+of+the+Rings'),jdecode(''),'/26001/27001.html','true',[],'',''],
		['PAGE','26022',jdecode('Pirates+of+the+Caribbean'),jdecode(''),'/26001/26022.html','true',[],'',''],
		['PAGE','50401',jdecode('Tales+of+the+Arabian+Nights'),jdecode(''),'/26001/50401.html','true',[],'',''],
		['PAGE','27022',jdecode('Terminator+2'),jdecode(''),'/26001/27022.html','true',[],'','']
	],'',''],
	['PAGE','63',jdecode('My+Games'),jdecode(''),'/63/index.html','true',[ 
		['PAGE','72',jdecode('Pinball'),jdecode(''),'/63/72.html','true',[],'',''],
		['PAGE','81',jdecode('Video'),jdecode(''),'/63/81.html','true',[],'',''],
		['PAGE','90',jdecode('EMs+and+Other'),jdecode(''),'/63/90.html','true',[],'','']
	],'',''],
	['PAGE','7434',jdecode('Captain+Kid+-+Midway+1966'),jdecode(''),'/7434.html','true',[],'',''],
	['PAGE','7583',jdecode('Haunted+House+Restoration'),jdecode(''),'/7583.html','true',[],'',''],
	['PAGE','40301',jdecode('AFM+Cliffy+SOL+install'),jdecode(''),'/40301.html','true',[],'',''],
	['PAGE','44701',jdecode('AFM+Cliffy+Mothership+Install'),jdecode(''),'/44701.html','true',[],'',''],
	['PAGE','7685',jdecode('Battlezone+Burning'),jdecode(''),'/7685.html','true',[],'',''],
	['PAGE','59601',jdecode('It%26%23x27%3Bs+A+Real+Pig'),jdecode(''),'/59601.html','true',[],'',''],
	['PAGE','47901',jdecode('Pit+Footsies'),jdecode(''),'/47901.html','true',[],'',''],
	['PAGE','7806',jdecode('Random+pics'),jdecode(''),'/7806.html','true',[],'',''],
	['PAGE','99',jdecode('GLOG+%28Game+Log%29'),jdecode(''),'/99.html','true',[],'',''],
	['PAGE','51601',jdecode('Stern+Game+Numbers'),jdecode(''),'/51601.html','true',[],'',''],
	['PAGE','108',jdecode('For+Sale'),jdecode(''),'/108.html','true',[],'',''],
	['PAGE','57701',jdecode('FS+LOTR'),jdecode(''),'/57701.html','true',[],'',''],
	['PAGE','5862',jdecode('Links'),jdecode(''),'/5862.html','true',[],'',''],
	['PAGE','5012',jdecode('Guestbook'),jdecode(''),'/5012/index.html','true',[ 
		['PAGE','5011',jdecode('Read+Guestbook'),jdecode(''),'/5012/5011.html','false',[],'','']
	],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='0A2447';
theSitetree.keyvisualId='2416';
theSitetree.keyvisualName='digital.jpg';
theSitetree.fontsetId='395';
theSitetree.graphicsetId='444';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0A2447';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Amaze',
				paletteFamily: 	'0A2447',
				keyvisualId: 	'2416',
				keyvisualName: 	'digital.jpg',
				fontsetId: 		'395',
				graphicsetId: 	'444',
				contentColor: 	'FFFFFF',
				contentBGColor: '0A2447',
				a_color: 		'0A2447',
				b_color: 		'081B35',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-146870']={
webappId:    '1501',
documentId:  '42',
internalId:  '146870',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50401',
internalId:  '',
customField: '20091111-105246'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '42',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117',
internalId:  '',
customField: '20100123-131428'
};
webappMappings['1002']=webappMappings['1002-5012AHW050INX2VA']={
webappId:    '1002',
documentId:  '5012',
internalId:  '5012AHW050INX2VA',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47901',
internalId:  '',
customField: '20090526-180344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42',
internalId:  '',
customField: '20101227-082743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126',
internalId:  '',
customField: '20080925-095144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6846',
internalId:  '',
customField: '20081127-172703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144',
internalId:  '',
customField: '20081112-070356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40301',
internalId:  '',
customField: '20081229-105311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44701',
internalId:  '',
customField: '20090408-083616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26001',
internalId:  '',
customField: '20080808-064340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27001',
internalId:  '',
customField: '20080808-065132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26022',
internalId:  '',
customField: '20080807-071608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27022',
internalId:  '',
customField: '20080808-070152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63',
internalId:  '',
customField: '20091214-071933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72',
internalId:  '',
customField: '20091214-072010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81',
internalId:  '',
customField: '20090610-104431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90',
internalId:  '',
customField: '20090610-104628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7434',
internalId:  '',
customField: '20080430-172557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7583',
internalId:  '',
customField: '20080430-175134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7685',
internalId:  '',
customField: '20080430-180138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7806',
internalId:  '',
customField: '20091109-095214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99',
internalId:  '',
customField: '20101113-211040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108',
internalId:  '',
customField: '20110117-112707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5862',
internalId:  '',
customField: '20081210-094245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5012',
internalId:  '',
customField: '20080403-225414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5011',
internalId:  '',
customField: '20080403-225414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51601',
internalId:  '',
customField: '20101113-210924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57701',
internalId:  '',
customField: '20101222-074208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59601',
internalId:  '',
customField: '20110510-104929'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2VA';
var companyName   = 'Pinball+%26+Arcade+games+-+Hobby+or+obsession';
var htmlTitle	  = 'PinBald+-+The+home+of+Daves+Arcade';
var metaKeywords  = 'Arcade+pinball+gameroom+games+video';
var metaContents  = 'Obession+of+arcade+games+and+pinball+machines.';
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();
};

