/* [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','5016',jdecode('Seating+Solution'),jdecode(''),'/5016.html','true',[],'',''],
	['PAGE','9601',jdecode('New+Seats'),jdecode(''),'/9601/index.html','true',[ 
		['PAGE','9622',jdecode('KI+Seating'),jdecode(''),'/9601/9622.html','true',[],'',''],
		['PAGE','9643',jdecode('Camatic+Seating'),jdecode(''),'/9601/9643.html','true',[],'',''],
		['PAGE','9664',jdecode('Series+Seating'),jdecode(''),'/9601/9664.html','true',[],'',''],
		['PAGE','9685',jdecode('Mobiliario+Seating'),jdecode(''),'/9601/9685.html','true',[],'','']
	],'',''],
	['PAGE','9811',jdecode('Quote+request+form'),jdecode(''),'/9811.html','true',[],'',''],
	['PAGE','11201',jdecode('Used+seats+for+sale'),jdecode(''),'/11201.html','true',[],'',''],
	['PAGE','9748',jdecode('Installations'),jdecode(''),'/9748/index.html','true',[ 
		['PAGE','11222',jdecode('Installation+Quote'),jdecode(''),'/9748/11222.html','true',[],'','']
	],'',''],
	['PAGE','9769',jdecode('Testimonials'),jdecode(''),'/9769/index.html','true',[ 
		['PAGE','11501',jdecode('Completed+Project+List'),jdecode(''),'/9769/11501.html','true',[],'','']
	],'',''],
	['PAGE','9790',jdecode('Project+Photos'),jdecode(''),'/9790.html','true',[],'',''],
	['PAGE','41401',jdecode('Search'),jdecode(''),'/41401.html','true',[],'',''],
	['PAGE','9832',jdecode('Contact'),jdecode(''),'/9832.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Triangle';
theSitetree.paletteFamily='004165';
theSitetree.keyvisualId='12006';
theSitetree.keyvisualName='kv_12006.jpg';
theSitetree.fontsetId='33262';
theSitetree.graphicsetId='14140';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='004165';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Triangle',
				paletteFamily: 	'004165',
				keyvisualId: 	'12006',
				keyvisualName: 	'kv_12006.jpg',
				fontsetId: 		'33262',
				graphicsetId: 	'14140',
				contentColor: 	'FFFFFF',
				contentBGColor: '004165',
				a_color: 		'004165',
				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:  '5016',
internalId:  '',
customField: '20101004-052153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20101004-010619'
};
webappMappings['1501']=webappMappings['1501-34223826']={
webappId:    '1501',
documentId:  '5016',
internalId:  '34223826',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-20076']={
webappId:    '7008',
documentId:  '9811',
internalId:  '20076',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-20077']={
webappId:    '7008',
documentId:  '9832',
internalId:  '20077',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20101003-235325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9622',
internalId:  '',
customField: '20101003-180317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9643',
internalId:  '',
customField: '20101003-180343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9664',
internalId:  '',
customField: '20101003-180410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9685',
internalId:  '',
customField: '20101003-084704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20090825-125518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11222',
internalId:  '',
customField: '20090823-121806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9748',
internalId:  '',
customField: '20101003-025835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9769',
internalId:  '',
customField: '20101003-121743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9790',
internalId:  '',
customField: '20090826-180150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9811',
internalId:  '',
customField: '20090825-083608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9832',
internalId:  '',
customField: '20090825-194830'
};
webappMappings['7060']=webappMappings['7060-4678ee415ca1f86260c8eefe6c024631']={
webappId:    '7060',
documentId:  '9790',
internalId:  '4678ee415ca1f86260c8eefe6c024631',
customField: 'language:en;country:US;'
};
webappMappings['4001']=webappMappings['4001-21606797']={
webappId:    '4001',
documentId:  '11201',
internalId:  '21606797',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-20090']={
webappId:    '7008',
documentId:  '11222',
internalId:  '20090',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-6cb0add3b0ddff68704b1a062a9998f8']={
webappId:    '7060',
documentId:  '9769',
internalId:  '6cb0add3b0ddff68704b1a062a9998f8',
customField: 'language:en;country:US;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '41401',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41401',
internalId:  '',
customField: '20101004-125537'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INV1EI';
var companyName   = 'The+AINSLIE+Company';
var htmlTitle	  = 'The+Ainslie+Company';
var metaKeywords  = 'Fixed+Seating%2C+Stadium+Seats%2C+Theater+Seats%2C+Classroom+Seats%2C+and+Used+Seats+for+sale';
var metaContents  = 'To+provide+and+install+fixed+seating+such+as+Theater+Seats%2C+Stadium+Seats%2C+Classroom+Seats+and+Tables+with+or+without+Power++Data';
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();
};

