/* [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','2101',jdecode('Home'),jdecode(''), jdecode('%2F2101.html'), 'true',[],'',''],
	['PAGE','2194',jdecode('About+Us'),jdecode(''), jdecode('%2F2194%2Findex.html'), 'true',[ 
		['PAGE','45401',jdecode('Our+Team'),jdecode(''), jdecode('%2F2194%2F45401.html'), 'true',[],'','']
	],'',''],
	['PAGE','58801',jdecode('Services+'),jdecode(''), jdecode('%2F58801.html'), 'true',[],'',''],
	['PAGE','45422',jdecode('How+to+Find+Us'),jdecode(''), jdecode('%2F45422.html'), 'true',[],'',''],
	['PAGE','59201',jdecode('Project+History'),jdecode(''), jdecode('%2F59201%2Findex.html'), 'true',[ 
		['PAGE','59222',jdecode('Tenant+Interiors'),jdecode(''), jdecode('%2F59201%2F59222.html'), 'true',[],'',''],
		['PAGE','59243',jdecode('Health+Care'),jdecode(''), jdecode('%2F59201%2F59243.html'), 'true',[],'',''],
		['PAGE','59264',jdecode('Commercial'),jdecode(''), jdecode('%2F59201%2F59264.html'), 'true',[],'',''],
		['PAGE','59285',jdecode('Residential'),jdecode(''), jdecode('%2F59201%2F59285.html'), 'true',[],'',''],
		['PAGE','59306',jdecode('Schools'),jdecode(''), jdecode('%2F59201%2F59306.html'), 'true',[],'','']
	],'',''],
	['PAGE','45464',jdecode('Contact+Form'),jdecode(''), jdecode('%2F45464.html'), 'true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Delphi';
theSitetree.paletteFamily='2B3559';
theSitetree.keyvisualId='7542';
theSitetree.keyvisualName='kv_7542.jpg';
theSitetree.fontsetId='16657';
theSitetree.graphicsetId='12222';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='818181';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp13-cbeyon',
  product: 'WSCSYSSSSLYTC2ZA'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Delphi',
				paletteFamily: 	'2B3559',
				keyvisualId: 	'7542',
				keyvisualName: 	'kv_7542.jpg',
				fontsetId: 		'16657',
				graphicsetId: 	'12222',
				contentColor: 	'FFFFFF',
				contentBGColor: '818181',
				a_color: 		'424242',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20110810-132321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45422',
internalId:  '',
customField: '20110810-133315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45464',
internalId:  '',
customField: '20110824-142747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59222',
internalId:  '',
customField: '20110810-133538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2194',
internalId:  '',
customField: '20110810-133144'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45401',
internalId:  '',
customField: '20111017-131918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58801',
internalId:  '',
customField: '20110810-133233'
};
webappMappings['7008']=webappMappings['7008-23604']={
webappId:    '7008',
documentId:  '45464',
internalId:  '23604',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59264',
internalId:  '',
customField: '20110810-133821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59285',
internalId:  '',
customField: '20110826-110545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59243',
internalId:  '',
customField: '20110810-133756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59201',
internalId:  '',
customField: '20110810-133433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59306',
internalId:  '',
customField: '20110810-134023'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHL70';
var companyName   = 'United+Glass+Inc';
var htmlTitle	  = 'United+Glass+Inc';
var metaKeywords  = 'glass+and+glazing%2Ccommercial+glazing%2Ccommercial+glass+repair%2Ccommercial+glass+installation%2Ccommercial+glass+company%2Cresidential+glazing%2C+residential+glass+repair%2Cresidential+glass+company%2Cresidential+glass+installation%2Cglass+companies%2Cspecialty+glazing%2Cglass+installer%2C+glass+installation%2Cglass%2Cglazing%2Ccustom+glass%2Cfire+rated+glass%2Cbullet+resisting+glass%2Cback+lit+glass%2Cback+painted+glass%2Cpattern+glass%2Cheavy+glass%2Cannealed+glass%2Ctempered+glass%2Claminated+glass%2Cspecialty+glass%2Cart+glass%2Cnon-glare+glass%2Cglass+marker+board%2Cfrosted+glass%2Cfilmed+glass%2Ctinted+glass%2Cpolished+glass%2Cwindow+glass%2Csandblasted+glass%2Claser+etched%2Cacid+etched+glass%2Cetched+glass%2Cglass+walls%2Cglass+partitions%2Cswitch+lite+glass%2Ctable+top+glass%2Cdesk+top+glass%2Cshelves%2C+tempered+glass+shelves%2C+laminated+glass+shelves%2C+shower+doors%2C+heavy+doors%2Caluminum+doors%2C+aluminum+storefronts%2Canodized+storefronts%2Cinterior+storefronts%2Cexterior+storefronts%2Cwide+stile+doors%2C+medium+stile+doors%2Caluminum+frames%2C+aluminum+entrances%2C+entrances%2C+storefronts%2Ccurtain+walls%2Cglass+doors%2Csliding+glass+doors%2Cdoor+hardware%2Ccommercial+door+hardware%2C+pull+handle%2Cpainted+entrance%2C+painted+storefront%2Cmirror%2Cframed+mirror%2Cunframed+mirror%2Cone+way+mirror%2Ctwo+way+mirror%2Cthree+way+mirror%2Cclear+mirror%2Clow+iron+mirror%2Cmirror+clips%2Cbeveled+mirror%2Ccustom+mirror%2Cglass+companies+in+mn%2C+glass+companies';
var metaContents  = 'Welcome+to+United+Glass+Inc.%2C+established+in+1984+providing+outstanding+service+and+reliability+in+commercial+services+and+repairs%2C+including+residential+sales.';
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();
};

