/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','1852',jdecode('Products'),jdecode(''),'/1852.html','true',[],'',''],
	['PAGE','1873',jdecode('Music+%26+Photos'),jdecode(''),'/1873.html','true',[],'',''],
	['PAGE','1894',jdecode('The+Eagle%26%23x27%3Bs+Fall'),jdecode(''),'/1894.html','true',[],'',''],
	['PAGE','1915',jdecode('Tour+Schedule'),jdecode(''),'/1915.html','true',[],'',''],
	['PAGE','1936',jdecode('Testimonials'),jdecode(''),'/1936.html','true',[],'',''],
	['PAGE','1957',jdecode('Awards'),jdecode(''),'/1957.html','true',[],'',''],
	['PAGE','1978',jdecode('Judah+Hill%26%23x27%3Bs+Music'),jdecode(''),'/1978.html','true',[],'',''],
	['PAGE','1999',jdecode('Contact'),jdecode(''),'/1999.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='FF7112';
theSitetree.keyvisualId='8819';
theSitetree.keyvisualName='KV_05.swf';
theSitetree.fontsetId='17181';
theSitetree.graphicsetId='12654';
theSitetree.contentColor='FF7112';
theSitetree.contentBGColor='262626';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Holz',
				paletteFamily: 	'FF7112',
				keyvisualId: 	'8819',
				keyvisualName: 	'KV_05.swf',
				fontsetId: 		'17181',
				graphicsetId: 	'12654',
				contentColor: 	'FF7112',
				contentBGColor: '262626',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FF6600',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100706-125817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20100709-174102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1957',
internalId:  '',
customField: '20100706-125851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1936',
internalId:  '',
customField: '20100706-154128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20090830-225051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20100709-171848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1915',
internalId:  '',
customField: '20100813-164453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1978',
internalId:  '',
customField: '20100224-230727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1999',
internalId:  '',
customField: '20100426-093755'
};
webappMappings['1501']=webappMappings['1501-21934709']={
webappId:    '1501',
documentId:  '1801',
internalId:  '21934709',
customField: '1501'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INV9MI';
var companyName   = 'Music+Evangelist+Brett+Hill';
var htmlTitle	  = 'For+the+Love+of+Christ+%26+Country';
var metaKeywords  = 'Brett+Hill%2C+Jesus+Christ%2C+Award+winning%2C+Songwriter%2C+Music%2C+video%2C+music+video%2C+missionary%2C+guitarists%2C+musician%2C+Booking%2C+church+events%2C+Travel%2C+ministry%2C+Mexico%2C+Cowboy+Church%2C+pastor%2C+contact+us%2C+God%2C+Gods+Word%2C+Ordained%2C+America%2C+Salvation%2C+Saved%2C+';
var metaContents  = 'Brett+Hill+is+a+music+Evangelist+in+heart+and+in+spirit.+His+life+is+devoted+to+the+service+of+Jesus+Christ+in+every+aspect.+He+spends+most+of+his+Off+the+road+time+trying+to+find+a+way+to+get+back+on+it.+Traveling+and+sharing+the+good+news+of+Jesus+Christ+is+all+his+heart+will+allow+him+to+do.+Brett+is+an+award+winning+songwriter%2C+an+outstanding+musician%2C+a+solo+and+backup+vocalist%2C+an+author+of+several+books%2C+an+international+missionary%2C+and+an+ordained+minister+of+Gods+Word.+In+this+website+you+will+find+information+on+how+to+book+Brett+Hill+at+your+church+or+event.+You+will+read+testimonials+of+pastors+and+friends+who+have+had+Brett+at+their+churches.+You+will+have+the+opportunity+to+watch+videos%2C+listen+to+music%2C+and+order+ministry+products.';
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();
};
