/* [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 theSitetree=[ 
	['PAGE','6501',jdecode('Randy+Albright+Music'),jdecode(''),'/6501.html','true',[],''],
	['PAGE','30212',jdecode('Listen+To+All+Albums'),jdecode(''),'/30212.html','true',[],''],
	['PAGE','35412',jdecode('The+%22MARY+SHOW%22'),jdecode(''),'/35412.html','true',[],''],
	['PAGE','49412',jdecode('Book+The+Mary+Show'),jdecode(''),'/49412.html','true',[],''],
	['PAGE','69112',jdecode('More+Music...'),jdecode(''),'/69112.html','true',[],''],
	['PAGE','70012',jdecode('Win+a+FREE+CD'),jdecode(''),'/70012.html','false',[],''],
	['PAGE','17401',jdecode('Guest+Book'),jdecode(''),'/17401.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='View';
theSitetree.paletteFamily='ACC0FF';
theSitetree.keyvisualId='11410';
theSitetree.keyvisualName='kv_11410.jpg';
theSitetree.fontsetId='32028';
theSitetree.graphicsetId='13852';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='ACC0FF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'View',
				paletteFamily: 	'ACC0FF',
				keyvisualId: 	'11410',
				keyvisualName: 	'kv_11410.jpg',
				fontsetId: 		'32028',
				graphicsetId: 	'13852',
				contentColor: 	'FFFFFF',
				contentBGColor: 'ACC0FF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20100715-154335'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-17401aendu0in26ca']={
webappId:    '1002',
documentId:  '17401',
internalId:  '17401aendu0in26ca',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20080903-190444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69112',
internalId:  '',
customField: '20100715-175941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30212',
internalId:  '',
customField: '20100715-154321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35412',
internalId:  '',
customField: '20100624-153454'
};
webappMappings['7008']=webappMappings['7008-23093']={
webappId:    '7008',
documentId:  '49412',
internalId:  '23093',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70012',
internalId:  '',
customField: '20100624-122307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49412',
internalId:  '',
customField: '20100715-160430'
};
webappMappings['7008']=webappMappings['7008-29191']={
webappId:    '7008',
documentId:  '70012',
internalId:  '29191',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN26CA';
var companyName   = 'Official+Randy+Albright+Music+Site';
var htmlTitle	  = 'Randy+Albright+Official+music+website+Catholic+Polka+multi-genre+CMA+ASCAP+BMI+NSAI';
var metaKeywords  = 'randy+albright%2Calbright%2CCatholic%2Ccatholic+music%2Cblessed%2Cvirgin%2Cmary%2Cchurch%2Cmusic%2Cmp3%2Cbuy%2Ccd%2Cpolka%2Coberek%2Cwaltz%2C+EWTN%2Cjukebox%2Cangelica%2Chail+holy+queen%2Cmary+said+yes%2Cmother%2Cperpetual%2Chelp%2Cgilead%2Clake%2Cpolka+party%2Cbronson%2Cmichigan%2Cmy+love%2Cif+youre+polish%2Cpolish%2Cgirl%2Cpolishwedding%2Cnashville%2Cascap%2Cbmi%2Cnasi%2Csong%2Cwriter%2Ccma%2Ccmn%2Cnetwork%2Cdivine+mercy%2Cchaplet%2Cmusical%2Ccelebration%2Cfamily+reunion%2Cprayer%2Cfaustina%2Cchaplet+of+divine+mercy%2Cdivine+mercy+chaplet%2Cpray%2Cguitar%2Cstring+quarter%2Ccomposer%2Cvarious+artist+cd%2Csinger%2Csongwriter%2Cartist%2Cwedding+music%2Cchurch+music%2Cdownload%2Crecord+store%2Ccatholic+church%2Cchristmas%2Cchristmas+music%2Crosary%2Ccatholic+mass%2Cpope%2Cjesus%2Choly+spirit%2Cpolka+hop%2Cbeer%2Cdance%2Cpolka+dancing%2Cpolish+dance+music%2Clil+wally%2Ctribute%2Cpolish+festival%2Cikahn%2Cikahn+records%2Cikahnrecords+com%2Cikahnnashville%2Cpublishing%2Cukahnnashville%2Cmyspace.com%2Cmusic+row%2Cnashville+record+companies%2Cnashville+publisher%2Cdivine+chaplet%2Ccatholic+rosary%2Cour+lady+of+fatima%2Cour+lady+of+lourdes%2Cmother+of+mercy%2Cmother+of+perpetual+help%2Cwoman+clothed+with+the+sun%2Chail+mary%2Capostles+creed%2Cour+father%2Clords+prayer%2Cdivinem+mercy+sunday%2Cmercy+sunday%2Cmercy%2Ceucharist%2Ccatholic+prayer%2Cmiraculous+medal%2C';
var metaContents  = 'Randy+Albright+Official+Music+Website+of+Multi-genre+Catholic+Polish+Country+music';
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();
};
