/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','641',jdecode('About+us'),jdecode(''),'/641.html','true',[],''],
	['PAGE','11801',jdecode('Services'),jdecode(''),'/11801/index.html','true',[ 
		['PAGE','11822',jdecode('Commercial+Cleaning'),jdecode(''),'/11801/11822.html','true',[],''],
		['PAGE','11843',jdecode('Residential+Cleaning'),jdecode(''),'/11801/11843.html','true',[],'']
	],''],
	['PAGE','11885',jdecode('new'),jdecode(''),'/11885.html','true',[],''],
	['PAGE','557',jdecode('Carpet+Cleaning'),jdecode(''),'/557.html','true',[],''],
	['PAGE','11906',jdecode('Contact+Us'),jdecode(''),'/11906/index.html','true',[ 
		['PAGE','15301',jdecode('Contact+Us+%28follow+up+page%29'),jdecode(''),'/11906/15301.html','false',[],'']
	],''],
	['PAGE','13701',jdecode('Gallery'),jdecode(''),'/13701.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Easy';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='49';
theSitetree.graphicsetId='57';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Easy',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'49',
				graphicsetId: 	'57',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'003366',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-2285382']={
webappId:    '1501',
documentId:  '401',
internalId:  '2285382',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-c46507c8f78c841f46fdd73902986ad1']={
webappId:    '7060',
documentId:  '13701',
internalId:  'c46507c8f78c841f46fdd73902986ad1',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1001']=webappMappings['1001-ahw050invdwv11c4de48db1']={
webappId:    '1001',
documentId:  '11906',
internalId:  'ahw050invdwv11c4de48db1',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050invdwv11c4de48db1']={
webappId:    '1001',
documentId:  '15301',
internalId:  'ahw050invdwv11c4de48db1',
customField: 'followUp'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090824-131729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '641',
internalId:  '',
customField: '20080821-171234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20080909-170748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11822',
internalId:  '',
customField: '20080909-170748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11843',
internalId:  '',
customField: '20080909-170748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11885',
internalId:  '',
customField: '20080909-170748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20080821-171234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11906',
internalId:  '',
customField: '20090824-131937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15301',
internalId:  '',
customField: '20080910-151216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20090824-131812'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INVDWV';
var companyName   = 'VERONICA%27S+JANITORIAL+SERVICES';
var htmlTitle	  = '';
var metaKeywords  = 'Commercial++Residential+Janitorial+Services+in+San+Diego%2C+Commercial+and+Residential+Services+in+Chula+Vista%2C+Professional+Janitorial+Services%2C+Cleaning+Services+in+Chula+Vista%2C+Cleaning+Services+in+San+Diego%2C+Commercial+and+Residential+Cleaning+Services+in+San+Diego+Area%2C+Professional+Janitors%2C+Professional+Janitors+in+San+Diego%2C+Professional+Janitors+in+San+Diego+Area%2C+Professional+Janitors+in+Chula+Vista%2C+Residential+Janitors%2C+Commercial+Janitors%2C++Janitors+in+San+Diego%2C+Janitors+in+San+Diego+County%2C+Janitor+in+Chula+Vista%2C+San+Diego+Professional+Janitor%2C+Chula+Vista+Professional+Janitor';
var metaContents  = 'Commercial+Cleaning+Services%2C+Residential+Cleaning+Services%2C+Professional+Cleaning+Services%2C+Carpet+Cleaning%2C+Janitorial+Services%2C+Janitorial%2C+Commercial+Janitorial+Services%2C+Residential+Janitorial+Services%2C+Office+Cleaning+Services%2C+Mall+Cleaning+Services%2C+Professional+Janitors%2C+Professional+Janitors%2C+++';
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();
};

