/* [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','43901',jdecode('Online+Sales'),jdecode(''),'/43901.html','true',[],''],
	['PAGE','2452',jdecode('Products'),jdecode(''),'/2452/index.html','true',[ 
		['PAGE','2515',jdecode('FAQs'),jdecode(''),'/2452/2515.html','true',[],''],
		['PAGE','11601',jdecode('Photos'),jdecode(''),'/2452/11601.html','true',[],''],
		['PAGE','52501',jdecode('Detailed+Product+Photos'),jdecode(''),'/2452/52501.html','true',[],'']
	],''],
	['PAGE','2473',jdecode('Repairs+%26+Services'),jdecode(''),'/2473.html','true',[],''],
	['PAGE','3301',jdecode('Tri-Cord+Distributors'),jdecode(''),'/3301/index.html','true',[ 
		['PAGE','62401',jdecode('Retail+Locations'),jdecode(''),'/3301/62401.html','false',[],''],
		['PAGE','62422',jdecode('Commercial+Distributors'),jdecode(''),'/3301/62422.html','true',[],'']
	],''],
	['PAGE','49401',jdecode('Cultured+Pearls'),jdecode(''),'/49401/index.html','false',[ 
		['PAGE','56001',jdecode('Pearl+Types'),jdecode(''),'/49401/56001.html','true',[],''],
		['PAGE','56101',jdecode('Pearl+Qualities'),jdecode(''),'/49401/56101.html','true',[],''],
		['PAGE','55801',jdecode('Pearl+Specifications'),jdecode(''),'/49401/55801.html','false',[],''],
		['PAGE','55501',jdecode('Pearl+Chart-Bead+Count'),jdecode(''),'/49401/55501.html','false',[],'']
	],''],
	['PAGE','2599',jdecode('Contact+Us'),jdecode(''),'/2599.html','true',[],''],
	['PAGE','2536',jdecode('Home'),jdecode(''),'/2536/index.html','true',[ 
		['PAGE','3201',jdecode('Company+Policies'),jdecode(''),'/2536/3201.html','true',[],''],
		['PAGE','2401',jdecode('History'),jdecode(''),'/2536/2401.html','true',[],'']
	],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Meta';
theSitetree.paletteFamily='72A7D3';
theSitetree.keyvisualId='11301';
theSitetree.keyvisualName='kv_11301.jpg';
theSitetree.fontsetId='31993';
theSitetree.graphicsetId='13826';
theSitetree.contentColor='020202';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Meta',
				paletteFamily: 	'72A7D3',
				keyvisualId: 	'11301',
				keyvisualName: 	'kv_11301.jpg',
				fontsetId: 		'31993',
				graphicsetId: 	'13826',
				contentColor: 	'020202',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20080821-173631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2452',
internalId:  '',
customField: '20100304-130153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2473',
internalId:  '',
customField: '20091020-182608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2536',
internalId:  '',
customField: '20100416-164354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20091015-111916'
};
webappMappings['7008']=webappMappings['7008-1731']={
webappId:    '7008',
documentId:  '2599',
internalId:  '1731',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2599',
internalId:  '',
customField: '20100324-154626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2515',
internalId:  '',
customField: '20091020-182351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20100321-214502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20081118-184823'
};
webappMappings['4001']=webappMappings['4001-10484556']={
webappId:    '4001',
documentId:  '43901',
internalId:  '10484556',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43901',
internalId:  '',
customField: '20091015-113613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49401',
internalId:  '',
customField: '20080912-163126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52501',
internalId:  '',
customField: '20091020-183154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55501',
internalId:  '',
customField: '20080912-140855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55801',
internalId:  '',
customField: '20080912-140421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56001',
internalId:  '',
customField: '20081016-161357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56101',
internalId:  '',
customField: '20080913-160610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62422',
internalId:  '',
customField: '20081030-123154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62401',
internalId:  '',
customField: '20090106-111259'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2NQO';
var companyName   = 'Tri-Cord+Tool+Company+USA+-+Quality+Tools+Since+1980';
var htmlTitle	  = 'Tri-Cord+Tool+Company+USA';
var metaKeywords  = 'knotting+tools%2C+beading+tools%2C++beading%2C+beads%2C+cultured+pearls%2C+pearls%2C+pearl+repairs%2C+bead+stringing%2C+beads%2C+knotting+beads%2C+knotted+necklaces%2C+jewelry+repair%2C+Tri-Cord+knotting+kit%2C+Tri-Cord+Tool+Products%2C+tricord+online+sales%2C+Tri-Cord+Online+Sales%2C+Tri-Cord+Distributors%2C+Tri-Cord+++Services++Repairs%2C+Tri-Cord+Company+Policies%2C+tricordinc.com%2Fhome%2C+Tri-Cord+Home%2C+Tri-Cord+History%2C+Tri-Cord+Products%2C+Tri-Cord+Contact+Us%2C+Tri-Cord+Sales%2C+Tri-Cord+Online+Sales%2C+Tri-Cord+Distributors%2C+Tri-Cord+Faqs%2C+Tri-Cord+Photos%2C+Tri-Cord+Company+Policies%2C+Tri-Cord+Knotting+Kit%2C+Tri-Cord+Instruction+Manual%2C+Tri-Cord+Video+Instructions%2C+Tri-Cord+Spring+Needles%2C+American+made+tricord+knotters%2C+Tri-Cord+American+Knotting+Tools';
var metaContents  = 'Tri-Cord+Knotting+Tools%2C+Tri-Cord+Tool+Company+USA%2C++Tri-Cord+Tool+Company%2C+Tri-Cord+Professional+Knotter%2C+Tri-Cord+Knotting+Kit%2C+Tri-Cord%2C+Inc.%2C+Tin+cup+Knotter%2C+Tri-Cord+Tin-Cup+Knotter%2C+Tri-cord%2C+tricord%2C+Tri-Cord+Instructional+DVD+Video%2C+American+Tri-Cord+Knotters%2C+American+made+tricord+knotting+tools%2C+tri-cord+online+sales%2C+tri-cord+special+services';
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();
};
