/* [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','4601',jdecode('Home'),jdecode(''), jdecode('%2F4601.html'), 'true',[],'',''],
	['PAGE','8312',jdecode('About+us'),jdecode(''), jdecode('%2F8312.html'), 'true',[],'',''],
	['PAGE','4673',jdecode('Tips+and+tricks'),jdecode(''), jdecode('%2F4673.html'), 'true',[],'',''],
	['PAGE','14112',jdecode('Photo+Galary'),jdecode(''), jdecode('%2F14112.html'), 'true',[],'',''],
	['PAGE','26212',jdecode('Terms+%26+Con'),jdecode(''), jdecode('%2F26212.html'), 'true',[],'',''],
	['PAGE','34012',jdecode('Cost+of+leak+detection'),jdecode(''), jdecode('%2F34012.html'), 'true',[],'',''],
	['PAGE','36912',jdecode('Bargain%28s%29'),jdecode(''), jdecode('%2F36912.html'), 'true',[],'',''],
	['PAGE','10012',jdecode('Links'),jdecode(''), jdecode('%2F10012.html'), 'true',[],'',''],
	['PAGE','25612',jdecode('Pretoria+Accounts'),jdecode(''), jdecode('%2F25612.html'), 'true',[],'',''],
	['PAGE','28012',jdecode('Refrences'),jdecode(''), jdecode('%2F28012.html'), 'true',[],'',''],
	['PAGE','9812',jdecode('Contact'),jdecode(''), jdecode('%2F9812.html'), 'true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Orbit';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='172';
theSitetree.graphicsetId='202';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003366';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hetzner',
  product: 'WSCSYSSSSLY0XKDS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Orbit',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'172',
				graphicsetId: 	'202',
				contentColor: 	'FFFFFF',
				contentBGColor: '003366',
				a_color: 		'003366',
				b_color: 		'336699',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20110722-111916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4673',
internalId:  '',
customField: '20120111-073843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8312',
internalId:  '',
customField: '20110607-214552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36912',
internalId:  '',
customField: '20110607-212633'
};
webappMappings['7008']=webappMappings['7008-1442']={
webappId:    '7008',
documentId:  '9812',
internalId:  '1442',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9812',
internalId:  '',
customField: '20110625-153359'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10012',
internalId:  '',
customField: '20110215-125721'
};
webappMappings['7060']=webappMappings['7060-b3c1ef729bb18db3c3d0a4546fa074a7']={
webappId:    '7060',
documentId:  '14112',
internalId:  'b3c1ef729bb18db3c3d0a4546fa074a7',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14112',
internalId:  '',
customField: '20110607-213521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34012',
internalId:  '',
customField: '20120105-171010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25612',
internalId:  '',
customField: '20110607-220240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26212',
internalId:  '',
customField: '20110408-141241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28012',
internalId:  '',
customField: '20120111-073710'
};
var webAppHostname = 'sitebuilder.host-h.net:80';
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10INXEAP';
var companyName   = 'Logix+Leak+Detection';
var htmlTitle	  = 'leakdetection';
var metaKeywords  = 'Water%2C+Waterleakdetection%2C+leak+detection%2C+repair%2C+plumber%2C+Plumbing%2C+detection%2C+meter%2C+purification%2C+Pretoria%2C+underground%2C+invisible%2C+Logging%2C+Step%2C+Pressure%2C+steptesting%2C+testing%2C+loss%2C+manangement%2C+Leakdetector%2C+leak+finder%2C+water+Management%2C+PRV%2C+leak+seeking%2C+geyser%2C+burst+pipe%2Cequipment%2Cpipe%2CH20%2C+Logix%2C+leaking%2C+Domestic%2C+Detection%2C+detectors%2C+equipment%2Cwater+leak+detection%2C+Lek%2C+leksporing%2C+water+lek%2C+waterlek+sporing%2C+Gas+leak+detection%2C+gas%2C+Johannesburg%2C+durban%2Ccapetown%2C+bloemfontein%2Cport+elizabeth%2C+polokwane%2Cnelspruit%2C+subserfaceleaks.';
var metaContents  = 'Domestic+water+leak+detection%2C+We+also+do+leak+detection+for+Muncipalities+and+industry%2C+we+use+state+of+the+art+correlators+and+sound+equipment+to+find+leaks+in+under+ground+pipelines.';
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();
};

