/* [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','5123',jdecode('Home'),jdecode(''),'/5123.html','true',[],''],
	['PAGE','46223',jdecode('Online+Shop'),jdecode(''),'/46223.html','true',[],''],
	['PAGE','58465',jdecode('K-1+Blog'),jdecode(''),'/58465.html','true',[],''],
	['PAGE','25523',jdecode('Product+Range'),jdecode(''),'/25523/index.html','true',[ 
		['PAGE','5195',jdecode('Boilies'),jdecode(''),'/25523/5195.html','true',[],''],
		['PAGE','5823',jdecode('Flavored+Corn'),jdecode(''),'/25523/5823.html','true',[],''],
		['PAGE','5844',jdecode('Flavors'),jdecode(''),'/25523/5844.html','true',[],''],
		['PAGE','5907',jdecode('Pack+Bait'),jdecode(''),'/25523/5907.html','true',[],''],
		['PAGE','5886',jdecode('Artificial+Baits'),jdecode(''),'/25523/5886.html','true',[],''],
		['PAGE','5216',jdecode('End+Zone+Range+Tackle'),jdecode(''),'/25523/5216.html','true',[],'']
	],''],
	['PAGE','15923',jdecode('News'),jdecode(''),'/15923.html','true',[],''],
	['PAGE','58423',jdecode('Articles'),jdecode(''),'/58423.html','true',[],''],
	['PAGE','65823',jdecode('How+To'),jdecode(''),'/65823.html','true',[],''],
	['PAGE','65844',jdecode('Carp+Rigs'),jdecode(''),'/65844.html','true',[],''],
	['PAGE','50123',jdecode('Carp+Gallery'),jdecode(''),'/50123.html','true',[],''],
	['PAGE','63223',jdecode('Carp+Gallery+2'),jdecode(''),'/63223.html','true',[],''],
	['PAGE','67123',jdecode('Carp+Gallery+3'),jdecode(''),'/67123.html','true',[],''],
	['PAGE','65623',jdecode('Buffalo+Gallery'),jdecode(''),'/65623.html','true',[],''],
	['PAGE','65644',jdecode('Catfish+Gallery'),jdecode(''),'/65644.html','true',[],''],
	['PAGE','58444',jdecode('Videos'),jdecode(''),'/58444.html','true',[],''],
	['PAGE','67223',jdecode('Weather'),jdecode(''),'/67223.html','true',[],''],
	['PAGE','58223',jdecode('Links'),jdecode(''),'/58223.html','true',[],''],
	['PAGE','47723',jdecode('Policies'),jdecode(''),'/47723.html','true',[],''],
	['PAGE','5237',jdecode('Contact+Us'),jdecode(''),'/5237.html','true',[],'']];
var siteelementCount=24;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5123',
internalId:  '',
customField: '20091222-173956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5823',
internalId:  '',
customField: '20091021-222524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5195',
internalId:  '',
customField: '20091021-222434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5216',
internalId:  '',
customField: '20091021-223749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5237',
internalId:  '',
customField: '20080901-080955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5844',
internalId:  '',
customField: '20091021-222622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47723',
internalId:  '',
customField: '20091222-174759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5886',
internalId:  '',
customField: '20080925-214704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5907',
internalId:  '',
customField: '20091021-223319'
};
webappMappings['1501']=webappMappings['1501-11652588']={
webappId:    '1501',
documentId:  '5123',
internalId:  '11652588',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5123',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-ae73e0fe942e1b46a49138ea53c8f138']={
webappId:    '7060',
documentId:  '50123',
internalId:  'ae73e0fe942e1b46a49138ea53c8f138',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15923',
internalId:  '',
customField: '20091021-230615'
};
webappMappings['7050']=webappMappings['7050-12957']={
webappId:    '7050',
documentId:  '58465',
internalId:  '12957',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25523',
internalId:  '',
customField: '20091021-222333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58223',
internalId:  '',
customField: '20091027-072602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46223',
internalId:  '',
customField: '20091027-122217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50123',
internalId:  '',
customField: '20080912-205239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58465',
internalId:  '',
customField: '20091026-225036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58444',
internalId:  '',
customField: '20091222-174432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58423',
internalId:  '',
customField: '20091022-123920'
};
webappMappings['7060']=webappMappings['7060-8357b06469ef33fb61ecc92a8c0ec09c']={
webappId:    '7060',
documentId:  '63223',
internalId:  '8357b06469ef33fb61ecc92a8c0ec09c',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63223',
internalId:  '',
customField: '20091222-174849'
};
webappMappings['7060']=webappMappings['7060-dbaf021c5d94efb39069a301b1dd3071']={
webappId:    '7060',
documentId:  '65623',
internalId:  'dbaf021c5d94efb39069a301b1dd3071',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-8084739541a9debaeb3798bdd6b5d69c']={
webappId:    '7060',
documentId:  '65644',
internalId:  '8084739541a9debaeb3798bdd6b5d69c',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65823',
internalId:  '',
customField: '20091222-175636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65844',
internalId:  '',
customField: '20091222-175328'
};
webappMappings['7060']=webappMappings['7060-48c5409b8e0e2ccb2ed057f98da5856d']={
webappId:    '7060',
documentId:  '67123',
internalId:  '48c5409b8e0e2ccb2ed057f98da5856d',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65623',
internalId:  '',
customField: '20091222-175008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65644',
internalId:  '',
customField: '20091222-175053'
};
webappMappings['7080']=webappMappings['7080-689']={
webappId:    '7080',
documentId:  '67223',
internalId:  '689',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67223',
internalId:  '',
customField: '20091222-174547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67123',
internalId:  '',
customField: '20091222-174926'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INE0AD';
var companyName   = 'K-1+BAITS.com';
var htmlTitle	  = 'www.K-1Baits.com';
var metaKeywords  = 'Fishing%2C+Carp%2C+Bait%2C+Tackle%2C+Boilies%2C+Catfish%2C+Buffalo%2C+Buffs%2C+Carpe%2C+Karpe%2C+Rigs%2C+Hooks%2C+Terminal+Tackle%2C+Corn%2C+Maize%2C+Pop+ups%2C+Hair+Rig%2C+End+Zone+Range';
var metaContents  = 'K-1+Baits+has+a+wide+selection+of+Carp+Fishing+Bait+and+Tackle+at+unbeatable+prices.';
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();
};
