/* [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','2201',jdecode('Home'),jdecode(''),'/2201.html','true',[],''],
	['PAGE','2622',jdecode('2010+Catalog+%26+E-Store'),jdecode(''),'/2622.html','true',[],''],
	['PAGE','2643',jdecode('Sport+Apparel'),jdecode(''),'/2643.html','true',[],''],
	['PAGE','18901',jdecode('Medical%2FWorkWear'),jdecode(''),'/18901.html','true',[],''],
	['PAGE','2685',jdecode('Promotional+Products'),jdecode(''),'/2685.html','true',[],''],
	['PAGE','30420',jdecode('Promo-Products+Search'),jdecode(''),'/30420.html','true',[],''],
	['PAGE','2664',jdecode('Trophy+and+Award'),jdecode(''),'/2664/index.html','true',[ 
		['PAGE','7464',jdecode('Sport+Trophy'),jdecode(''),'/2664/7464.html','true',[],''],
		['PAGE','7701',jdecode('Corp.+Trophy'),jdecode(''),'/2664/7701.html','true',[],''],
		['PAGE','7443',jdecode('medal%2C+pin+%26+Flip+Coin'),jdecode(''),'/2664/7443.html','true',[],'']
	],''],
	['PAGE','7301',jdecode('Services'),jdecode(''),'/7301/index.html','true',[ 
		['PAGE','2922',jdecode('Computerized+Embroidery'),jdecode(''),'/7301/2922.html','true',[],''],
		['PAGE','7322',jdecode('Automatic+Screen+Printing'),jdecode(''),'/7301/7322.html','true',[],''],
		['PAGE','7343',jdecode('Laser+Engraving'),jdecode(''),'/7301/7343.html','true',[],''],
		['PAGE','7485',jdecode('Lettering+%26+Numbering'),jdecode(''),'/7301/7485.html','true',[],''],
		['PAGE','7506',jdecode('Graphic+Design+%26+Digitizing'),jdecode(''),'/7301/7506.html','true',[],''],
		['PAGE','7527',jdecode('Sublimation+%26+Heat+Transfer'),jdecode(''),'/7301/7527.html','true',[],''],
		['PAGE','2901',jdecode('Applique+%26+Patches'),jdecode(''),'/7301/2901.html','true',[],'']
	],''],
	['PAGE','7722',jdecode('This+week%26%23x27%3Bs+special+offer'),jdecode(''),'/7722.html','true',[],''],
	['PAGE','7743',jdecode('Order'),jdecode(''),'/7743.html','true',[],''],
	['PAGE','3101',jdecode('About+Us'),jdecode(''),'/3101/index.html','true',[ 
		['PAGE','7785',jdecode('How+to+find+us'),jdecode(''),'/3101/7785.html','true',[],''],
		['PAGE','7827',jdecode('Contact'),jdecode(''),'/3101/7827.html','true',[],''],
		['PAGE','18101',jdecode('Customer+input'),jdecode(''),'/3101/18101.html','true',[],'']
	],''],
	['PAGE','8001',jdecode('Sales+Team+Corner'),jdecode(''),'/8001.html','true',[],''],
	['PAGE','2601',jdecode('Customer+Catalog+Corner'),jdecode(''),'/2601.html','true',[],'']];
var siteelementCount=26;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='2E2E2E';
theSitetree.keyvisualId='11075';
theSitetree.keyvisualName='kv_11075.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13798';
theSitetree.contentColor='D8D8D5';
theSitetree.contentBGColor='2E2E2E';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Displace',
				paletteFamily: 	'2E2E2E',
				keyvisualId: 	'11075',
				keyvisualName: 	'kv_11075.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13798',
				contentColor: 	'D8D8D5',
				contentBGColor: '2E2E2E',
				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:  '2201',
internalId:  '',
customField: '20100128-134728'
};
webappMappings['1501']=webappMappings['1501-14553114']={
webappId:    '1501',
documentId:  '2201',
internalId:  '14553114',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20090108-005428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20100107-182931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2622',
internalId:  '',
customField: '20100128-134811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2643',
internalId:  '',
customField: '20090107-012726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2664',
internalId:  '',
customField: '20090112-003528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2685',
internalId:  '',
customField: '20090210-010511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2922',
internalId:  '',
customField: '20090108-003547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20090107-034617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20090209-184738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7827',
internalId:  '',
customField: '20090108-010016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20090107-012756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7443',
internalId:  '',
customField: '20090107-011428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7464',
internalId:  '',
customField: '20090112-003805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20090112-003711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20090226-160930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7322',
internalId:  '',
customField: '20090113-024841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7343',
internalId:  '',
customField: '20090108-004223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7485',
internalId:  '',
customField: '20090108-004341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7506',
internalId:  '',
customField: '20090108-005141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7527',
internalId:  '',
customField: '20090209-160946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7722',
internalId:  '',
customField: '20081231-174200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7743',
internalId:  '',
customField: '20081231-034849'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '7785',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7785',
internalId:  '',
customField: '20090209-184210'
};
webappMappings['1002']=webappMappings['1002-18101aendu0inexln']={
webappId:    '1002',
documentId:  '18101',
internalId:  '18101aendu0inexln',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20090108-005901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30420',
internalId:  '',
customField: '20090210-010557'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INEXLN';
var companyName   = 'American+LogoWear';
var htmlTitle	  = 'American+LogoWear+%28+Embroidery%2C+Screen+Printing%2C+Engraving+%2C+Graphic+Design+%2C+Apparel%2C+CorpWear%2C+SportWear+WorkWear%2C+OuterWear+%29';
var metaKeywords  = 'American+logoWear++Embroidery++Screen+Printing++Engraving++Graphic+Design+and+Digitizing+Apparel+CorpWear%2C+SportWear+WorkWear+OuterWear+Trohpy+and+award+Sublimation+Heat+Transfer+Lettering+and+Numbering+Promotional+Items+Polo+shirt+T-Shirt+Hat+Medal+Pins';
var metaContents  = 'American+logoWear++Embroidery++Screen+Printing++Engraving++Graphic+Design+and+Digitizing+Apparel+CorpWear%2C+SportWear+WorkWear+OuterWear+Trohpy+and+award+Sublimation+Heat+Transfer+Lettering+and+Numbering+Promotional+Items';
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();
};
