/* [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','1101',jdecode('Home'),jdecode(''), jdecode('%2F1101.html'), 'true',[],'',''],
	['PAGE','7422',jdecode('About+us'),jdecode(''), jdecode('%2F7422.html'), 'true',[],'',''],
	['PAGE','13201',jdecode('Service'),jdecode(''), jdecode('%2F13201.html'), 'true',[],'',''],
	['PAGE','7401',jdecode('References'),jdecode(''), jdecode('%2F7401.html'), 'true',[],'',''],
	['PAGE','2601',jdecode('Contact'),jdecode(''), jdecode('%2F2601.html'), 'true',[],'','']];
var siteelementCount=5;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='01343D';
theSitetree.keyvisualId='2152';
theSitetree.keyvisualName='architektur.jpg';
theSitetree.fontsetId='359';
theSitetree.graphicsetId='409';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='01343D';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp19-dulles',
  product: 'WSCSYSSSSLYTCPII'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Medium',
				paletteFamily: 	'01343D',
				keyvisualId: 	'2152',
				keyvisualName: 	'architektur.jpg',
				fontsetId: 		'359',
				graphicsetId: 	'409',
				contentColor: 	'FFFFFF',
				contentBGColor: '01343D',
				a_color: 		'01343D',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20110906-164229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7422',
internalId:  '',
customField: '20110906-160618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20110906-154354'
};
webappMappings['7008']=webappMappings['7008-26331']={
webappId:    '7008',
documentId:  '2601',
internalId:  '26331',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20110906-142500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20080627-085316'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INV2HM';
var companyName   = '';
var htmlTitle	  = 'RCW+Renovations%2C+Inc.%2C+Delaware%27s+first+Accredited+Professional+Stager+and+home+repair+service+company';
var metaKeywords  = 'handyman%2C+staging%2C+home+stager%2Chome+repairs%2C+home+improvements%2C+carpet%2C+hardwood%2C+tile%2C+kitchen+and+bath%2C+renovation.';
var metaContents  = '%3CHEAD%3E%0D%0A%0D%0A%3Cmeta+name%3D%22google-site-verification%22+content%3D%22E_TkWWpa-B86cMhDSXmTpPkMtNwsri611RkJ2TbMz4c%22+%2F%3E%0D%0A%0D%0A%3CTITLE%3ERCW+Renovations+and+Seller%27s+Advantage+-+Delaware%27s+first+and+most+experienced+Accredited+Home+Staging+and+residential+contracting+company.+%3C%2FTITLE%3E%0D%0A%0D%0A%3CMETA+NAME%3D%22Description%22+CONTENT%3D%22Introdution+to+Delaware%27s+first+Accredited+Staging+Professional+and+the+source+for+handyman+repair%2C+room+upgrades+and+renovaton+services.%22%3E%0D%0A%0D%0A%3CMETA+NAME%3D%22Keywords%22+CONTENT%3D%22RCW+Renovations%2C+handyman%2C+staging%2C+home+stager%2Chome+repairs%2C+home+improvements%2C+flooring%22%3E%0D%0A%0D%0A%3CMETA+NAME%3D%22author%22+CONTENT%3D%22RCW+Renovations%2C+Inc.+info%40rcwrenovations.com%22%3E%0D%0A%0D%0A%3CMETA+NAME%3D%22revisit-after%22+CONTENT%3D%2220+days%22%3E%0D%0A%0D%0A%3CMETA+NAME%3D%22copyright%22+CONTENT%3D%22%C2%A92002-2011+RCW+Renovations%2C+Inc.%2C+all+rights+reserved%22%3E%0D%0A%0D%0A%3CMETA+NAME%3D%22robots%22+CONTENT%3D%22FOLLOW%2CINDEX%22%3E%0D%0A%0D%0A%3C%2FHEAD%3E';
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();
};

