/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],''],
	['PAGE','7101',jdecode('+Cylinder+Guideline'),jdecode(''),'/7101/index.html','true',[ 
		['PAGE','7122',jdecode('Which+Cylinder+Should+I+Use%3F+'),jdecode(''),'/7101/7122.html','true',[],'']
	],''],
	['PAGE','7143',jdecode('++Low+Pressure+Cylinders'),jdecode(''),'/7143.html','true',[],''],
	['PAGE','7164',jdecode('Medium+Pressure+Cylinders'),jdecode(''),'/7164.html','true',[],''],
	['PAGE','7206',jdecode('Copper+Cylinders'),jdecode(''),'/7206.html','true',[],''],
	['PAGE','7227',jdecode('Stainless+Steel+Cylinders+'),jdecode(''),'/7227.html','true',[],''],
	['PAGE','7248',jdecode('Glass+Lined+Cylinders'),jdecode(''),'/7248.html','true',[],''],
	['PAGE','7269',jdecode('Cylinders+with+Coils'),jdecode(''),'/7269.html','true',[],''],
	['PAGE','30601',jdecode('Wetback+Cylinders'),jdecode(''),'/30601.html','true',[],''],
	['PAGE','7311',jdecode('General+Information'),jdecode(''),'/7311/index.html','true',[ 
		['PAGE','22901',jdecode('Product+information'),jdecode(''),'/7311/22901.html','true',[],''],
		['PAGE','7290',jdecode('Tips+and+Tricks'),jdecode(''),'/7311/7290.html','true',[],''],
		['PAGE','25301',jdecode('Need+a+Price+on+a+Product+%3F'),jdecode(''),'/7311/25301.html','true',[],'']
	],''],
	['PAGE','36701',jdecode('Solar+Hot+Water'),jdecode(''),'/36701.html','true',[],''],
	['PAGE','7332',jdecode('Contact+Us'),jdecode(''),'/7332.html','true',[],''],
	['PAGE','37801',jdecode('Liquidads.co.nz'),jdecode(''),'/37801.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='3D4B78';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='422';
theSitetree.graphicsetId='467';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D4B78';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Logg',
				paletteFamily: 	'3D4B78',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'422',
				graphicsetId: 	'467',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D4B78',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'3D4B78',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-8008646']={
webappId:    '1501',
documentId:  '501',
internalId:  '8008646',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090612-042646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7332',
internalId:  '',
customField: '20080918-031113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20090521-002816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7311',
internalId:  '',
customField: '20090612-042544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22901',
internalId:  '',
customField: '20091104-194842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7122',
internalId:  '',
customField: '20090508-002349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7143',
internalId:  '',
customField: '20071211-043218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7164',
internalId:  '',
customField: '20091104-193640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7206',
internalId:  '',
customField: '20071203-215205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7227',
internalId:  '',
customField: '20071209-032516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7248',
internalId:  '',
customField: '20090521-003748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7269',
internalId:  '',
customField: '20071211-044638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37801',
internalId:  '',
customField: '20091104-203311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36701',
internalId:  '',
customField: '20080228-215604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30601',
internalId:  '',
customField: '20071207-204203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7290',
internalId:  '',
customField: '20091104-202634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25301',
internalId:  '',
customField: '20091104-203027'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZ81L';
var companyName   = 'Cylinders+Online';
var htmlTitle	  = '';
var metaKeywords  = 'Cylindersonline%2C+hot+water%2C+heaters%2C+hot+water+cylinders%2C+cylinders%2C+boilers%2C+nz%2C+solarone%2C+evacuated+tubes%2C+trademe+%2Ctrade+me+%2Celectic+water+heaters%2C+Rheem%2C+HJ+Cooper%2C+Superheat+%2C+multi+maschinery+';
var metaContents  = '';
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();
};
