/* [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','10101',jdecode('Home'),jdecode(''),'/10101.html','true',[],'',''],
	['PAGE','71212',jdecode('MOPS+STORE'),jdecode(''),'/71212.html','true',[],'',''],
	['PAGE','129445',jdecode('Roofers%26%23x27%3B+Special'),jdecode(''),'/129445.html','true',[],'',''],
	['PAGE','1101',jdecode('PRODUCTS'),jdecode(''),'/1101/index.html','true',[ 
		['PAGE','111823',jdecode('Electrical+Signs'),jdecode(''),'/1101/111823.html','true',[],'',''],
		['PAGE','111923',jdecode('Site+Signage'),jdecode(''),'/1101/111923.html','true',[],'',''],
		['PAGE','111944',jdecode('Monuments'),jdecode(''),'/1101/111944.html','true',[],'',''],
		['PAGE','111986',jdecode('Interior'),jdecode(''),'/1101/111986.html','true',[],'',''],
		['PAGE','111623',jdecode('Digital+Prints'),jdecode(''),'/1101/111623.html','false',[],'',''],
		['PAGE','112223',jdecode('Banners'),jdecode(''),'/1101/112223.html','false',[],'',''],
		['PAGE','112323',jdecode('Screen+Printiing'),jdecode(''),'/1101/112323.html','false',[],'',''],
		['PAGE','111965',jdecode('Sand+Blasted'),jdecode(''),'/1101/111965.html','true',[],'',''],
		['PAGE','112244',jdecode('Misc.+Signs'),jdecode(''),'/1101/112244.html','true',[],'',''],
		['PAGE','114034',jdecode('Install+%26+repair'),jdecode(''),'/1101/114034.html','true',[],'','']
	],'',''],
	['PAGE','129466',jdecode('WAY+FINDING'),jdecode(''),'/129466.html','true',[],'',''],
	['PAGE','68354',jdecode('Our+Team'),jdecode(''),'/68354.html','true',[],'',''],
	['PAGE','139156',jdecode('GINA%26%23x27%3BS+page'),jdecode(''),'/139156.html','true',[],'',''],
	['PAGE','68333',jdecode('Contact+Us'),jdecode(''),'/68333.html','true',[],'',''],
	['PAGE','68312',jdecode('Terms'),jdecode(''),'/68312.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10344';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10344',
				graphicsetId: 	'10448',
				contentColor: 	'FFFFFF',
				contentBGColor: '5e5e5e',
				a_color: 		'5E5E5E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20100708-092943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111923',
internalId:  '',
customField: '20100512-180027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20100519-094038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68354',
internalId:  '',
customField: '20100507-131128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111623',
internalId:  '',
customField: '20100512-131631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111823',
internalId:  '',
customField: '20100519-094154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111986',
internalId:  '',
customField: '20100518-124129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68333',
internalId:  '',
customField: '20100430-122940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68312',
internalId:  '',
customField: '20100512-172343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111944',
internalId:  '',
customField: '20100519-094258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71212',
internalId:  '',
customField: '20100622-201223'
};
webappMappings['7008']=webappMappings['7008-7141']={
webappId:    '7008',
documentId:  '68333',
internalId:  '7141',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114034',
internalId:  '',
customField: '20100512-170643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112323',
internalId:  '',
customField: '20100512-133311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112244',
internalId:  '',
customField: '20100518-124212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111965',
internalId:  '',
customField: '20100518-124442'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112223',
internalId:  '',
customField: '20100512-132716'
};
webappMappings['1501']=webappMappings['1501-6722709']={
webappId:    '1501',
documentId:  '10101',
internalId:  '6722709',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129445',
internalId:  '',
customField: '20100622-195943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129466',
internalId:  '',
customField: '20100607-132354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139156',
internalId:  '',
customField: '20100708-094610'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN30G9';
var companyName   = 'Custom+Sign+%26+Graphics';
var htmlTitle	  = 'CUSTOM+SIGN+%26+GRAPHICS';
var metaKeywords  = 'Signs%2C+Banners%2C+Digital+Printing%2C+Screen+Printing%2C+Vehicle+Graphics%2C+MOPS%2C+Mothers+of+Preschoolers%2C+MOPS+International+Licensed+apparel+and+signs%2C';
var metaContents  = 'Signs%2C+Banners%2C+Digital+Printing%2C+Screen+Printing%2C+Vehicle+Graphics%2C+MOPS%2C+Mothers+of+Preschoolers%2C+MOPS+International+Licensed+apparel+and+signs%2C';
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();
};
