/* [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','10001',jdecode('Home'),jdecode(''),'/10001.html','true',[],''],
	['PAGE','10052',jdecode('About+Us'),jdecode(''),'/10052.html','true',[],''],
	['PAGE','10901',jdecode('Products'),jdecode(''),'/10901.html','true',[],''],
	['PAGE','10922',jdecode('Services'),jdecode(''),'/10922.html','true',[],''],
	['PAGE','10943',jdecode('Photo+Gallery'),jdecode(''),'/10943.html','true',[],''],
	['PAGE','54512',jdecode('Return+On+Investment'),jdecode(''),'/54512.html','true',[],''],
	['PAGE','56412',jdecode('FAQs'),jdecode(''),'/56412.html','true',[],''],
	['PAGE','10964',jdecode('Get+a+Free+Estimate%21'),jdecode(''),'/10964.html','true',[],''],
	['PAGE','59412',jdecode('Blog'),jdecode(''),'/59412.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Contrast';
theSitetree.paletteFamily='363C95';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16627';
theSitetree.graphicsetId='12215';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Contrast',
				paletteFamily: 	'363C95',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16627',
				graphicsetId: 	'12215',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				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:  '10001',
internalId:  '',
customField: '20100322-152506'
};
webappMappings['7060']=webappMappings['7060-56a7d4f9ab1ce6ea88d74a76bbc4151d']={
webappId:    '7060',
documentId:  '10901',
internalId:  '56a7d4f9ab1ce6ea88d74a76bbc4151d',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-2cb7c4d6fe63e68dfd692eda0c1e17cb']={
webappId:    '7060',
documentId:  '10943',
internalId:  '2cb7c4d6fe63e68dfd692eda0c1e17cb',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-3106']={
webappId:    '7008',
documentId:  '10964',
internalId:  '3106',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10052',
internalId:  '',
customField: '20100206-200205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10943',
internalId:  '',
customField: '20090510-152544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10964',
internalId:  '',
customField: '20100206-200842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20100206-200258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10922',
internalId:  '',
customField: '20100206-200410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54512',
internalId:  '',
customField: '20091122-010431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56412',
internalId:  '',
customField: '20100206-200753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59412',
internalId:  '',
customField: '20100206-201011'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INLNAY';
var companyName   = '++Sunburst+Windows+++%28253%29+225-5558';
var htmlTitle	  = 'Replacement+Windows+and+Doors%2C+Custom%2C+Seattle%2C+Tacoma%2C+Puget+Sound%2C+Gig+Harbor%2C+Sunburst+Windows';
var metaKeywords  = 'Tacoma+Replacement+Windows%2CTacoma+Window+Contractor%2C+Gig+Harbor+Replacement+Windows%2C+Patio+Doors%2C+Sliding+Glass+Doors%2C+WA%2C+Seattle+Windows%2C+Tacoma+Windows%2C+Gig+Harbor+Windows%2C+Kitsap%2C+Bellevue+Windows%2C+Federal+Way+Windows%2C+Olympia%2C+Tacoma+Custom+Windows%2C+Puget+Sound+Windows%2C+Energy+Star%2C+efficient%2C+Milgard%2C+vinyl%2C+wood%2C+fiberglass%2C+Sunburst+Windows%2C+federal+energy+tax+credit%2C+window+tax+credit%2C+Puget+Sound+Energy+Tax+Credit%2C+Green+Tax+Credits';
var metaContents  = 'Sunburst+Windows%2C+offers+Replacement+Windows+and+Doors+in+the+Puget+Sound%2C+Seattle%2C+Bellevue%2C+Tacoma%2C+Gig+Harbor%2C+Olympia%2C+WA.++Enjoy+energy+efficient+vinyl%2C+wood%2C+fiberglass+windows+and+doors.++Authorized+Milgard+Dealer.+';
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();
};
