/* [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','2201',jdecode('Home'),jdecode(''),'/2201.html','true',[],''],
	['PAGE','7101',jdecode('About+us'),jdecode(''),'/7101.html','true',[],''],
	['PAGE','14001',jdecode('Service'),jdecode(''),'/14001.html','true',[],''],
	['PAGE','2294',jdecode('Installation+Gallery'),jdecode(''),'/2294.html','true',[],''],
	['PAGE','12801',jdecode('Installation+Gallery+2'),jdecode(''),'/12801.html','true',[],''],
	['PAGE','2315',jdecode('Customers'),jdecode(''),'/2315.html','true',[],''],
	['PAGE','14801',jdecode('Testimonials'),jdecode(''),'/14801.html','true',[],''],
	['PAGE','13501',jdecode('Green+Building+Consulting'),jdecode(''),'/13501.html','true',[],''],
	['PAGE','15401',jdecode('Links'),jdecode(''),'/15401.html','true',[],''],
	['PAGE','2336',jdecode('Contact'),jdecode(''),'/2336.html','true',[],''],
	['PAGE','2357',jdecode('Email'),jdecode(''),'/2357.html','true',[],'']];
var siteelementCount=11;
theSitetree.topTemplateName='Steps';
theSitetree.paletteFamily='315881';
theSitetree.keyvisualId='2287';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='367';
theSitetree.graphicsetId='419';
theSitetree.contentColor='FFD1BC';
theSitetree.contentBGColor='315881';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Steps',
				paletteFamily: 	'315881',
				keyvisualId: 	'2287',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'367',
				graphicsetId: 	'419',
				contentColor: 	'FFD1BC',
				contentBGColor: '315881',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'315881',
				b_color: 		'2985B5',
				c_color: 		'3366CC',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-3d45316b9b0ea0e5f589c781e23a5682']={
webappId:    '7060',
documentId:  '2294',
internalId:  '3d45316b9b0ea0e5f589c781e23a5682',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-7516']={
webappId:    '7008',
documentId:  '2357',
internalId:  '7516',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20090604-115424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20090522-165514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20090604-120101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2294',
internalId:  '',
customField: '20090604-114936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2315',
internalId:  '',
customField: '20090522-170542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2336',
internalId:  '',
customField: '20090512-142612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2357',
internalId:  '',
customField: '20090512-143242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20090604-114048'
};
webappMappings['7060']=webappMappings['7060-24fa4b6ed99d9f6522d369bfd2230200']={
webappId:    '7060',
documentId:  '13501',
internalId:  '24fa4b6ed99d9f6522d369bfd2230200',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20090604-114956'
};
webappMappings['7060']=webappMappings['7060-063fcba65586471578befbbe82515817']={
webappId:    '7060',
documentId:  '12801',
internalId:  '063fcba65586471578befbbe82515817',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-d334fac710004e4363776eec3c552d58']={
webappId:    '7060',
documentId:  '14001',
internalId:  'd334fac710004e4363776eec3c552d58',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-3eb5b04f2b773048df7a99bf545b7886']={
webappId:    '7060',
documentId:  '14801',
internalId:  '3eb5b04f2b773048df7a99bf545b7886',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20090606-095010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20090827-112859'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHQ51';
var companyName   = 'Sunlyte+Films-+Window+Tinting+by+Pat+Trahan';
var htmlTitle	  = 'Sunlyte+Films+Window+Tinting+and+Green+Building+Consulting';
var metaKeywords  = '';
var metaContents  = '';
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();
};
