/* [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','52301',jdecode('News'),jdecode(''),'/52301.html','true',[],'',''],
	['PAGE','3001',jdecode('Home'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','52601',jdecode('Pro+Team'),jdecode(''),'/52601.html','true',[],'',''],
	['PAGE','3052',jdecode('About+us'),jdecode(''),'/3052.html','true',[],'',''],
	['PAGE','26401',jdecode('18g+Sprat+Spoon'),jdecode(''),'/26401.html','true',[],'',''],
	['PAGE','26301',jdecode('35g+Herring+Spoon'),jdecode(''),'/26301.html','true',[],'',''],
	['PAGE','26422',jdecode('100g+Herring+Spoon'),jdecode(''),'/26422.html','true',[],'',''],
	['PAGE','26443',jdecode('110g+Sprat+Jig'),jdecode(''),'/26443.html','true',[],'',''],
	['PAGE','26464',jdecode('160g+Butterfly+Jig'),jdecode(''),'/26464.html','true',[],'',''],
	['PAGE','26485',jdecode('180g+Herring+Jig'),jdecode(''),'/26485.html','true',[],'',''],
	['PAGE','26506',jdecode('200g+Garfish+Jig'),jdecode(''),'/26506.html','true',[],'',''],
	['PAGE','26527',jdecode('350g+Jobfish+Jig'),jdecode(''),'/26527.html','true',[],'',''],
	['PAGE','26548',jdecode('400g+Silky+Jig'),jdecode(''),'/26548.html','true',[],'',''],
	['PAGE','26569',jdecode('100g+Octopus+Jig'),jdecode(''),'/26569.html','true',[],'',''],
	['PAGE','26590',jdecode('200g+Squid+Jig'),jdecode(''),'/26590.html','true',[],'',''],
	['PAGE','35401',jdecode('Fishing+Tanzania'),jdecode(''),'/35401.html','true',[],'',''],
	['PAGE','10201',jdecode('Gallery'),jdecode(''),'/10201.html','true',[],'',''],
	['PAGE','3094',jdecode('Contact'),jdecode(''),'/3094.html','true',[],'',''],
	['PAGE','49901',jdecode('Google+Code'),jdecode(''),'/49901.html','false',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Common';
theSitetree.paletteFamily='D40202';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='26636';
theSitetree.graphicsetId='13449';
theSitetree.contentColor='D40202';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Common',
				paletteFamily: 	'D40202',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'26636',
				graphicsetId: 	'13449',
				contentColor: 	'D40202',
				contentBGColor: 'FFFFFF',
				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:  '3001',
internalId:  '',
customField: '20090716-002708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3052',
internalId:  '',
customField: '20090204-215923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26401',
internalId:  '',
customField: '20090214-101333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20090204-002835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26422',
internalId:  '',
customField: '20090201-231212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26301',
internalId:  '',
customField: '20090218-225528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26443',
internalId:  '',
customField: '20090201-231814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26464',
internalId:  '',
customField: '20090220-232930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26485',
internalId:  '',
customField: '20090201-232149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26506',
internalId:  '',
customField: '20090305-141833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26527',
internalId:  '',
customField: '20090211-112130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26548',
internalId:  '',
customField: '20090201-232542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26569',
internalId:  '',
customField: '20090211-114645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26590',
internalId:  '',
customField: '20090211-114801'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '52301',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-9f61b51effdaf69d7977b856e42a847f']={
webappId:    '7060',
documentId:  '10201',
internalId:  '9f61b51effdaf69d7977b856e42a847f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3094',
internalId:  '',
customField: '20090202-235433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20090211-114524'
};
webappMappings['7060']=webappMappings['7060-9b5f177d6a0f49184152008bbeaada02']={
webappId:    '7060',
documentId:  '35401',
internalId:  '9b5f177d6a0f49184152008bbeaada02',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49901',
internalId:  '',
customField: '20090224-084917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52301',
internalId:  '',
customField: '20090716-003237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52601',
internalId:  '',
customField: '20090716-001149'
};
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10INXH61';
var companyName   = 'Fishing+Lunatics';
var htmlTitle	  = 'Vertical+Jigging';
var metaKeywords  = 'Vertical+Jigging%2C+Fishing+Lunatics%2C+Saltwater+jigging%2C+jigging%2C+jigs%2C+Bite+Me';
var metaContents  = 'Vertical+Jigging+Specialists';
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();
};
