/* [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','6501',jdecode('Home+Page'),jdecode(''), jdecode('%2F6501.html'), 'true',[],'',''],
	['ITEM','94012',jdecode('Randy%26%23x27%3Bs+Record+Store'),jdecode(''), jdecode('http%3A%2F%2Fikahnrecords.com%2Fstore%2Findex.html'), 'true',[],'','_blank'],
	['PAGE','30212',jdecode('Listening+Room'),jdecode(''), jdecode('%2F30212.html'), 'true',[],'',''],
	['PAGE','35412',jdecode('The+%22MARY+SHOW%22'),jdecode(''), jdecode('%2F35412.html'), 'true',[],'',''],
	['PAGE','49412',jdecode('Host+A+Performance'),jdecode(''), jdecode('%2F49412.html'), 'true',[],'',''],
	['PAGE','17401',jdecode('Guest+Book'),jdecode(''), jdecode('%2F17401.html'), 'true',[],'',''],
	['PAGE','95212',jdecode('Concert+Schedule'),jdecode(''), jdecode('%2F95212.html'), 'true',[],'',''],
	['PAGE','118412',jdecode('Video+Room'),jdecode(''), jdecode('%2F118412.html'), 'true',[],'',''],
	['PAGE','69112',jdecode('Country+Music+%26+More'),jdecode(''), jdecode('%2F69112.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Antique';
theSitetree.paletteFamily='CAB996';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11063';
theSitetree.graphicsetId='11834';
theSitetree.contentColor='D1C3A6';
theSitetree.contentBGColor='856A3B';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antique',
				paletteFamily: 	'CAB996',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11063',
				graphicsetId: 	'11834',
				contentColor: 	'D1C3A6',
				contentBGColor: '856A3B',
				a_color: 		'664F23',
				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: '20111201-141603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118412',
internalId:  '',
customField: '20111110-123834'
};
webappMappings['1002']=webappMappings['1002-17401aendu0in26ca']={
webappId:    '1002',
documentId:  '17401',
internalId:  '17401aendu0in26ca',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20111107-161132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69112',
internalId:  '',
customField: '20111114-091606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30212',
internalId:  '',
customField: '20111201-141215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35412',
internalId:  '',
customField: '20111126-101213'
};
webappMappings['7008']=webappMappings['7008-23093']={
webappId:    '7008',
documentId:  '49412',
internalId:  '23093',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95212',
internalId:  '',
customField: '20120122-121628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49412',
internalId:  '',
customField: '20111126-101400'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6501',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.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%2Cnetwork%2Cevangelist%2Cnashville%2Cblessed%2Csongs+of+mary%2Cmary+songs%2Ccatholic+hymms%2Cvirgin%2Cmary%2Cchurch%2Cmusic%2Cmp3%2Cbuy%2Ccd%2Cpolka%2C+EWTN%2Cjukebox%2Cangelica%2Chail+holy+queen%2Cmary+said+yes%2Cperpetual%2Chelp%2Cgilead%2Clake%2Cpolka+party%2Cbronson%2Cnashville%27s+catholic%2C+record+%2Ccompany%2Cnational+catholic%2Cregister%2Cascap%2Cbmi%2Cnasi%2Csong%2Cwriter%2Ccma%2Ccmn%2Cdivine+mercy%2Cchaplet%2Cmusical%2Ccelebration%2Cfamily+reunion%2Cprayer%2Cfaustina%2Cchaplet+of+divine+mercy%2Cdivine+mercy+chaplet%2Cpray%2Cguitar%2Cstring+quarter%2Ccomposer%2Csinger%2Csongwriter%2Cartist%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%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+Catholic+Marian+Music+Website';
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();
};

