/* [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 theSitetree=[ 
	['PAGE','4901',jdecode('Home'),jdecode(''),'/4901.html','true',[],''],
	['PAGE','85801',jdecode('Building+Services'),jdecode(''),'/85801.html','true',[],''],
	['PAGE','81401',jdecode('Meet+the+Builder'),jdecode(''),'/81401.html','true',[],''],
	['PAGE','4952',jdecode('Gallery'),jdecode(''),'/4952.html','true',[],''],
	['PAGE','85601',jdecode('IBS+2010'),jdecode(''),'/85601.html','true',[],''],
	['PAGE','4994',jdecode('Building+Links'),jdecode(''),'/4994/index.html','true',[ 
		['PAGE','8101',jdecode('Green+Building'),jdecode(''),'/4994/8101.html','true',[],'']
	],''],
	['PAGE','5122',jdecode('Contact+Us'),jdecode(''),'/5122.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Bigcity_NYC';
theSitetree.paletteFamily='4A352C';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17891';
theSitetree.graphicsetId='13162';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='4A352C';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Bigcity_NYC',
				paletteFamily: 	'4A352C',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17891',
				graphicsetId: 	'13162',
				contentColor: 	'FFFFFF',
				contentBGColor: '4A352C',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'000000',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20100115-164517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85801',
internalId:  '',
customField: '20100203-110418'
};
webappMappings['7008']=webappMappings['7008-509']={
webappId:    '7008',
documentId:  '5122',
internalId:  '509',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4952',
internalId:  '',
customField: '20100115-171621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81401',
internalId:  '',
customField: '20100203-105451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4994',
internalId:  '',
customField: '20100131-164204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5122',
internalId:  '',
customField: '20100203-110028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8101',
internalId:  '',
customField: '20100131-164355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85601',
internalId:  '',
customField: '20100210-085152'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN24HW';
var companyName   = 'Design+Builders+llc';
var htmlTitle	  = 'Design+Builders+llc%2C+Madison+Area+General+Contractor%2C+Design+Builder+Contractor%2C+Custom+Homes+and+Remodels%2C+Roger+Maus%2C+CGP+by+the+National+Association+of+Home+Builders+608%7C444-7965+Design+Builders+llc+-+Licensed+Building+Dwelling+Contractor+State+of+WI';
var metaKeywords  = 'Madison+Contractor+Design+Builders+llc+Madison+WI+Area+Contractor+Custom+Homes+Remodeling++Additions%2C+WI+Licensed+Contractor+Madison+Area+Contractors+Madison+Contractors+Building+Contractor+Madison+wi+Building+Contractor+Home+remodeling+builders+madison+area+Quality+Design+Building+Contractor+McFarland+Oregon+Stoughton+Madison+Fitchburg+WI+Wisconsin+Roger+Maus+Terri+Maus+%28608%29444-7965+%28608%29658-4950+Designing+Homes+New+Construction+Green+Built+Home+Madison+Area+Builders+Association+Wisconsin+Residential+New+Construction+New+Home+Building+www.designbuildersllc.com+New+Construction+Additions+Construction+Management+Construction+Contractor+Management+Lake+Building+Dane+County+Lake+Monona+Lake+Kegonsa+Lake+Waubesa+Lake+Mendota+General+Contractors+Dane+County+WI+Southeastern+Wisconsin+LLC+New+Kitchens+Designers';
var metaContents  = 'Madison+Contractor+Design+Builders+llc%2C+Design+Build+Madison+Area+Custom+Home+Builder+Designer+Remodeling+and+Additions+Roger+Maus+CGP+Madison+Area+Contractors+Madison+Building+Contractor+WI+Licensed+Contractor+Residential+home+building+Residential+New+Constructon+in+Madison+Fitchburg+Monona+Oregon+Soughton+McFarland+Certified+Green+Builder+Executive+Ranch+Homes+Executive+New+Residential+Homes+Stylish+Homes+Quality+Home+Construction+Madison+Area+Builders+Association+Green+Built+Home+Wisconsin+Roger+Maus+Terri+Maus+Designer+Builder+Contractor+New+Home+Builder+New+Home+Building+www.designbuildersllc.net+www.designbuildersllc.com+608-444-7965+608-658-4950+First+Weber+Real+Estate+Design+Shelters+Remodeling+New+Construction+Additions+Construction+Management+Contractor+Management+Lake+Building+Dane+County+Zoning+Lake+Waubesa+LakeMonona+Lake+Kegonsa+Lake+Mendota+General+Contractors+Dane+County+WI+LLC+Kitchen+Design+Designers';
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();
};
