/* [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','7101',jdecode('Music+Equipment'),jdecode(''),'/7101.html','true',[],''],
	['PAGE','7122',jdecode('Sporting+Equipment'),jdecode(''),'/7122.html','true',[],''],
	['PAGE','7143',jdecode('Contact+AntonGear'),jdecode(''),'/7143.html','true',[],''],
	['PAGE','7164',jdecode('About+Antongear'),jdecode(''),'/7164.html','true',[],''],
	['PAGE','7185',jdecode('Links'),jdecode(''),'/7185.html','true',[],''],
	['PAGE','7206',jdecode('Store+Policies'),jdecode(''),'/7206.html','true',[],''],
	['PAGE','7227',jdecode('News+Letter'),jdecode(''),'/7227.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Grace';
theSitetree.paletteFamily='80B3EC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32051';
theSitetree.graphicsetId='13871';
theSitetree.contentColor='484848';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Grace',
				paletteFamily: 	'80B3EC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32051',
				graphicsetId: 	'13871',
				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:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20080310-233615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20100327-133421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7185',
internalId:  '',
customField: '20100327-133421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7143',
internalId:  '',
customField: '20100327-133421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7206',
internalId:  '',
customField: '20100327-133421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7164',
internalId:  '',
customField: '20100327-133421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7227',
internalId:  '',
customField: '20100327-133421'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-28650395']={
webappId:    '1501',
documentId:  '1801',
internalId:  '28650395',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7122',
internalId:  '',
customField: '20100327-133421'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN24ZI';
var companyName   = 'AntonGear+-+Musical+Instruments+%26+Sporting+Goods';
var htmlTitle	  = 'AntonGear';
var metaKeywords  = 'Sporting+goods%2C+outdoor%2C+sports%2C+fishing%2C+hunting%2C+shooting%2C+gun%2C+bow%2C+marine%2C+boat%2C+fenwick%2C+abu+garcia%2C+berkley%2C+okuma%2C+penn%2C+shimano%2C+daiwa%2C+pflueger%2C+lindy%2C+musky+mania%2C+luhr+jensen%2C+dardevle%2C+creek+chub%2C+johnson%2C+silver+minnow%2C+little+cleo%2C+acme%2C+northland+tackle%2C+eppinger%2C+heddon%2Cmusky%2C+bass%2C+panfish%2C+walleye%2C+trout%2C+salmon%2C+pike%2Cspoons%2C+spinner+bait%2C+onyx%2C+black+powder%2C+crossbow%2C+lamiglass%2C+musical+instrument%2C+music%2C+drum%2C+guitar%2C+bass%2C+percussion%2C+amplifier%2C+speaker%2C+woodwind%2C+resonator%2C+mandolin%2C+violin%2C+banjo%2C+ukulele%2C+evans%2C+daddario%2C+planet+waves%2C+michael+kelly%2C+kustom%2C+warwick%2C+rocktron%2C+ghs%2C+wechter%2C+rockbass%2C+rico%2C+sabian%2C';
var metaContents  = 'Antons+Retail+is+Wisconsins+superior+fishing%2C+marine%2C+hunting%2C+shooting%2C+musical+instrument%2C++pro+audio+supplier.+We+have+outdoor+sporting+goods++musical+instruments+to+suit+every+need.';
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();
};
