/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],'',''],
	['PAGE','71',jdecode('Contact+Me'),jdecode(''),'/71.html','true',[],'',''],
	['PAGE','580',jdecode('Prices'),jdecode(''),'/580.html','true',[],'',''],
	['PAGE','598',jdecode('News'),jdecode(''),'/598.html','true',[],'',''],
	['PAGE','837',jdecode('Satisfied+Customers'),jdecode(''),'/837.html','true',[],'',''],
	['PAGE','11201',jdecode('Availability'),jdecode(''),'/11201.html','true',[],'',''],
	['PAGE','14201',jdecode('What+to+bring+for+your+Pets+stay+with+me'),jdecode(''),'/14201.html','true',[],'',''],
	['PAGE','897',jdecode('Pekingese+Rescue'),jdecode(''),'/897.html','true',[],'',''],
	['PAGE','1482',jdecode('Guestbook'),jdecode(''),'/1482/index.html','true',[ 
		['PAGE','1481',jdecode('Read+Guestbook'),jdecode(''),'/1482/1481.html','false',[],'','']
	],'',''],
	['PAGE','13001',jdecode('Links'),jdecode(''),'/13001.html','true',[],'',''],
	['PAGE','14401',jdecode('Service'),jdecode(''),'/14401.html','true',[],'',''],
	['PAGE','17401',jdecode('For+Sale'),jdecode(''),'/17401/index.html','true',[ 
		['PAGE','17422',jdecode('Current+offers'),jdecode(''),'/17401/17422.html','true',[],'','']
	],'',''],
	['PAGE','17801',jdecode('Donations'),jdecode(''),'/17801.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Cinema';
theSitetree.paletteFamily='B00E18';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16615';
theSitetree.graphicsetId='12208';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='B00E18';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cinema',
				paletteFamily: 	'B00E18',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16615',
				graphicsetId: 	'12208',
				contentColor: 	'000000',
				contentBGColor: 'B00E18',
				a_color: 		'000000',
				b_color: 		'C03E46',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-74b87567e45c2f93a8ac34bd9ffb3311']={
webappId:    '7060',
documentId:  '837',
internalId:  '74b87567e45c2f93a8ac34bd9ffb3311',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '580',
internalId:  '',
customField: '20100618-091056'
};
webappMappings['1002']=webappMappings['1002-1482AHW050IN3SG2']={
webappId:    '1002',
documentId:  '1482',
internalId:  '1482AHW050IN3SG2',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-1956922']={
webappId:    '1501',
documentId:  '32',
internalId:  '1956922',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20100805-225401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20100516-143808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '598',
internalId:  '',
customField: '20091022-130624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '837',
internalId:  '',
customField: '20070422-153459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '897',
internalId:  '',
customField: '20070424-010546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1482',
internalId:  '',
customField: '20070423-212958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1481',
internalId:  '',
customField: '20070423-212958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20100729-205928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20100304-171233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20100222-104404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20100222-105300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20100822-171129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17422',
internalId:  '',
customField: '20100822-170937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20100822-213121'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3SG2';
var companyName   = 'Nancy%27s+Loving+Pet+Care';
var htmlTitle	  = 'Nancys+Loving+Pet+Care+in+Bergen+County%2C+New+Jersey';
var metaKeywords  = 'New+Jersey+petsitter%2C+New+Jersey+pet+care%2C+Bergen+County+New+Jersey+pet+care%2C+new+jersey+pet+sitter%2C+nancys+loving+pet+care%2CBergen+County%2CNew+Jersey';
var metaContents  = 'Nancys+Loving+Petcare%2C+Bergen+County%2C+New+Jersey%3B+member+NAPPS+%28National+association+of+professional+pet+sitters%29+and+Professional+United+Pet+Sitters';
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();
};
