/* [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','901',jdecode('Home'),jdecode(''), jdecode('%2F901.html'), 'true',[],'',''],
	['PAGE','952',jdecode('About+Gerry%26%23x27%3Bs'),jdecode(''), jdecode('%2F952%2Findex.html'), 'true',[ 
		['PAGE','973',jdecode('The+Showroom'),jdecode(''), jdecode('%2F952%2F973.html'), 'true',[],'','']
	],'',''],
	['PAGE','994',jdecode('Recent+Projects'),jdecode(''), jdecode('%2F994.html'), 'true',[],'',''],
	['PAGE','11301',jdecode('Products'),jdecode(''), jdecode('%2F11301.html'), 'true',[],'',''],
	['PAGE','1015',jdecode('Contact+Gerry'),jdecode(''), jdecode('%2F1015.html'), 'true',[],'',''],
	['PAGE','7806',jdecode('Guestbook'),jdecode(''), jdecode('%2F7806%2Findex.html'), 'true',[ 
		['PAGE','7801',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F7806%2F7801.html'), 'false',[],'','']
	],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='90A262';
theSitetree.keyvisualId='2055';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='282';
theSitetree.graphicsetId='344';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='90A262';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp19-dulles',
  product: 'WSCSYSSSSLYTCPII'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Architekt',
				paletteFamily: 	'90A262',
				keyvisualId: 	'2055',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'282',
				graphicsetId: 	'344',
				contentColor: 	'000000',
				contentBGColor: '90A262',
				a_color: 		'90A262',
				b_color: 		'525D37',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20111112-210338'
};
webappMappings['1002']=webappMappings['1002-7806avec10inz3dk']={
webappId:    '1002',
documentId:  '7806',
internalId:  '7806avec10inz3dk',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-2163']={
webappId:    '7008',
documentId:  '1015',
internalId:  '2163',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20080119-143002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20090907-190240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20080602-103736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20090907-184657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20080119-142136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7806',
internalId:  '',
customField: '20080119-142218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20080119-141610'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZ3DK';
var companyName   = 'Gerry%27s+Custom+Cabinet+Corp.';
var htmlTitle	  = 'Welcome+to+Gerrys+Custom+Cabinet+Corp.%21';
var metaKeywords  = 'gerrys+custom+cabinet%2C+custom+cabinets+watertown%2C+watertown+ma%2C+watertown+massachusetts%2C+gerrys+watertown+massachusetts%2C+massachusetts%2C+boston%2C+boston+massachusetts%2C+watertown+cabinets%2C+custom+cabinets%2C+tedd+wood%2C+imperia%2C+corian%2C+granite%2C+silestone%2C+kraftmaid%2C+tedd+wood+ma%2C+teddwood+ma%2C+teddwood%2C+teddwood+watertown+ma%2C+imperia+watertown%2C+imperia+watertown+ma%2C+imperia+ma%2C+corian+watertown%2C+corian+watertown+ma%2C+corian+ma%2C+granite+watertown%2C+granite+watertown+ma%2C+granite+ma%2C+silestone+ma%2C+silestone+watertown+ma%2C+silestone+watertown%2C+kraftmaid+watertown%2C+kraftmaid+watertown+ma%2C+kraftmade+watertown%2C+kraftmade+watertown+ma%2C+craftmade+watertown%2C+craftmaid+watertown%2C+gerry+watertown+ma%2C+architectural+cabinet%2C+massachusetts+cabinets%2C+countertops%2C+vanities%2C+bathroom%2C+ma+renovation%2C+gerrys+cabinet+co%2C+gerrys+custom+co%2C+gerrys+countertops%2C+gerry+watertown%2C+gerrys+watertown%2C+gerry+tremarche%2C+waltham%2C+waltham+ma%2C+belmont%2C+belmont+ma%2C+newton%2C+newton+ma%2C+arlington%2C+arlington+ma%2C+medford%2C+medford+ma%2C+cambridge%2C+cambridge+ma%2C+beacon+street%2C+newbury+street%2C+north+end%2C+battery+wharf%2C+rowes+wharf%2C+commonwealth%2C+commonwealth+ave%2C+high+end%2C+renovation%2C+solid+wood%2C+hafele%2C+richelieu%2C+amerock%2C+hardware%2C+franke%2C+kohler%2C+eljer%2C+staron%2C+toto%2C+oak%2C+cherry%2C+poplar%2C+maple%2C+birch%2C+walnut%2C+pine%2C+ash%2C+hickory%2C+wood%2C+alder';
var metaContents  = 'Gerrys+Custom+Cabinet+Corp.%2C+Watertown%2C+MA+02472++617-972-1700';
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();
};

