/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','156922',jdecode('About+us'),jdecode(''), jdecode('%2F156922%2Findex.html'), 'true',[ 
		['PAGE','156964',jdecode('Our+team'),jdecode(''), jdecode('%2F156922%2F156964.html'), 'true',[],'','']
	],'',''],
	['PAGE','5201',jdecode('Evaluation'),jdecode(''), jdecode('%2F5201.html'), 'true',[],'',''],
	['PAGE','157601',jdecode('FAQs'),jdecode(''), jdecode('%2F157601.html'), 'true',[],'',''],
	['PAGE','156901',jdecode('Testimonial'),jdecode(''), jdecode('%2F156901.html'), 'true',[],'',''],
	['PAGE','41101',jdecode('Aircon+Servicing+'),jdecode(''), jdecode('%2F41101.html'), 'true',[],'',''],
	['PAGE','5264',jdecode('Rebuild+Parts'),jdecode(''), jdecode('%2F5264.html'), 'true',[],'',''],
	['PAGE','35722',jdecode('Odours'),jdecode(''), jdecode('%2F35722%2Findex.html'), 'true',[ 
		['PAGE','35743',jdecode('Treatment'),jdecode(''), jdecode('%2F35722%2F35743.html'), 'true',[],'',''],
		['PAGE','177401',jdecode('Testimonial+'),jdecode(''), jdecode('%2F35722%2F177401.html'), 'true',[],'',''],
		['PAGE','35764',jdecode('Pollen+Filer'),jdecode(''), jdecode('%2F35722%2F35764.html'), 'true',[],'','']
	],'',''],
	['PAGE','35827',jdecode('Use+and+care+'),jdecode(''), jdecode('%2F35827.html'), 'true',[],'',''],
	['PAGE','107801',jdecode('Contact'),jdecode(''), jdecode('%2F107801.html'), 'true',[],'',''],
	['PAGE','167401',jdecode('Commercial+'),jdecode(''), jdecode('%2F167401.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Daily';
theSitetree.paletteFamily='AED0E8';
theSitetree.keyvisualId='7279';
theSitetree.keyvisualName='kv_7279.jpg';
theSitetree.fontsetId='16457';
theSitetree.graphicsetId='12151';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'mitdnz',
  product: 'WSCSYSSSSLYTC22A'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Daily',
				paletteFamily: 	'AED0E8',
				keyvisualId: 	'7279',
				keyvisualName: 	'kv_7279.jpg',
				fontsetId: 		'16457',
				graphicsetId: 	'12151',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20111012-223550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20111012-232608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167401',
internalId:  '',
customField: '20111012-224332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157601',
internalId:  '',
customField: '20111012-231938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156901',
internalId:  '',
customField: '20110922-234327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41101',
internalId:  '',
customField: '20101219-014046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156922',
internalId:  '',
customField: '20101219-021437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156964',
internalId:  '',
customField: '20111013-001810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5264',
internalId:  '',
customField: '20101219-014314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35722',
internalId:  '',
customField: '20101219-024101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35743',
internalId:  '',
customField: '20111012-023809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35764',
internalId:  '',
customField: '20101219-015108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35827',
internalId:  '',
customField: '20101219-015246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107801',
internalId:  '',
customField: '20101219-013148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '177401',
internalId:  '',
customField: '20111023-204840'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZK2V';
var companyName   = 'Beat+the+heat%21+++++++++++++++++++VEHICLE+AIR+CONDITIONING+SPECIALISTS';
var htmlTitle	  = 'Tauranga+Vehicle+Air+conditioning+Repairs++CARAIR+B.O.P.+Mt.Mauganui';
var metaKeywords  = 'Vehicle+Air+Conditioning%2C++Car+Air+Con%2CAir+conditioning%2C+Air+Conditioning%2C+Aircon%2C+Air+conditioning+Repair%2C+Air+conditioning+Repair%2C+Automotive+AIr+Conditioning+Service';
var metaContents  = 'Vehicle+Air+conditioning%2C+Automotive+Air+conditioning%2C+trucks%2C+Bus+and+other+vehicles.++Based+in+Mt.+Maunganui%2C+Tauranga+Bay+of+Plenty.+++';
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();
};

