/* [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','752',jdecode('Desiderata+Music'),jdecode(''),'/752.html','true',[],'',''],
	['PAGE','5785',jdecode('CJ+as+Patsy+Cline'),jdecode(''),'/5785/index.html','true',[ 
		['PAGE','5806',jdecode('Video'),jdecode(''),'/5785/5806.html','true',[],'',''],
		['PAGE','5827',jdecode('Music'),jdecode(''),'/5785/5827.html','true',[],'',''],
		['PAGE','16301',jdecode('CJ+as+Patsy+Cline+Pics'),jdecode(''),'/5785/16301.html','true',[],'',''],
		['PAGE','32322',jdecode('Quotes'),jdecode(''),'/5785/32322.html','true',[],'','']
	],'',''],
	['PAGE','5701',jdecode('CJ+Singer%2FSongwriter'),jdecode(''),'/5701/index.html','true',[ 
		['PAGE','815',jdecode('CJ%26%23x27%3Bs+Bio+'),jdecode(''),'/5701/815.html','true',[],'',''],
		['PAGE','31043',jdecode('CJ%26%23x27%3Bs+Song+Lyrics'),jdecode(''),'/5701/31043.html','true',[],'',''],
		['PAGE','27501',jdecode('CJ+Harding+Photos%2C+Music+%26+Video'),jdecode(''),'/5701/27501.html','true',[],'','']
	],'',''],
	['PAGE','41301',jdecode('Chris+Carpenter'),jdecode(''),'/41301/index.html','true',[ 
		['PAGE','50101',jdecode('Chris%26%23x27%3B+Bio'),jdecode(''),'/41301/50101.html','true',[],'',''],
		['PAGE','50122',jdecode('Chris%26%23x27%3B+Video+Links'),jdecode(''),'/41301/50122.html','true',[],'',''],
		['PAGE','50143',jdecode('Chris%26%23x27%3B+Music+Links'),jdecode(''),'/41301/50143.html','true',[],'',''],
		['PAGE','69601',jdecode('Chris%26%23x27%3B+Pics+%26+Music'),jdecode(''),'/41301/69601.html','true',[],'',''],
		['PAGE','76801',jdecode('San+Diego+Troubadour+Article+'),jdecode(''),'/41301/76801.html','true',[],'','']
	],'',''],
	['PAGE','1067',jdecode('Links'),jdecode(''),'/1067.html','true',[],'',''],
	['PAGE','50164',jdecode('Contact'),jdecode(''),'/50164.html','true',[],'',''],
	['PAGE','64006',jdecode('Guestbook'),jdecode(''),'/64006.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Speed';
theSitetree.paletteFamily='920000';
theSitetree.keyvisualId='2342';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='373';
theSitetree.graphicsetId='424';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='920000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Speed',
				paletteFamily: 	'920000',
				keyvisualId: 	'2342',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'373',
				graphicsetId: 	'424',
				contentColor: 	'FFFFFF',
				contentBGColor: '920000',
				a_color: 		'920000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-64006aen010inltfi']={
webappId:    '1002',
documentId:  '64006',
internalId:  '64006aen010inltfi',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-8e64b3d7a1f827a67b93f6297f82423a']={
webappId:    '7060',
documentId:  '16301',
internalId:  '8e64b3d7a1f827a67b93f6297f82423a',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-db5c694e9ebc0fc55f8e424f6b83694c']={
webappId:    '7060',
documentId:  '27501',
internalId:  'db5c694e9ebc0fc55f8e424f6b83694c',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-14182227']={
webappId:    '1501',
documentId:  '701',
internalId:  '14182227',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20101130-111208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20101130-111537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5785',
internalId:  '',
customField: '20101130-110506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5806',
internalId:  '',
customField: '20101130-150536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5827',
internalId:  '',
customField: '20090317-172937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16301',
internalId:  '',
customField: '20090317-173036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32322',
internalId:  '',
customField: '20090101-192250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20090317-163926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '815',
internalId:  '',
customField: '20081108-152012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31043',
internalId:  '',
customField: '20090317-170609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20090519-203353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41301',
internalId:  '',
customField: '20101130-144324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50101',
internalId:  '',
customField: '20101130-151609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50122',
internalId:  '',
customField: '20090519-203132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50143',
internalId:  '',
customField: '20101130-145605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1067',
internalId:  '',
customField: '20101130-110416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50164',
internalId:  '',
customField: '20090107-221259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64006',
internalId:  '',
customField: '20090519-202556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76801',
internalId:  '',
customField: '20101130-152331'
};
webappMappings['7060']=webappMappings['7060-a3fc002b1ce6f02230772f373a364d98']={
webappId:    '7060',
documentId:  '69601',
internalId:  'a3fc002b1ce6f02230772f373a364d98',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69601',
internalId:  '',
customField: '20090317-170807'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010INLTFI';
var companyName   = 'DESIDERATA+MUSIC';
var htmlTitle	  = 'DESIDERATA+MUSIC';
var metaKeywords  = 'Cline+Patsy+CJ+Harding+Tribute+Acts+Crazy+Sweet+Dreams';
var metaContents  = 'Patsy+Cline+CJ+Harding+Patsy+Cline+Tributes+Sweet+Dreams+Crazy';
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();
};

