/* [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','2701',jdecode('Chem-Dry+Carpet+Cleaning+'),jdecode(''),'/2701.html','true',[],''],
	['PAGE','16601',jdecode('Superior+Carpet+Cleaning'),jdecode(''),'/16601.html','true',[],''],
	['PAGE','16622',jdecode('Expert+Area+Rug+Cleaning'),jdecode(''),'/16622.html','true',[],''],
	['PAGE','16643',jdecode('Upholstery+Cleaning'),jdecode(''),'/16643.html','true',[],''],
	['PAGE','16664',jdecode('Commercial+Cleaning'),jdecode(''),'/16664.html','true',[],''],
	['PAGE','16685',jdecode('Water+Damage+Service'),jdecode(''),'/16685.html','true',[],''],
	['PAGE','16706',jdecode('Customer+Testimonials'),jdecode(''),'/16706.html','true',[],''],
	['PAGE','16727',jdecode('Pricing+%26+Referral+Program'),jdecode(''),'/16727.html','true',[],''],
	['PAGE','16748',jdecode('Contact+Us'),jdecode(''),'/16748.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='5351C2';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10894';
theSitetree.contentColor='0000A5';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Alpha',
				paletteFamily: 	'5351C2',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10894',
				contentColor: 	'0000A5',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'5351C2',
				e_color: 		'5351C2',
				f_color: 		'5351C2',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20100131-213819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16664',
internalId:  '',
customField: '20090313-023308'
};
webappMappings['7008']=webappMappings['7008-13030']={
webappId:    '7008',
documentId:  '2701',
internalId:  '13030',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16643',
internalId:  '',
customField: '20090220-134855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16622',
internalId:  '',
customField: '20090220-140528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20090220-140807'
};
webappMappings['7008']=webappMappings['7008-13725']={
webappId:    '7008',
documentId:  '16748',
internalId:  '13725',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16685',
internalId:  '',
customField: '20090220-013726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16706',
internalId:  '',
customField: '20091021-014508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16727',
internalId:  '',
customField: '20091021-015051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16748',
internalId:  '',
customField: '20090303-032437'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2701',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INEZWZ';
var companyName   = 'Carpet+Cleaning+Portland++%26+Vancouver';
var htmlTitle	  = 'Carpet+Cleaning+Portland+Or+Vancouver+Wa+Carpet+Rug+Upholstery+Cleaners+Chem-Dry';
var metaKeywords  = 'Carpet+Cleaning%2C+Carpet+Cleaners%2C+Upholstery+Cleaners%2C+Furniture+cleaning%2C+vancouver%2C+wa%2C+portland%2C+or%2C+oregon%2C+chem+dry%2C+chemdry%2C+chem-dry%2C++steam+cleaners%2C+commercial+carpet+cleaning%2C+residential+carpet+cleaning%2C+free+estimates%2C+pricing%2C+testimonials%2C+water+damage%2C+area+rug+cleaning%2C+carpet+cleaning+coupons%2C+quick+dry+system%2C+green+carpet+cleaning%2C+pet+urine%2C+carpet+stains%2C+wine+spills%2C+portland%2C+vancouver%2C+west+linn%2C+lake+oswego%2C+tualatin%2C+salmon+creek%2C+washougal%2C+camas%2C+beaverton%2C+gladstone%2C+clackamas%2C+oregon+city%2C+hazel+dell%2C+felida%2C+';
var metaContents  = 'Expert+Carpet%2C+Area+Rug++Upholstery+Cleaning+Since+1991+Chem-Dry+Cleaning+for+All+Portland++Vancouver+Metro+Areas-Since+1991+Call+503-221-9739+or+360-573-5390+Quick+Dry+Time%21+Eco-Friendly%21+Free+Estimates%21+No+Coupons+Needed+for+Fair+and+Competitive+Prices%21+Commercial++Residential+Service+7+Days+a+Week-Read+Our+Customer+Testimonials-Trusted+Carpet+Rug+Cleaners-Count+on+ChemDry%21+Family+Owned+Operated+';
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();
};
