/* [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','6101',jdecode('Home'),jdecode(''),'/6101.html','true',[],''],
	['PAGE','36201',jdecode('Products'),jdecode(''),'/36201/index.html','true',[ 
		['PAGE','33522',jdecode('Creature+Baits'),jdecode(''),'/36201/33522.html','true',[],''],
		['PAGE','7543',jdecode('Lizards+%2F+Frogs'),jdecode(''),'/36201/7543.html','true',[],''],
		['PAGE','7606',jdecode('Shadee+Shad'),jdecode(''),'/36201/7606.html','true',[],''],
		['PAGE','33501',jdecode('Shakey+Head'),jdecode(''),'/36201/33501.html','true',[],''],
		['PAGE','7522',jdecode('Speed+Falls'),jdecode(''),'/36201/7522.html','true',[],''],
		['PAGE','7585',jdecode('Worms'),jdecode(''),'/36201/7585.html','true',[],''],
		['PAGE','15401',jdecode('Colors'),jdecode(''),'/36201/15401.html','true',[],''],
		['PAGE','38401',jdecode('Dyes'),jdecode(''),'/36201/38401.html','true',[],'']
	],''],
	['PAGE','33601',jdecode('Hard+Heads'),jdecode(''),'/33601.html','true',[],''],
	['PAGE','7564',jdecode('Team+Edge+Pictures'),jdecode(''),'/7564/index.html','true',[ 
		['PAGE','35601',jdecode('Jr.Team+Edge'),jdecode(''),'/7564/35601.html','true',[],'']
	],''],
	['PAGE','42501',jdecode('Oct+News'),jdecode(''),'/42501/index.html','true',[ 
		['PAGE','40801',jdecode('Sept.+News'),jdecode(''),'/42501/40801.html','true',[],''],
		['PAGE','21601',jdecode('Aug.+News'),jdecode(''),'/42501/21601.html','true',[],'']
	],''],
	['PAGE','7501',jdecode('Contact+Info'),jdecode(''),'/7501.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Grace';
theSitetree.paletteFamily='CECDD0';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32047';
theSitetree.graphicsetId='13873';
theSitetree.contentColor='484848';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Grace',
				paletteFamily: 	'CECDD0',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32047',
				graphicsetId: 	'13873',
				contentColor: 	'484848',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20090908-071352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20090821-010508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7522',
internalId:  '',
customField: '20090908-062501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40801',
internalId:  '',
customField: '20090929-002622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20090820-233623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21601',
internalId:  '',
customField: '20090906-070302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7543',
internalId:  '',
customField: '20090923-011130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7564',
internalId:  '',
customField: '20090929-002027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7585',
internalId:  '',
customField: '20090825-010931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7606',
internalId:  '',
customField: '20090916-204308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33501',
internalId:  '',
customField: '20090916-204002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33601',
internalId:  '',
customField: '20090916-204127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33522',
internalId:  '',
customField: '20090907-214548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35601',
internalId:  '',
customField: '20090908-065249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20090908-071159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38401',
internalId:  '',
customField: '20090922-193137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20091003-021313'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN3DNA';
var companyName   = 'Edge+Lures';
var htmlTitle	  = 'Edge+Lures.com';
var metaKeywords  = 'EDGE+LURES%2C+edge+lures%2C+Edge+Lures%2C+fishing%2C+lures%2C+plastic+worms%2C+speed+falls%2Cfrogs%2C+watermelon+red%2C+june+bug%2C+green+pumpkin%2C+spinner+bait%2C+buzz+bait%2C+flash+back%2C+finesse%2C+shads%2C+lizards%2C+snakes%2C+lures%2C+jigs%2C+get%2C+the%2C+edge%2C+american+made%2C+trailer%2C+fishing%2C+new%2C+super%2C+best%2C+great%2C+products%2C+cheap%2C+fish%2C+bass%2C+crappie%2C+fresh%2C+water%2C+striper%2C+fish%2C+cork%2C+blade%2C+sampo%2C+willow%2C+dye%2C+chartreuse%2C+advantage%2C+chart%2C+pro+staff%2C+ranger%2C+professional%2C+bags%2C+snap%2C+trips%2C+plug%2C+reel%2C+rod%2C+tackle';
var metaContents  = 'Edge+lures+sells+soft-plastic+fishing+lures.+Includes+speed+falls%2C+lizard%2C+finesse%2C+frogs%2C+shads+and+more...+In+a+wide+range+of+colors+ex.+Watermelon+Red%2C+June+Bug%2C+Green+Pumpkin+and+more...';
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();
};

