/* [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','2101',jdecode('Home'),jdecode(''),'/2101.html','true',[],''],
	['PAGE','2152',jdecode('Authors'),jdecode(''),'/2152/index.html','true',[ 
		['PAGE','2173',jdecode('A.K.+Stanfield'),jdecode(''),'/2152/2173.html','true',[],''],
		['PAGE','2194',jdecode('travis+craig'),jdecode(''),'/2152/2194.html','true',[],''],
		['PAGE','2215',jdecode('David+L.+Gray'),jdecode(''),'/2152/2215.html','true',[],''],
		['PAGE','2236',jdecode('Carla+Pennington'),jdecode(''),'/2152/2236.html','true',[],''],
		['PAGE','2257',jdecode('Mobile+Bay+Writing+Project'),jdecode(''),'/2152/2257.html','true',[],'']
	],''],
	['PAGE','2278',jdecode('Trade+Paperbacks'),jdecode(''),'/2278/index.html','true',[ 
		['PAGE','2299',jdecode('D.E.'),jdecode(''),'/2278/2299.html','true',[],''],
		['PAGE','3201',jdecode('Deep+Orange'),jdecode(''),'/2278/3201.html','true',[],''],
		['PAGE','3222',jdecode('Zen+Smoking'),jdecode(''),'/2278/3222.html','true',[],''],
		['PAGE','2320',jdecode('99+City'),jdecode(''),'/2278/2320.html','true',[],''],
		['PAGE','2341',jdecode('The+Fourth+Seal'),jdecode(''),'/2278/2341.html','true',[],''],
		['PAGE','2362',jdecode('Fling'),jdecode(''),'/2278/2362.html','true',[],''],
		['PAGE','2383',jdecode('Voice%2C+Place%2C+%26+Renewal'),jdecode(''),'/2278/2383.html','true',[],''],
		['PAGE','2404',jdecode('Voices+from+a+Safe+Harbor'),jdecode(''),'/2278/2404.html','true',[],'']
	],''],
	['PAGE','2467',jdecode('Editor%26%23x27%3Bs+Page'),jdecode(''),'/2467.html','true',[],''],
	['PAGE','2488',jdecode('Health+%26+Fitness'),jdecode(''),'/2488.html','true',[],''],
	['PAGE','2801',jdecode('Forums'),jdecode(''),'/2801.html','true',[],''],
	['PAGE','2822',jdecode('Guestbook'),jdecode(''),'/2822.html','true',[],''],
	['PAGE','4001',jdecode('News+and+Reviews'),jdecode(''),'/4001.html','true',[],''],
	['PAGE','2530',jdecode('Contact+Kyteflyte'),jdecode(''),'/2530.html','true',[],''],
	['PAGE','2509',jdecode('About+us'),jdecode(''),'/2509.html','true',[],'']];
var siteelementCount=23;
theSitetree.topTemplateName='Stars';
theSitetree.paletteFamily='3C5284';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10466';
theSitetree.graphicsetId='10913';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3C5284';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Stars',
				paletteFamily: 	'3C5284',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10466',
				graphicsetId: 	'10913',
				contentColor: 	'FFFFFF',
				contentBGColor: '3C5284',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'3C5284',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7050']=webappMappings['7050-2359']={
webappId:    '7050',
documentId:  '2467',
internalId:  '2359',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20081227-024715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2152',
internalId:  '',
customField: '20081227-024635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2278',
internalId:  '',
customField: '20080714-230202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2467',
internalId:  '',
customField: '20080714-224559'
};
webappMappings['1003']=webappMappings['1003-aendu0in2ulw119fe533a7a']={
webappId:    '1003',
documentId:  '2801',
internalId:  'aendu0in2ulw119fe533a7a',
customField: 'en:US'
};
webappMappings['1002']=webappMappings['1002-2822aendu0in2ulw']={
webappId:    '1002',
documentId:  '2822',
internalId:  '2822aendu0in2ulw',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2173',
internalId:  '',
customField: '20080714-225844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2194',
internalId:  '',
customField: '20081227-025910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2341',
internalId:  '',
customField: '20080817-131854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2822',
internalId:  '',
customField: '20080522-224051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2320',
internalId:  '',
customField: '20080817-131837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3222',
internalId:  '',
customField: '20080817-132357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20080817-132421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2299',
internalId:  '',
customField: '20080817-131809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2362',
internalId:  '',
customField: '20080817-131736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2383',
internalId:  '',
customField: '20081227-030136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2404',
internalId:  '',
customField: '20081227-030218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2257',
internalId:  '',
customField: '20081227-030035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2488',
internalId:  '',
customField: '20080522-222419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20080522-224029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20080714-231704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2509',
internalId:  '',
customField: '20080714-223637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2215',
internalId:  '',
customField: '20081227-025936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2236',
internalId:  '',
customField: '20081227-025811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2530',
internalId:  '',
customField: '20080714-225226'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2ULW';
var companyName   = 'Kyteflyte+Productions';
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();
};
