/* [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','7901',jdecode('Home'),jdecode(''), jdecode('%2F7901.html'), 'true',[],'',''],
	['PAGE','8301',jdecode('About+Us'),jdecode(''), jdecode('%2F8301.html'), 'true',[],'',''],
	['PAGE','7994',jdecode('Contact'),jdecode(''), jdecode('%2F7994.html'), 'true',[],'',''],
	['PAGE','8015',jdecode('Links'),jdecode(''), jdecode('%2F8015.html'), 'true',[],'',''],
	['PAGE','15301',jdecode('New+page'),jdecode(''), jdecode('%2F15301.html'), 'true',[],'','']];
var siteelementCount=5;
theSitetree.topTemplateName='Boardgame';
theSitetree.paletteFamily='D2D1D2';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16567';
theSitetree.graphicsetId='12198';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='D2D1D2';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hostway_generic',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Boardgame',
				paletteFamily: 	'D2D1D2',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16567',
				graphicsetId: 	'12198',
				contentColor: 	'000000',
				contentBGColor: 'D2D1D2',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20100703-210936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20100703-220611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7994',
internalId:  '',
customField: '20100703-220519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8015',
internalId:  '',
customField: '20100703-220354'
};
webappMappings['1501']=webappMappings['1501-7039142']={
webappId:    '1501',
documentId:  '7901',
internalId:  '7039142',
customField: '1501'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '7901',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7901',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INZ7VX';
var companyName   = 'Gaming+Support';
var htmlTitle	  = 'Gaming+Support+Webstore';
var metaKeywords  = 'RPG%2C+Role+Playing+Games%2C+Role-Playing+Games%2C+Roleplaying%2C+Role+Playing%2C+Dungeons+and+Dragons%2C+DD%2C+Wizards+of+the+Coast%2C+Rio+Grande+Games%2C+Z-Man+Games%2C+ZMan%2C+Z-Man%2C+Z+Man%2C+Z+Man+Games%2C+Alderac+Entertainment%2C+Alderac%2C+AEG%2C+Alderac+Entertainment+Group%2C+Fantasy%2C+Fantasy+Flight%2C+Alea%2C+Alea+Tools%2C+Chessex%2C+Game+Science%2C+Gamescience%2C+Mayfair+Games%2C+Mayfair%2C+Paizo%2C+Paizo+Publishing%2C+Players+Choice%2C+Players+Choice%2C+Players%2C+Choice%2C+Reaper%2C+Reaper+Miniatures%2C+Steel+Sqwire%2C+Steel+Squire%2C+Twilight+Creations%2C+Twilight%2C+Zombies%2C+Zombies%21%2C+Zombies%21%21%2C+Zombies%21%21%21+Zombies%21%21%21%21%2C+Humans%2C+Humans%21%2C+Humans%21%21%2C+Humans%21%21%21%2C+Humans%21%21%21%21%2C+Martians%2C+Martians%21%2C+Martians%21%21%21%2C+Martians%21%21%21%21%2C+Wizards%2C+WotC%2C+SoC%2C+Catan%2C+Settlers+of+Catan%2C+Carcassonne%2C+Carcasonne%2C+Carcassone%2C+Princess%2C+Dragon%2C+Steam%2C+Locomotive%2C+Train%2C+Token%2C+Figure%2C+Trains%2C+Tokens%2C+Figures%2C+Locomotives%2C+Wizard%2C+Pandemic%2C+On+the+brink%2C+Adventurer%2C+Adventurers%2C+Chac%2C+Temple%2C+Agricola%2C+Moor%2C+Farmer%2C+Farmers%2C+Farmers+on+the+Moor%2C+Midevil%2C+Mid+evil%2C+Medieval%2C+Midevil+Deluxe%2C+Magic%2C+Magic+the+Gathering%2C+MTG%2C+Warcraft%2C+Yu-Gi-Oh%2C+Yu-Gi-Oh%21%2C+yugioh%2C+Sleeves%2C+Card+Sleeves%2C+Deck%2C+Deck+Protectors%2C+Deck+Sleeves%2C+Ultra+Pro%2C+Max+Protection%2C+KMC%2C+Yanoman%2C+Gems%2C+Dice%2C+Dice+Sets%2C+Polyhedral%2C+Poly+Dice%2C+Poly%2C+d4%2C+d6%2C+d8%2C+d10%2C+d12%2C+d20%2C+d00%2C+percentile%2C+percentile+dice%2C+dice+bag%2C+miniature%2C+mini%2C+TMG%2C+CMG%2C+Ogre%2C+Goblin%2C+Lamia%2C+Sinspawn%2C+Monk%2C+Wizard%2C+Fighter%2C+Ranger%2C+Paladin%2C+Cleric%2C+Dwarf%2C+Halfling%2C+Elf%2C+Half-Elf%2C+Half+Elf%2C+Pathfinder%2C+Hook+Mountain%2C+Harsk%2C+Kyra%2C+Merisel%2C+Nualia%2C+Erylium%2C+Sajan%2C+Valeros%2C+Xanesha%2C+Ezren%2C+Gamemastery%2C+Game%2C+Games%2C+Game+mastery%2C+Flip%2C+Flip+Mat%2C+Flip-Mat%2C+Mat%2C+Basic%2C+City%2C+Market%2C+City+Market%2C+River%2C+Crossing%2C+River+Crossing%2C+Darklands%2C+Dark+Lands%2C+Drow%2C+Neo%2C+Neo+Magnet%2C+Traveller%2C+Borealis%2C+Opaque%2C+Transparent%2C+Speckled%2C+Scarab%2C+Pound+of+Dice%2C+Pound+o+dice%2C+Nebula%2C+Marble%2C+Gold+Leaf%2C+Vortex%2C+Festive%2C+Copper%2C+Gold%2C+Steel%2C+Marble%2C+Clear%2C+Primula%2C+Arctic+Camo%2C+Phantom%2C+Bag+o+Zombies%2C+Bag+o%2C+Bag+o%2C++Bag+of+Zombies%2C+Bag+o+glow+in+the+dark%2C+Bag+of+glow+in+the+dark%2C+Dominon%2C+Seaside%2C+Intrigue%2C+Board+Game%2C+Card+Game%2C+Family+Game%2C+War+Game%2C+Wargame%2C+Boardgame%2C+Trading+Card+Game%2C+Collectible+Card+Game%2C+Collectible+Miniature+Game%2C+Miniature+Game%2C+Monster%2C+PC%2C+Player%2C+Player+Character';
var metaContents  = 'You+need+a+hobby+gaming+store+dedicated+to+providing+you+with+the+best+in+customer+service.++You+can+buy+Role+Playing+Games%2C+Board+Games%2C+and+Trading+Card+Games%2C+as+well+as+accessories+to+make+your+game+better%21';
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();
};

