/* [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','10001',jdecode('Home'),jdecode(''), jdecode('%2F10001.html'), 'true',[],'',''],
	['PAGE','16801',jdecode('About+Us'),jdecode(''), jdecode('%2F16801.html'), 'true',[],'',''],
	['PAGE','17201',jdecode('Services'),jdecode(''), jdecode('%2F17201.html'), 'true',[],'',''],
	['PAGE','17101',jdecode('Completed+Projects'),jdecode(''), jdecode('%2F17101%2Findex.html'), 'true',[ 
		['PAGE','24701',jdecode('Images'),jdecode(''), jdecode('%2F17101%2F24701.html'), 'true',[],'','']
	],'',''],
	['PAGE','17422',jdecode('Toilet+Accessories'),jdecode(''), jdecode('%2F17422%2Findex.html'), 'true',[ 
		['PAGE','18485',jdecode('Manufacturers'),jdecode(''), jdecode('%2F17422%2F18485.html'), 'true',[],'',''],
		['ITEM','18506',jdecode('Shop+Online+Store+Now'),jdecode(''), jdecode('http%3A%2F%2Fwashroomdirectsales.com%2F'), 'true',[],'','_blank']
	],'',''],
	['PAGE','17401',jdecode('Toilet+Partitions'),jdecode(''), jdecode('%2F17401%2Findex.html'), 'true',[ 
		['PAGE','18401',jdecode('Manufacturers'),jdecode(''), jdecode('%2F17401%2F18401.html'), 'true',[],'',''],
		['PAGE','18422',jdecode('Materials'),jdecode(''), jdecode('%2F17401%2F18422.html'), 'true',[],'',''],
		['PAGE','18443',jdecode('Layouts'),jdecode(''), jdecode('%2F17401%2F18443.html'), 'true',[],'',''],
		['PAGE','18464',jdecode('Colors'),jdecode(''), jdecode('%2F17401%2F18464.html'), 'true',[],'','']
	],'',''],
	['PAGE','18301',jdecode('Partition+Quote'),jdecode(''), jdecode('%2F18301.html'), 'true',[],'',''],
	['PAGE','16927',jdecode('Contact+Us'),jdecode(''), jdecode('%2F16927.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Time';
theSitetree.paletteFamily='272740';
theSitetree.keyvisualId='2289';
theSitetree.keyvisualName='architekt.jpg';
theSitetree.fontsetId='270';
theSitetree.graphicsetId='336';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Time',
				paletteFamily: 	'272740',
				keyvisualId: 	'2289',
				keyvisualName: 	'architekt.jpg',
				fontsetId: 		'270',
				graphicsetId: 	'336',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'272740',
				b_color: 		'6D6DA7',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20110803-170607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20111129-181204'
};
webappMappings['7060']=webappMappings['7060-3a9b847c867de59a157b0c2b715f639f']={
webappId:    '7060',
documentId:  '24701',
internalId:  '3a9b847c867de59a157b0c2b715f639f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20111129-182546'
};
webappMappings['7008']=webappMappings['7008-23527']={
webappId:    '7008',
documentId:  '18301',
internalId:  '23527',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-23344']={
webappId:    '7008',
documentId:  '16927',
internalId:  '23344',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17101',
internalId:  '',
customField: '20111129-182101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20111129-184025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18401',
internalId:  '',
customField: '20111129-184122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18422',
internalId:  '',
customField: '20111129-184616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18443',
internalId:  '',
customField: '20111129-184529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18464',
internalId:  '',
customField: '20111129-184800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17422',
internalId:  '',
customField: '20111129-182752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18485',
internalId:  '',
customField: '20111129-183458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18301',
internalId:  '',
customField: '20111129-184900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16927',
internalId:  '',
customField: '20111129-185532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24701',
internalId:  '',
customField: '20111129-182422'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH3IE';
var companyName   = 'Preferred+Construction+Specialties%2C+Inc.';
var htmlTitle	  = 'Preferred+Construction+Specialties%2C+Inc.';
var metaKeywords  = 'Toilet+Partitions%0D%0AToilet+Accessories%0D%0ABathroom+Accessories%0D%0ALockers%0D%0AUnion+Subcontractor';
var metaContents  = 'Preferred+Construction+Specialties%2C+Inc.+is+a+section+10+union+subcontractor+specializing+in+toilet+partitions%2C+bathroom+accessories%2C+and+lockers.+It+is+our+experience%2C+reliability%2C+pride+in+workmanship%2C+and+competitive+pricing+that+has+built+our+business+into+what+it+is+today.';
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();
};

