/* [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','3401',jdecode('Home'),jdecode(''),'/3401.html','true',[],'',''],
	['PAGE','56527',jdecode('News+and+Events'),jdecode(''),'/56527.html','true',[],'',''],
	['PAGE','5701',jdecode('Our+Adoptables'),jdecode(''),'/5701.html','true',[],'',''],
	['PAGE','13801',jdecode('Applications'),jdecode(''),'/13801.html','true',[],'',''],
	['PAGE','43704',jdecode('**Online+Auction**'),jdecode(''),'/43704.html','true',[],'',''],
	['PAGE','7501',jdecode('Our+Store'),jdecode(''),'/7501.html','true',[],'',''],
	['PAGE','153482',jdecode('Kameleon+Jewelry'),jdecode(''),'/153482.html','true',[],'',''],
	['PAGE','5743',jdecode('Happy+Endings'),jdecode(''),'/5743.html','true',[],'',''],
	['PAGE','30078',jdecode('Po%26%23x27%3Bs+Story'),jdecode(''),'/30078.html','true',[],'',''],
	['PAGE','35647',jdecode('Our+Fosters'),jdecode(''),'/35647.html','true',[],'',''],
	['PAGE','30157',jdecode('%28Discussion%29+forum'),jdecode(''),'/30157.html','true',[],'',''],
	['PAGE','143154',jdecode('Educational+Info'),jdecode(''),'/143154.html','true',[],'',''],
	['PAGE','5722',jdecode('How+to+help'),jdecode(''),'/5722.html','true',[],'',''],
	['PAGE','71583',jdecode('Lost+and+Found+Pet+Page'),jdecode(''),'/71583.html','true',[],'',''],
	['PAGE','5501',jdecode('About+us'),jdecode(''),'/5501.html','true',[],'',''],
	['PAGE','8201',jdecode('FAQ'),jdecode(''),'/8201.html','true',[],'',''],
	['PAGE','282325',jdecode('Friends+of+ARC'),jdecode(''),'/282325.html','true',[],'',''],
	['PAGE','5564',jdecode('Contact'),jdecode(''),'/5564.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Porthole';
theSitetree.paletteFamily='920707';
theSitetree.keyvisualId='6717';
theSitetree.keyvisualName='kv_6717.jpg';
theSitetree.fontsetId='11204';
theSitetree.graphicsetId='12017';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FAEEEE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Porthole',
				paletteFamily: 	'920707',
				keyvisualId: 	'6717',
				keyvisualName: 	'kv_6717.jpg',
				fontsetId: 		'11204',
				graphicsetId: 	'12017',
				contentColor: 	'000000',
				contentBGColor: 'FAEEEE',
				a_color: 		'000000',
				b_color: 		'000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20100729-205524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20080725-155333'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-7646324']={
webappId:    '1501',
documentId:  '3401',
internalId:  '7646324',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20081105-203419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20080517-213433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20080517-213550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100729-163507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5722',
internalId:  '',
customField: '20080516-200940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5564',
internalId:  '',
customField: '20100227-215314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5743',
internalId:  '',
customField: '20090915-142623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30157',
internalId:  '',
customField: '20080514-190006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30078',
internalId:  '',
customField: '20081104-204128'
};
webappMappings['1003']=webappMappings['1003-aendu0in2gj4119e9a5a4e4']={
webappId:    '1003',
documentId:  '30157',
internalId:  'aendu0in2gj4119e9a5a4e4',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35647',
internalId:  '',
customField: '20080518-215706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43704',
internalId:  '',
customField: '20100603-205559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56527',
internalId:  '',
customField: '20100729-185723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71583',
internalId:  '',
customField: '20090123-172242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143154',
internalId:  '',
customField: '20090820-211954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '153482',
internalId:  '',
customField: '20090329-151547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '282325',
internalId:  '',
customField: '20100505-180327'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2GJ4';
var companyName   = 'Animal+Rescue+Coalitions';
var htmlTitle	  = 'Animal+Rescue+Coalitions+Nova+Scotia';
var metaKeywords  = 'Rescue%2Clitters%2Ccritters%2C+dogs%2C+cats%2C+Animal+Rescue%2C+adoption%2C+adopting%2Csurrender%2C+adopting%2Ccompanion+animal%2Cadopt+a+dog';
var metaContents  = 'Animal+Rescue+Coalitions+Nova+Scotia';
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();
};
