/* [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','601',jdecode('HOME'),jdecode(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','8001',jdecode('SHOWROOM'),jdecode(''), jdecode('%2F8001.html'), 'true',[],'',''],
	['PAGE','43812',jdecode('PRODUCTS'),jdecode(''), jdecode('%2F43812%2Findex.html'), 'true',[ 
		['PAGE','36212',jdecode('+Window+%26+Door'),jdecode(''), jdecode('%2F43812%2F36212.html'), 'true',[],'',''],
		['PAGE','67026',jdecode('+Entry+Doors'),jdecode(''), jdecode('%2F43812%2F67026.html'), 'true',[],'',''],
		['PAGE','67047',jdecode('+Interior+Doors'),jdecode(''), jdecode('%2F43812%2F67047.html'), 'true',[],'',''],
		['PAGE','70837',jdecode('+Commercial'),jdecode(''), jdecode('%2F43812%2F70837.html'), 'true',[],'',''],
		['PAGE','43833',jdecode('+Hardware'),jdecode(''), jdecode('%2F43812%2F43833.html'), 'true',[],'',''],
		['PAGE','44812',jdecode('+Mouldings'),jdecode(''), jdecode('%2F43812%2F44812.html'), 'true',[],'',''],
		['PAGE','70858',jdecode('+Cabinetry'),jdecode(''), jdecode('%2F43812%2F70858.html'), 'false',[],'',''],
		['PAGE','43854',jdecode('+Skylights+%26+Glass'),jdecode(''), jdecode('%2F43812%2F43854.html'), 'true',[],'','']
	],'',''],
	['PAGE','19301',jdecode('GALLERY'),jdecode(''), jdecode('%2F19301.html'), 'true',[],'',''],
	['PAGE','6601',jdecode('CALENDAR'),jdecode(''), jdecode('%2F6601.html'), 'true',[],'',''],
	['PAGE','6622',jdecode('NEWSLETTER'),jdecode(''), jdecode('%2F6622.html'), 'true',[],'',''],
	['PAGE','6643',jdecode('CONTACT+US'),jdecode(''), jdecode('%2F6643.html'), 'true',[],'',''],
	['PAGE','5385',jdecode('MAP'),jdecode(''), jdecode('%2F5385.html'), 'true',[],'',''],
	['PAGE','5343',jdecode('ABOUT+US'),jdecode(''), jdecode('%2F5343%2Findex.html'), 'true',[ 
		['PAGE','28101',jdecode('+Solar+Energy'),jdecode(''), jdecode('%2F5343%2F28101.html'), 'true',[],'','']
	],'',''],
	['PAGE','5364',jdecode('OUR+TEAM'),jdecode(''), jdecode('%2F5364.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10553';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp13-bizcla',
  product: 'WSCSYSSSSLYTCPII'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10553',
				graphicsetId: 	'10448',
				contentColor: 	'FFFFFF',
				contentBGColor: '5e5e5e',
				a_color: 		'5E5E5E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20120109-180121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5343',
internalId:  '',
customField: '20090528-161217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70837',
internalId:  '',
customField: '20101026-182130'
};
webappMappings['7060']=webappMappings['7060-86f35c0d4c47030223c4a169da701f60']={
webappId:    '7060',
documentId:  '19301',
internalId:  '86f35c0d4c47030223c4a169da701f60',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5364',
internalId:  '',
customField: '20120109-181958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5385',
internalId:  '',
customField: '20090531-111402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6622',
internalId:  '',
customField: '20111006-125826'
};
webappMappings['7008']=webappMappings['7008-5257']={
webappId:    '7008',
documentId:  '6643',
internalId:  '5257',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6643',
internalId:  '',
customField: '20120109-183256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20090613-181524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20090422-194608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19301',
internalId:  '',
customField: '20090421-190143'
};
webappMappings['1501']=webappMappings['1501-14044569']={
webappId:    '1501',
documentId:  '601',
internalId:  '14044569',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70858',
internalId:  '',
customField: '20101028-170050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67047',
internalId:  '',
customField: '20111006-101431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67026',
internalId:  '',
customField: '20110310-114608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44812',
internalId:  '',
customField: '20100113-102551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43854',
internalId:  '',
customField: '20111006-101637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43833',
internalId:  '',
customField: '20101026-184830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43812',
internalId:  '',
customField: '20110615-170204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36212',
internalId:  '',
customField: '20111006-101403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28101',
internalId:  '',
customField: '20110615-175232'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZLW8';
var companyName   = '+++++++BENCHMARK+BUILDERS+SHOWROOM';
var htmlTitle	  = 'Windows+-+Doors+-+Hardware';
var metaKeywords  = 'Windows%2C+Doors%2C+Hardware%2C+Moldings%2C+Moulding%2C+Fleetwood%2C+Weiland%2C+Marvin%2C+Milgard%2C+Emtek%2C+Baldwin%2C+DeCarlo';
var metaContents  = 'Southern+California%27s+finest+Architect+%26+Contractor+Showroom.+Prestige+brands+of+Windows%2C+Doors+%26+Hardware.++Fleetwood%2C+Marvin%2C+Weiland%2C+Milgard%2C+Emtek%2C+Baldwin%2C+DeCarlo.';
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();
};

