/* [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','103',jdecode('Home'),jdecode(''),'/103.html','true',[],''],
	['PAGE','124',jdecode('Services'),jdecode(''),'/124/index.html','true',[ 
		['PAGE','142',jdecode('One-on-One'),jdecode(''),'/124/142.html','true',[],''],
		['PAGE','3083',jdecode('Group+Classes'),jdecode(''),'/124/3083.html','true',[],''],
		['PAGE','10801',jdecode('Backup+Plan'),jdecode(''),'/124/10801.html','true',[],'']
	],''],
	['PAGE','151',jdecode('About+us'),jdecode(''),'/151.html','true',[],''],
	['PAGE','160',jdecode('Tip+of+a+Lifetime'),jdecode(''),'/160.html','true',[],''],
	['PAGE','169',jdecode('Contact+us'),jdecode(''),'/169.html','true',[],''],
	['PAGE','3680',jdecode('Testimonials'),jdecode(''),'/3680.html','true',[],''],
	['PAGE','2432',jdecode('iPaw%26%23x27%3Bs+Faves'),jdecode(''),'/2432.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Daily';
theSitetree.paletteFamily='AED0E8';
theSitetree.keyvisualId='7282';
theSitetree.keyvisualName='kv_7282.jpg';
theSitetree.fontsetId='16457';
theSitetree.graphicsetId='12151';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Daily',
				paletteFamily: 	'AED0E8',
				keyvisualId: 	'7282',
				keyvisualName: 	'kv_7282.jpg',
				fontsetId: 		'16457',
				graphicsetId: 	'12151',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '103',
internalId:  '1006',
customField: '1006'
};
webappMappings['1001']=webappMappings['1001-ahw050in31n46fce66bb14208cef']={
webappId:    '1001',
documentId:  '3083',
internalId:  'ahw050in31n46fce66bb14208cef',
customField: 'followUp'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103',
internalId:  '',
customField: '20090501-151305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2432',
internalId:  '',
customField: '20081215-015939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124',
internalId:  '',
customField: '20090920-002245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142',
internalId:  '',
customField: '20090124-164102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3083',
internalId:  '',
customField: '20090920-002500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151',
internalId:  '',
customField: '20090512-235653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '160',
internalId:  '',
customField: '20080709-222407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '169',
internalId:  '',
customField: '20090920-015339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3680',
internalId:  '',
customField: '20080709-221222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20090124-170032'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN31N4';
var companyName   = '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Upload+Good+Dog+Behaviour%21';
var htmlTitle	  = 'iPaw+Dog+and+Puppy+Training%2C+Behavioural+Problem+Solving+-+Burnaby%2C+Vancouver%2C+New+Westminster';
var metaKeywords  = 'Puppy+Dog+Training%2C+Burnaby%2C+New+Westminster%2C+Vancouver%2C+Coquitlam%2C+Richmond%2C+North+Vancouver%2C+Port+Moody%2C+Port+Coquitlam%2C+ABC+Animal+Behaviour+College+Certified+Dog+Trainer%2C+Positive+Reinforcement%2C+Reward+based+dog+training%2C+dog+friendly+dog+training%2C+Love+Dog+Obedience+Training+Problem+Solving+Group+Obedience+Class+Private+Dog+Training+Class%2C+Fun+Learning+Experiences+Dog+complimentary+consultation+understand+dogs+natural+instincts+motivators+services+Rambunctious+Obedience+Training%2C+Behavioural+Problem+Solving%2C+Tricks+positive+motivational+methods.+Feeding+Time%2C+Separation+Aftermath%2C+Walking+Adventure%2C+Daily+Routines%2C+Teach+Come%2C+Leave-it%2C+Down+Commands%2C+Positive+Note%2C+Housetraining%2C+Housebreaking%2C+No-jumping%2C+No+digging%2C+No+pulling%2C+Loose+Leash%2C+Heel%2C+Trainer+certified+Animal+Behaviour+College%2C+DogSafe+Canine+First+Aid%2C+busy+dog+lifestyles+specific+agendas+One-on-One+private+sessions.++Small+group+class+benefit+socializing+dogs.++Roaming+Greater+Vancouver.++Canine+First+Aid%2C+DogStars+Animal+Training+and+Talent+Agency%2C+Unleashed+Dog+Daycare%2C+APDT+The+Association+of+Pet+Dog+Trainers%2C+CAPPDT+The+Canadian+Association+of+Professional+Pet+Dog+Trainers%2C+DogSafe%2C+Clicker+Training%2C+Dee+Morita%2C+Upload+Good+Dog+Behaviour%2C+fully+bonded+and+insured%2C+SPCA%2C+Disney+Pictures%2C+Workshop+at+Killarney+Community+Centre+Center+Vancouver+Park%2C+PADS%2C+Pacific+Assistance+Dogs+Society%2C+Jean+Donaldson';
var metaContents  = '*Upload+Good+Dog+Behaviour*+Positive+Reward+Based+Puppy+Dog+Obedience+Training%2C+Behavioural+Modification%2C+Clicker+Training+-+Burnaby%2C+Vancouver%2C+New+Westminster+-+Greater+Vancouver+-+Group+Classes%2C+One-on-One+sessions+available';
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();
};
