/* [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','1901',jdecode('Home'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','3801',jdecode('Testimony'),jdecode(''), jdecode('%2F3801.html'), 'true',[],'',''],
	['PAGE','3927',jdecode('Audio'),jdecode(''), jdecode('%2F3927.html'), 'true',[],'',''],
	['ITEM','16401',jdecode('You+Tube+Video'),jdecode(''), jdecode('http%3A%2F%2Fwww.youtube.com%2Fuser%2Fwayneselvisshow1%3Ffeature%3Dmhee'), 'true',[],'','_blank'],
	['PAGE','4201',jdecode('Photos'),jdecode(''), jdecode('%2F4201.html'), 'true',[],'',''],
	['PAGE','3906',jdecode('Song+List'),jdecode(''), jdecode('%2F3906.html'), 'true',[],'',''],
	['PAGE','6501',jdecode('Events+Schedule'),jdecode(''), jdecode('%2F6501.html'), 'true',[],'',''],
	['PAGE','6522',jdecode('Comments'),jdecode(''), jdecode('%2F6522.html'), 'true',[],'',''],
	['ITEM','10301',jdecode('Gigmasters.com'),jdecode(''), jdecode('http%3A%2F%2Fwww.gigmasters.com%2FElvis-Impersonator%2FWayne-Euliss%2F'), 'true',[],'','_blank'],
	['ITEM','10101',jdecode('Elvis.com'),jdecode(''), jdecode('http%3A%2F%2Felvis.com'), 'true',[],'','_blank'],
	['ITEM','10501',jdecode('Facebook+Fan+Page'),jdecode(''), jdecode('http%3A%2F%2Fwww.facebook.com%2F%23%21%2Fgroups%2F176680449087320%2F'), 'true',[],'','_blank'],
	['PAGE','10601',jdecode('Guestbook'),jdecode(''), jdecode('%2F10601.html'), 'true',[],'',''],
	['PAGE','4222',jdecode('Contact'),jdecode(''), jdecode('%2F4222.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Vegas';
theSitetree.paletteFamily='0A0847';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16928';
theSitetree.graphicsetId='12328';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0A0847';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'true',
				name: 			'Vegas',
				paletteFamily: 	'0A0847',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16928',
				graphicsetId: 	'12328',
				contentColor: 	'FFFFFF',
				contentBGColor: '0A0847',
				a_color: 		'0A0847',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20120129-200834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20120129-165508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20111226-135145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3927',
internalId:  '',
customField: '20120121-223724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4222',
internalId:  '',
customField: '20111226-124501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6522',
internalId:  '',
customField: '20120115-104511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20120129-201309'
};
webappMappings['7060']=webappMappings['7060-7a339f60416260ee73414bd005b23e05']={
webappId:    '7060',
documentId:  '3927',
internalId:  '7a339f60416260ee73414bd005b23e05',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-84d7db96376e7e90eec25f10b1e813ff']={
webappId:    '7060',
documentId:  '4201',
internalId:  '84d7db96376e7e90eec25f10b1e813ff',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-10601avf340i79qv7']={
webappId:    '1002',
documentId:  '10601',
internalId:  '10601avf340i79qv7',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3906',
internalId:  '',
customField: '20111227-222811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10601',
internalId:  '',
customField: '20111226-235040'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I79QV7';
var companyName   = 'ELVIS+TRIBUTE+ARTIST+WAYNE+EULISS';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};

