/* [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','5601',jdecode('Home'),jdecode(''),'/5601.html','true',[],'',''],
	['PAGE','5652',jdecode('Find+a+Store'),jdecode(''),'/5652/index.html','false',[ 
		['PAGE','11601',jdecode('Find+a+Store+A-K'),jdecode(''),'/5652/11601.html','false',[],'',''],
		['PAGE','11622',jdecode('Find+a+Store+L-O'),jdecode(''),'/5652/11622.html','false',[],'',''],
		['PAGE','11643',jdecode('Find+a+Store+P-Z'),jdecode(''),'/5652/11643.html','false',[],'',''],
		['PAGE','50401',jdecode('Utah+Stores'),jdecode(''),'/5652/50401.html','false',[],'',''],
		['PAGE','50422',jdecode('Wyoming+Stores'),jdecode(''),'/5652/50422.html','false',[],'','']
	],'',''],
	['PAGE','7501',jdecode('Dealers'),jdecode(''),'/7501.html','true',[],'',''],
	['PAGE','32201',jdecode('Products'),jdecode(''),'/32201.html','true',[],'',''],
	['PAGE','6522',jdecode('Terms'),jdecode(''),'/6522.html','false',[],'',''],
	['PAGE','29801',jdecode('Share+Your+Stories'),jdecode(''),'/29801.html','true',[],'',''],
	['PAGE','53401',jdecode('Pictures+and+comments'),jdecode(''),'/53401.html','true',[],'',''],
	['PAGE','7522',jdecode('Contact'),jdecode(''),'/7522/index.html','true',[ 
		['PAGE','8701',jdecode('Email'),jdecode(''),'/7522/8701.html','false',[],'','']
	],'',''],
	['PAGE','9101',jdecode('About+us'),jdecode(''),'/9101.html','true',[],'',''],
	['PAGE','54401',jdecode('Resources+1'),jdecode(''),'/54401/index.html','false',[ 
		['PAGE','58901',jdecode('2'),jdecode(''),'/54401/58901.html','false',[],'','']
	],'',''],
	['PAGE','9701',jdecode('Video+1'),jdecode(''),'/9701.html','false',[],'',''],
	['PAGE','43101',jdecode('Privacy+Policy'),jdecode(''),'/43101.html','false',[],'',''],
	['PAGE','43122',jdecode('Shipping+Policy'),jdecode(''),'/43122.html','false',[],'',''],
	['PAGE','64501',jdecode('3'),jdecode(''),'/64501.html','false',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='F5F5F5';
theSitetree.keyvisualId='2155';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='355';
theSitetree.graphicsetId='407';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F5F5F5';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Medium',
				paletteFamily: 	'F5F5F5',
				keyvisualId: 	'2155',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'355',
				graphicsetId: 	'407',
				contentColor: 	'000000',
				contentBGColor: 'F5F5F5',
				a_color: 		'F5F5F5',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43101',
internalId:  '',
customField: '20091110-183707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20100624-123414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5652',
internalId:  '',
customField: '20100112-155811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50401',
internalId:  '',
customField: '20100112-162230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58901',
internalId:  '',
customField: '20100709-212048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6522',
internalId:  '',
customField: '20090312-125330'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7522',
internalId:  '',
customField: '20091110-184504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29801',
internalId:  '',
customField: '20100212-155621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43122',
internalId:  '',
customField: '20100116-164435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54401',
internalId:  '',
customField: '20100708-143337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64501',
internalId:  '',
customField: '20100722-121643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20100301-171949'
};
webappMappings['7008']=webappMappings['7008-2415']={
webappId:    '7008',
documentId:  '8701',
internalId:  '2415',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20090424-154032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20090921-162820'
};
webappMappings['7060']=webappMappings['7060-94ced97c029204998b77db89aaec1fb2']={
webappId:    '7060',
documentId:  '9701',
internalId:  '94ced97c029204998b77db89aaec1fb2',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20090313-153459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20100112-161045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11622',
internalId:  '',
customField: '20100112-161110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11643',
internalId:  '',
customField: '20100112-155953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32201',
internalId:  '',
customField: '20100123-133816'
};
webappMappings['1003']=webappMappings['1003-ahw050inlwgy120d9b83953']={
webappId:    '1003',
documentId:  '29801',
internalId:  'ahw050inlwgy120d9b83953',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50422',
internalId:  '',
customField: '20100112-162333'
};
webappMappings['7060']=webappMappings['7060-4079cdddf2703d95b9e4bad01b80cb19']={
webappId:    '7060',
documentId:  '53401',
internalId:  '4079cdddf2703d95b9e4bad01b80cb19',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53401',
internalId:  '',
customField: '20100212-161429'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INLWGY';
var companyName   = 'Alger+Enterprises';
var htmlTitle	  = 'Ice-N-Easy+rods%3A+The+ultimate+ice+fishing+rod';
var metaKeywords  = 'ice-n-easy%2C+ice+fishing+rods%2C+fishing%2C+ice+rods%2C+handle%2C+fish%2C+ice+rod%2C+reel%2C+strike+indicator%2C+ice+n+easy%2C+fishing+rod%2C+ice-n-easy+rod%2C+ice+fishing+equipment%2C+Ice-N-Easy%2C+Ice-n-easy+fishing+rods%2C+ice+and+easy%2C+ice+fishing%2C+nice+and+easy%2C+ice+and+easy+rods%2C+ice+fishing+poles%2C+ice+fishing+rod%2C+ice%2C+ice+rod%2C+jigging+rods%2C+spring+bobber';
var metaContents  = 'Ice-N-Easy+ice+fishing+rods.++The+ice+fishing+rod+that+keeps+reel+and+line+off+the+ice.++Each+ice+rod+comes+with+a+strike+indicator.++We+also+have+jigging+rods+in+our+clearance+section.';
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();
};
