/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','63201',jdecode('Blog'),jdecode(''),'/63201.html','true',[],'',''],
	['PAGE','77601',jdecode('Glow+Artisan'),jdecode(''),'/77601.html','true',[],'',''],
	['PAGE','80801',jdecode('did+it...+abc123'),jdecode(''),'/80801.html','true',[],'',''],
	['PAGE','1701',jdecode('About+Us'),jdecode(''),'/1701/index.html','true',[ 
		['PAGE','1722',jdecode('The+Team'),jdecode(''),'/1701/1722.html','true',[],'',''],
		['PAGE','57801',jdecode('2007+Party+Pics'),jdecode(''),'/1701/57801.html','true',[],'','']
	],'',''],
	['PAGE','1743',jdecode('Games'),jdecode(''),'/1743/index.html','true',[ 
		['PAGE','1806',jdecode('Title+List'),jdecode(''),'/1743/1806.html','true',[],'',''],
		['PAGE','1764',jdecode('Catz+%28DS%29'),jdecode(''),'/1743/1764.html','true',[],'',''],
		['PAGE','1785',jdecode('Winx+%28DS%2FGBA%29'),jdecode(''),'/1743/1785.html','true',[],'','']
	],'',''],
	['PAGE','75001',jdecode('Support'),jdecode(''),'/75001.html','true',[],'',''],
	['PAGE','52001',jdecode('NYC'),jdecode(''),'/52001/index.html','true',[ 
		['PAGE','52701',jdecode('IGDA+%26+NYC'),jdecode(''),'/52001/52701.html','true',[],'',''],
		['PAGE','52722',jdecode('Links'),jdecode(''),'/52001/52722.html','true',[],'','']
	],'',''],
	['PAGE','1827',jdecode('Jobs'),jdecode(''),'/1827.html','true',[],'',''],
	['PAGE','1848',jdecode('Contact'),jdecode(''),'/1848/index.html','true',[ 
		['PAGE','49801',jdecode('Map'),jdecode(''),'/1848/49801.html','true',[],'',''],
		['PAGE','49401',jdecode('Driving+Directions'),jdecode(''),'/1848/49401.html','true',[],'','']
	],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Neon';
theSitetree.paletteFamily='6699CC';
theSitetree.keyvisualId='821';
theSitetree.keyvisualName='schnelle_berater.jpg';
theSitetree.fontsetId='161';
theSitetree.graphicsetId='186';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Neon',
				paletteFamily: 	'6699CC',
				keyvisualId: 	'821',
				keyvisualName: 	'schnelle_berater.jpg',
				fontsetId: 		'161',
				graphicsetId: 	'186',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'6699CC',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '49401',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '49801',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['7060']=webappMappings['7060-64a5d88c7bb2cfdeba83ec6f12a7f04b']={
webappId:    '7060',
documentId:  '57801',
internalId:  '64a5d88c7bb2cfdeba83ec6f12a7f04b',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20091123-160330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20100805-151654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1743',
internalId:  '',
customField: '20100510-160235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1806',
internalId:  '',
customField: '20100604-170218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52001',
internalId:  '',
customField: '20090722-154755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52701',
internalId:  '',
customField: '20090722-155020'
};
webappMappings['7008']=webappMappings['7008-9962']={
webappId:    '7008',
documentId:  '75001',
internalId:  '9962',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63201',
internalId:  '',
customField: '20080311-131256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1722',
internalId:  '',
customField: '20080227-203425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57801',
internalId:  '',
customField: '20080124-130847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75001',
internalId:  '',
customField: '20100608-113513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1764',
internalId:  '',
customField: '20070607-122744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1785',
internalId:  '',
customField: '20070611-175648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52722',
internalId:  '',
customField: '20080123-132942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1827',
internalId:  '',
customField: '20100622-131337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1848',
internalId:  '',
customField: '20070609-120816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49801',
internalId:  '',
customField: '20070613-080615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49401',
internalId:  '',
customField: '20070612-171523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77601',
internalId:  '',
customField: '20100104-171235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80801',
internalId:  '',
customField: '20100806-110132'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INVT1R';
var companyName   = 'Powerhead+Games';
var htmlTitle	  = 'Powerhead+Games';
var metaKeywords  = 'gamedeveloper+videogame+powerhead+powerheadgames+game+games+nintendo+nintendods+wii+xbox+xbox360+developer++PHG';
var metaContents  = 'gamedeveloper+videogame+powerhead+powerheadgames+game+games+nintendo+nintendods+wii+xbox+xbox360+developer++PHG';
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();
};
