/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','5101',jdecode('What+We+Offer'),jdecode(''),'/5101.html','true',[],'',''],
	['PAGE','5143',jdecode('Specialties'),jdecode(''),'/5143/index.html','true',[ 
		['PAGE','5164',jdecode('Rigging'),jdecode(''),'/5143/5164.html','true',[],'',''],
		['PAGE','5185',jdecode('Scaffolding'),jdecode(''),'/5143/5185.html','true',[],'',''],
		['PAGE','11601',jdecode('Steel+Erection'),jdecode(''),'/5143/11601.html','true',[],'',''],
		['PAGE','26101',jdecode('Equiptment+Hire'),jdecode(''),'/5143/26101.html','true',[],'','']
	],'',''],
	['PAGE','37301',jdecode('Clients+and+Projects+1'),jdecode(''),'/37301.html','true',[],'',''],
	['PAGE','5248',jdecode('Clients+and+Projects+2'),jdecode(''),'/5248.html','true',[],'',''],
	['PAGE','5332',jdecode('Clients+and+Projects+3'),jdecode(''),'/5332.html','true',[],'',''],
	['PAGE','5311',jdecode('How+to+find+us'),jdecode(''),'/5311/index.html','true',[ 
		['PAGE','5269',jdecode('Email+Us'),jdecode(''),'/5311/5269.html','true',[],'','']
	],'',''],
	['PAGE','10301',jdecode('Employment+'),jdecode(''),'/10301.html','true',[],'',''],
	['PAGE','5206',jdecode('Steel+Fabrication'),jdecode(''),'/5206.html','true',[],'',''],
	['PAGE','41701',jdecode('ISS+Photo+Gallery'),jdecode(''),'/41701.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='336699';
theSitetree.keyvisualId='1270';
theSitetree.keyvisualName='cd_stapel.jpg';
theSitetree.fontsetId='192';
theSitetree.graphicsetId='230';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Profile',
				paletteFamily: 	'336699',
				keyvisualId: 	'1270',
				keyvisualName: 	'cd_stapel.jpg',
				fontsetId: 		'192',
				graphicsetId: 	'230',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'336699',
				b_color: 		'336699',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20080611-010552'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-75505805053dcad62d3334af87a5f0ab']={
webappId:    '7060',
documentId:  '41701',
internalId:  '75505805053dcad62d3334af87a5f0ab',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-7950']={
webappId:    '7008',
documentId:  '5269',
internalId:  '7950',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20080609-175150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5143',
internalId:  '',
customField: '20080609-165623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5164',
internalId:  '',
customField: '20080611-143842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5185',
internalId:  '',
customField: '20080609-170529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20080812-175256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26101',
internalId:  '',
customField: '20070218-144159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37301',
internalId:  '',
customField: '20080611-013220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5248',
internalId:  '',
customField: '20080610-024819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5332',
internalId:  '',
customField: '20080611-153249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5311',
internalId:  '',
customField: '20091010-182431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5269',
internalId:  '',
customField: '20070131-040456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20080604-200831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5206',
internalId:  '',
customField: '20080609-030349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41701',
internalId:  '',
customField: '20080608-201826'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INE9AA';
var companyName   = 'Industrial+Site+Services+Co+Ltd';
var htmlTitle	  = 'Industrial+Site+Services+Co+Ltd++-+Constructing+New+Zealand';
var metaKeywords  = 'Rigging%2C+Scaffolding%2C+Steel+Erection%2C+Engineering%2C+Construction%2C+Cranage%2C+Air+Skates%2C+Heavy+Lifts%2C+Plant+Installation%2C+Heavy+transport%2C+Equipment+Hire%2C+iss%2C+mechanical+rigging%2C+industrial+abseiling%2C+rigger+training%2C+welding%2C+labour+hire%2C+industrial+rope+access';
var metaContents  = 'Rigging%2C+Scaffolding+and+Steel+Erection+Specialists.++ISS+have+experienced+crews+specialising+in+Rigging%2C+Steel+Erection%2C+Scaffold+Hire+and+Erection%2C+Industrial+Rope+Access%2C+General+Engineering+and+all+the+various+other+construction+needs.';
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();
};
