/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','1873',jdecode('Products'),jdecode(''),'/1873/index.html','true',[ 
		['PAGE','18901',jdecode('Knots+%26+Leader+Systems'),jdecode(''),'/1873/18901.html','true',[],''],
		['PAGE','18922',jdecode('Bimini+Twist+Knotmaker'),jdecode(''),'/1873/18922.html','true',[],''],
		['PAGE','23901',jdecode('Knot+Tying+Assitant'),jdecode(''),'/1873/23901.html','true',[],''],
		['PAGE','69585',jdecode('Stripping+Finger+Socks'),jdecode(''),'/1873/69585.html','true',[],''],
		['PAGE','116473',jdecode('Hook-Removal+Pliers'),jdecode(''),'/1873/116473.html','true',[],'']
	],''],
	['PAGE','69606',jdecode('Services'),jdecode(''),'/69606/index.html','true',[ 
		['PAGE','18001',jdecode('Fly+Casting+Instruction'),jdecode(''),'/69606/18001.html','true',[],''],
		['PAGE','69627',jdecode('Digital+Fishing+Programs'),jdecode(''),'/69606/69627.html','true',[],''],
		['PAGE','69985',jdecode('Schools+%26+Classes'),jdecode(''),'/69606/69985.html','true',[],''],
		['PAGE','69648',jdecode('Guided+Fly+Fishing+Trips'),jdecode(''),'/69606/69648.html','true',[],'']
	],''],
	['PAGE','12701',jdecode('Feature+Articles'),jdecode(''),'/12701.html','true',[],''],
	['PAGE','31323',jdecode('Photo+Galleries'),jdecode(''),'/31323/index.html','true',[ 
		['PAGE','95609',jdecode('Nature%26%23x27%3Bs+Beauty'),jdecode(''),'/31323/95609.html','true',[],''],
		['PAGE','96209',jdecode('Freshwater+Fishes'),jdecode(''),'/31323/96209.html','true',[],''],
		['PAGE','100461',jdecode('Saltwater+Fishes'),jdecode(''),'/31323/100461.html','true',[],''],
		['PAGE','102673',jdecode('Insects+%26+Creatures'),jdecode(''),'/31323/102673.html','true',[],''],
		['PAGE','104371',jdecode('Fly+Designs'),jdecode(''),'/31323/104371.html','true',[],'']
	],''],
	['PAGE','69774',jdecode('Interesting+Links'),jdecode(''),'/69774.html','true',[],''],
	['PAGE','22701',jdecode('Contact+Us'),jdecode(''),'/22701.html','true',[],'']];
var siteelementCount=21;
theSitetree.topTemplateName='Verve';
theSitetree.paletteFamily='D94747';
theSitetree.keyvisualId='8381';
theSitetree.keyvisualName='kv_8381.jpg';
theSitetree.fontsetId='17070';
theSitetree.graphicsetId='12443';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Verve',
				paletteFamily: 	'D94747',
				keyvisualId: 	'8381',
				keyvisualName: 	'kv_8381.jpg',
				fontsetId: 		'17070',
				graphicsetId: 	'12443',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20090515-201118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20090513-000250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31323',
internalId:  '',
customField: '20090321-211807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20090515-121505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18922',
internalId:  '',
customField: '20090516-104917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20090515-203419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20090515-094425'
};
webappMappings['7008']=webappMappings['7008-4411']={
webappId:    '7008',
documentId:  '22701',
internalId:  '4411',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20080529-160549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23901',
internalId:  '',
customField: '20090513-000036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104371',
internalId:  '',
customField: '20081218-005937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69585',
internalId:  '',
customField: '20090514-221205'
};
webappMappings['7060']=webappMappings['7060-96f32f9068ba6119db999f801b1afc67']={
webappId:    '7060',
documentId:  '104371',
internalId:  '96f32f9068ba6119db999f801b1afc67',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69774',
internalId:  '',
customField: '20090225-123757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69606',
internalId:  '',
customField: '20090515-093508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69627',
internalId:  '',
customField: '20090109-100541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69985',
internalId:  '',
customField: '20090515-121733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69648',
internalId:  '',
customField: '20090515-100305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116473',
internalId:  '',
customField: '20090515-102025'
};
webappMappings['7060']=webappMappings['7060-081392a40f2c2edd912de5d39d2e61af']={
webappId:    '7060',
documentId:  '95609',
internalId:  '081392a40f2c2edd912de5d39d2e61af',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95609',
internalId:  '',
customField: '20081217-212756'
};
webappMappings['7060']=webappMappings['7060-e01b3b77756a90755692a1ee81e30839']={
webappId:    '7060',
documentId:  '96209',
internalId:  'e01b3b77756a90755692a1ee81e30839',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96209',
internalId:  '',
customField: '20081217-213019'
};
webappMappings['7060']=webappMappings['7060-3c330598604c2f08a751e68c2e6ca5b9']={
webappId:    '7060',
documentId:  '100461',
internalId:  '3c330598604c2f08a751e68c2e6ca5b9',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100461',
internalId:  '',
customField: '20081217-223700'
};
webappMappings['7060']=webappMappings['7060-5247c118d2c6dddf1d6fa84647c11cf8']={
webappId:    '7060',
documentId:  '102673',
internalId:  '5247c118d2c6dddf1d6fa84647c11cf8',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102673',
internalId:  '',
customField: '20081218-003835'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2TLD';
var companyName   = 'Advancing+the+Art+%26+Science+of+Fly+Fishing';
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();
};
