/* [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','1501',jdecode('Home'),jdecode(''), jdecode('%2F1501.html'), 'true',[],'',''],
	['PAGE','1552',jdecode('Siding'),jdecode(''), jdecode('%2F1552%2Findex.html'), 'true',[ 
		['PAGE','5101',jdecode('Steel+'),jdecode(''), jdecode('%2F1552%2F5101.html'), 'true',[],'',''],
		['PAGE','5122',jdecode('Vinyl'),jdecode(''), jdecode('%2F1552%2F5122.html'), 'true',[],'',''],
		['PAGE','11201',jdecode('Hardiplank'),jdecode(''), jdecode('%2F1552%2F11201.html'), 'true',[],'','']
	],'',''],
	['PAGE','25312',jdecode('Windows'),jdecode(''), jdecode('%2F25312%2Findex.html'), 'true',[ 
		['PAGE','22412',jdecode('Essentials'),jdecode(''), jdecode('%2F25312%2F22412.html'), 'true',[],'',''],
		['PAGE','5143',jdecode('Double+Hung'),jdecode(''), jdecode('%2F25312%2F5143.html'), 'true',[],'',''],
		['PAGE','5164',jdecode('Slider'),jdecode(''), jdecode('%2F25312%2F5164.html'), 'true',[],'',''],
		['PAGE','5185',jdecode('Casement'),jdecode(''), jdecode('%2F25312%2F5185.html'), 'true',[],'',''],
		['PAGE','5206',jdecode('Picture'),jdecode(''), jdecode('%2F25312%2F5206.html'), 'true',[],'',''],
		['PAGE','21012',jdecode('Awning'),jdecode(''), jdecode('%2F25312%2F21012.html'), 'true',[],'',''],
		['PAGE','21033',jdecode('Bay+and+Bow+Windows'),jdecode(''), jdecode('%2F25312%2F21033.html'), 'true',[],'',''],
		['PAGE','5248',jdecode('Glass'),jdecode(''), jdecode('%2F25312%2F5248.html'), 'true',[],'',''],
		['PAGE','5269',jdecode('Window+Options'),jdecode(''), jdecode('%2F25312%2F5269.html'), 'true',[],'',''],
		['PAGE','22812',jdecode('Sunrise+Warranty'),jdecode(''), jdecode('%2F25312%2F22812.html'), 'true',[],'','']
	],'',''],
	['PAGE','5290',jdecode('Doors'),jdecode(''), jdecode('%2F5290%2Findex.html'), 'true',[ 
		['PAGE','5227',jdecode('Patio+Doors'),jdecode(''), jdecode('%2F5290%2F5227.html'), 'true',[],'',''],
		['PAGE','5311',jdecode('Storm+Doors'),jdecode(''), jdecode('%2F5290%2F5311.html'), 'true',[],'','']
	],'',''],
	['PAGE','2201',jdecode('Contact'),jdecode(''), jdecode('%2F2201.html'), 'true',[],'',''],
	['PAGE','26312',jdecode('Reviews'),jdecode(''), jdecode('%2F26312.html'), 'true',[],'',''],
	['PAGE','1573',jdecode('Videos'),jdecode(''), jdecode('%2F1573.html'), 'true',[],'',''],
	['PAGE','5332',jdecode('Photos'),jdecode(''), jdecode('%2F5332.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='F5F5F5';
theSitetree.keyvisualId='2166';
theSitetree.keyvisualName='handwerk.jpg';
theSitetree.fontsetId='355';
theSitetree.graphicsetId='407';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F5F5F5';
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: 			'Medium',
				paletteFamily: 	'F5F5F5',
				keyvisualId: 	'2166',
				keyvisualName: 	'handwerk.jpg',
				fontsetId: 		'355',
				graphicsetId: 	'407',
				contentColor: 	'000000',
				contentBGColor: 'F5F5F5',
				a_color: 		'F5F5F5',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1501',
internalId:  '',
customField: '20111107-163514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1552',
internalId:  '',
customField: '20111018-170101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1573',
internalId:  '',
customField: '20111107-162243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20111018-170802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5143',
internalId:  '',
customField: '20111107-162909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25312',
internalId:  '',
customField: '20111107-161734'
};
webappMappings['7008']=webappMappings['7008-26749']={
webappId:    '7008',
documentId:  '2201',
internalId:  '26749',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20111129-224055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5122',
internalId:  '',
customField: '20111018-170248'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20111018-170200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5164',
internalId:  '',
customField: '20111107-162955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5185',
internalId:  '',
customField: '20111107-162502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5206',
internalId:  '',
customField: '20111018-171712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5227',
internalId:  '',
customField: '20111018-172122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5248',
internalId:  '',
customField: '20111107-162721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5269',
internalId:  '',
customField: '20111010-155242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5290',
internalId:  '',
customField: '20111010-160353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5311',
internalId:  '',
customField: '20111010-160540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5332',
internalId:  '',
customField: '20111010-160753'
};
webappMappings['1501']=webappMappings['1501-17044586']={
webappId:    '1501',
documentId:  '1501',
internalId:  '17044586',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21033',
internalId:  '',
customField: '20111010-154144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21012',
internalId:  '',
customField: '20111107-163025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22412',
internalId:  '',
customField: '20111107-162928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22812',
internalId:  '',
customField: '20111018-172607'
};
webappMappings['7050']=webappMappings['7050-7944']={
webappId:    '7050',
documentId:  '26312',
internalId:  '7944',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26312',
internalId:  '',
customField: '20111129-224510'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I790UX';
var companyName   = 'Paramount+Siding+%26+Windows';
var htmlTitle	  = '';
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();
};

