/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','452',jdecode('Opening+hours'),jdecode(''),'/452.html','true',[],'',''],
	['PAGE','515',jdecode('Contact'),jdecode(''),'/515.html','true',[],'',''],
	['PAGE','557',jdecode('How+to+find+us'),jdecode(''),'/557.html','true',[],'',''],
	['PAGE','536',jdecode('About+us'),jdecode(''),'/536/index.html','true',[ 
		['PAGE','578',jdecode('Our+team'),jdecode(''),'/536/578.html','true',[],'',''],
		['PAGE','473',jdecode('Veterinary+practise'),jdecode(''),'/536/473.html','true',[],'',''],
		['PAGE','494',jdecode('Special+Interests'),jdecode(''),'/536/494.html','true',[],'','']
	],'',''],
	['PAGE','620',jdecode('Tips+%26+Advice'),jdecode(''),'/620.html','true',[],'',''],
	['PAGE','641',jdecode('Offers'),jdecode(''),'/641.html','true',[],'',''],
	['PAGE','662',jdecode('Products'),jdecode(''),'/662/index.html','true',[ 
		['PAGE','683',jdecode('First+Product'),jdecode(''),'/662/683.html','true',[],'',''],
		['PAGE','704',jdecode('Second+Product'),jdecode(''),'/662/704.html','true',[],'',''],
		['PAGE','725',jdecode('Third+Product'),jdecode(''),'/662/725.html','true',[],'','']
	],'',''],
	['PAGE','746',jdecode('Interesting+Links'),jdecode(''),'/746.html','true',[],'',''],
	['PAGE','3801',jdecode('clinic++photos'),jdecode(''),'/3801.html','true',[],'',''],
	['PAGE','4101',jdecode('Shop'),jdecode(''),'/4101.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='333333';
theSitetree.keyvisualId='9242';
theSitetree.keyvisualName='kv4.swf';
theSitetree.fontsetId='17363';
theSitetree.graphicsetId='12757';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Transluszent',
				paletteFamily: 	'333333',
				keyvisualId: 	'9242',
				keyvisualName: 	'kv4.swf',
				fontsetId: 		'17363',
				graphicsetId: 	'12757',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-9235020']={
webappId:    '1501',
documentId:  '401',
internalId:  '9235020',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-5ce754e3a246155effdd852dd558d9b1']={
webappId:    '7060',
documentId:  '3801',
internalId:  '5ce754e3a246155effdd852dd558d9b1',
customField: 'language:en;country:US;'
};
webappMappings['4001']=webappMappings['4001-9653535']={
webappId:    '4001',
documentId:  '4101',
internalId:  '9653535',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090903-220558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20091122-221435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20090903-225708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20080408-135258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20091111-224710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20080408-135258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20080605-224905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20080605-230007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20081021-182623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '641',
internalId:  '',
customField: '20090907-214303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '662',
internalId:  '',
customField: '20080408-135258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '683',
internalId:  '',
customField: '20080408-135258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '704',
internalId:  '',
customField: '20080408-135258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '725',
internalId:  '',
customField: '20080408-135258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '746',
internalId:  '',
customField: '20080408-135258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20081021-195705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4101',
internalId:  '',
customField: '20080518-215309'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INF784';
var companyName   = 'NORMANBY+RD+VET+CLINIC';
var htmlTitle	  = 'www.petdoc.co.nz';
var metaKeywords  = '++Vet+Veterinary+animals++pets+cats++dogs+birds++parrot++canary+budgie+cockateil+cockatoo+Galah+fish+pocketpets+reptile++surgery+spay+neuter+orthopaedic+wounds+exploratory+laparotomy++dental+polish+extraction+deciduous++X-rays++food+prescription+Hills+Science+Eukanuba+Iams+Royal+Canin+Advance++exact+fiesta+millet++lorikeet++++Cattery+Catmandu+boarding+Normanby+Rd+Newton+Epsom+Mt+Eden+Eden+Tce+KingslandDr++Chris+Laurenson+BVSc+Vet+Vets+Veterinary+animal+animals++pets+cats+kitten+kittens++dogs+puppies+puppy+preschool+training+birds++parrot++canary+budgie+cockateil+cockatoo+Galah+fish+pocketpets+reptile++lorikeet++Cattery+Catmandu+boarding++Normanby+Mt+Eden+petfood++Iams+++Hills+Eukanuba+Royal+Canin+Advance+advantage+revolution+frontline+Practic+Flea+Products+Prolong+x-ray+X-rays++xray++xrays+surgery++sedation+anaesthetics+anesthetics++microchip+Normanby+Rd+Newton+Epsom+Mt+Eden+Eden+Tce+Kingsland+Newmarket+Auckland+Parnell+Remuera+Meadowbank+companion+animal++Register';
var metaContents  = 'Dr++Chris+Laurenson+BVSc+Vet+Vets+Veterinary+animal+animals++pets+cats+kitten+kittens++dogs+puppies+puppy+preschool+training+birds++parrot++canary+budgie+cockateil+cockatoo+Galah+fish+pocketpets+reptile++lorikeet++Cattery+Catmandu+boarding++Normanby+Mt+Eden+petfood++Iams+++Hills+Eukanuba+Royal+Canin+Advance+advantage+revolution+frontline+Practic+Flea+Products+Prolong+x-ray+X-rays++xray++xrays+surgery++sedation+anaesthetics+anesthetics++microchip+Normanby+Rd+Newton+Epsom+Mt+Eden+Eden+Tce+Kingsland+Newmarket+Auckland+Parnell+Remuera+Meadowbank+companion+animal++Register';
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();
};
