/* [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','64',jdecode('Introduction+to+AITI'),jdecode(''), jdecode('%2F64.html'), 'true',[],'',''],
	['PAGE','1279',jdecode('Attract+New+Customers'),jdecode(''), jdecode('%2F1279.html'), 'true',[],'',''],
	['PAGE','1288',jdecode('Establish+New+Sales+Goals'),jdecode(''), jdecode('%2F1288.html'), 'true',[],'',''],
	['PAGE','1297',jdecode('Solve+Cash+Flow+Problems'),jdecode(''), jdecode('%2F1297.html'), 'true',[],'',''],
	['PAGE','1306',jdecode('Turn+Inventory+Quicker'),jdecode(''), jdecode('%2F1306.html'), 'true',[],'',''],
	['PAGE','1315',jdecode('Create+High+Impact++Events'),jdecode(''), jdecode('%2F1315.html'), 'true',[],'',''],
	['PAGE','1324',jdecode('Make+Advertising+Work'),jdecode(''), jdecode('%2F1324.html'), 'true',[],'',''],
	['PAGE','1333',jdecode('Build+a+Successful+Business'),jdecode(''), jdecode('%2F1333.html'), 'true',[],'',''],
	['PAGE','112',jdecode('Testimonials+%2F+Clients'),jdecode(''), jdecode('%2F112%2Findex.html'), 'true',[ 
		['PAGE','3330',jdecode('Testomonials+Images'),jdecode(''), jdecode('%2F112%2F3330.html'), 'true',[],'','']
	],'',''],
	['PAGE','2630',jdecode('AITI%26%23x27%3Bs+Charity+Work'),jdecode(''), jdecode('%2F2630.html'), 'true',[],'',''],
	['PAGE','2568',jdecode('Feed+Back+Form'),jdecode(''), jdecode('%2F2568.html'), 'true',[],'',''],
	['PAGE','4789',jdecode('Careers'),jdecode(''), jdecode('%2F4789.html'), 'true',[],'',''],
	['PAGE','2696',jdecode('links'),jdecode(''), jdecode('%2F2696.html'), 'true',[],'',''],
	['PAGE','6681',jdecode('Contact+AITI'),jdecode(''), jdecode('%2F6681.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Basic';
theSitetree.paletteFamily='36566E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10828';
theSitetree.graphicsetId='11283';
theSitetree.contentColor='36566E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'netnation',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Basic',
				paletteFamily: 	'36566E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10828',
				graphicsetId: 	'11283',
				contentColor: 	'36566E',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '64',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-2edbd01d93d4b2a033b7fa5fad98a77b']={
webappId:    '7060',
documentId:  '3330',
internalId:  '2edbd01d93d4b2a033b7fa5fad98a77b',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64',
internalId:  '',
customField: '20120121-004635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1279',
internalId:  '',
customField: '20120121-005557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1288',
internalId:  '',
customField: '20120120-212609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1297',
internalId:  '',
customField: '20120121-010307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1306',
internalId:  '',
customField: '20120120-212859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1315',
internalId:  '',
customField: '20120121-011048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1324',
internalId:  '',
customField: '20120121-011340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1333',
internalId:  '',
customField: '20120121-011628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112',
internalId:  '',
customField: '20110419-164416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3330',
internalId:  '',
customField: '20110419-164448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2630',
internalId:  '',
customField: '20120120-213332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2568',
internalId:  '',
customField: '20071112-200849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4789',
internalId:  '',
customField: '20120121-012329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2696',
internalId:  '',
customField: '20120120-222919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6681',
internalId:  '',
customField: '20120120-150035'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '64',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-9437']={
webappId:    '7008',
documentId:  '2568',
internalId:  '9437',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3ZTT';
var companyName   = 'AITI+CONSULTING+retail+services';
var htmlTitle	  = 'AITI+CONSULTING+retail+solutions%2C+providing+Retail+Consulting+Service+to+USA+and+CANADA+from+the+Pacific+North+West.++We+specialize+in+Retail+Store+Closings%2C+Retail+Promotional+Sales++Events%2C+and+proven+strategic+retail+marketing.';
var metaKeywords  = 'Retail%2C+Consulting%2C+Store+closing%2C+sale%2C+sale+material%2C+signs%2C+aiti+consulting%2C+retail+signs';
var metaContents  = 'AITI+is+a+Leading+Retail+Consulting+Company+serving+Canada+and+the+USA.+';
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();
};

