/* [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','21601',jdecode('Home'),jdecode(''),'/21601.html','true',[],'',''],
	['PAGE','21652',jdecode('Products+%26+Services'),jdecode(''),'/21652.html','true',[],'',''],
	['PAGE','21673',jdecode('Contact+Us'),jdecode(''),'/21673.html','true',[],'','']];
var siteelementCount=3;
theSitetree.topTemplateName='Office';
theSitetree.paletteFamily='727D9C';
theSitetree.keyvisualId='11165';
theSitetree.keyvisualName='kv_11165.jpg';
theSitetree.fontsetId='32062';
theSitetree.graphicsetId='13879';
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: 			'Office',
				paletteFamily: 	'727D9C',
				keyvisualId: 	'11165',
				keyvisualName: 	'kv_11165.jpg',
				fontsetId: 		'32062',
				graphicsetId: 	'13879',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21601',
internalId:  '',
customField: '20100812-022612'
};
webappMappings['7008']=webappMappings['7008-3738']={
webappId:    '7008',
documentId:  '21673',
internalId:  '3738',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21652',
internalId:  '',
customField: '20100809-185249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21673',
internalId:  '',
customField: '20100727-190614'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '21601',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '21652',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '21673',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '21601',
internalId:  '1006',
customField: '1006'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '21652',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['8010']=webappMappings['8010-203']={
webappId:    '8010',
documentId:  '21601',
internalId:  '203',
customField: 'language:en;country:US;'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN340INFVG7';
var companyName   = 'Great+Southern+Floors+-+Custom+Floor+Installations';
var htmlTitle	  = 'Great+Southern+Floors+-+Your+Local+Timber+Floor+Expert+in+Port+Stephens%2C+a+supplier+and+installer+of+timber+floor+products%2C+including+solid+timber%2C+engineered+and+laminate+floors.';
var metaKeywords  = 'timber%2C+floor%2C+laminate%2C+engineered%2C+floating%2C+underlay%2C+flooring%2C+install%2C+installation%2C+floor+sanding+and+polishing%2C+floor+sanding+and+polishing+environmently+friendly%2C+floor+sanding+and+polishing+faq%2C+floor+noise+reduction%2C+wterbased+floor+coating%2C+solvent+based+floor+coating%2C+timber+floor+covering%2C+timber+flooring%2C+timber+floors%2C+timber+floorings%2C+timber+flooring+nelson+bay%2C+timber+floors+newcastle%2Csub+floor%2C+subfloor+prep%2C+salamander+bay%2C+port+stephens%2C+anna+bay%2C+raymond+terrace%2C+wood+floor+repair%2C+perfect+timber+floors%2C+timber+floor+restoration%2C+home+improvement%2C+home+renovation%2C+floating+floor+types%2C+sanding+timber+floors%2C+sealing+timber+floors%2C+non+toxic+floor+coating%2C+floating+floor+products%2C+bamboo+showroom%2C+bamboo+flooring%2C+discount+laminate+flooring%2C+cheap+flooring%2C+cheap+laminate%2C+quality+timber+flooring%2C+laminate+floor+installation%2C+floating+floor+prices%2C+lamiante+floor+cost%2C+laminate+floor+prices%2C+new+or+old%2C+carpet+removed%2C+carpet+removal%2C+floating%2C+direct+stick%2C+secret+nailed%2C+prefinished%2C+direct+stick%2C+ultraset%2C+p990%2C+sika%2C+selleys+direct+stick%2C+timber+floor+plans%2C+acrylic+floor+polish%2C+vinyl+plank%2C+vinyl+tiles%2C+boral+timber+flooring%2C+timber+flooring+cost%2C+how+to+install+laminate+floor%2C+advice%2C+non-toxic%2C+coverings%2C+great%2C+southern%2C+floors%2C+wood+floor%2C+sand+paper%2C+sanding+paper';
var metaContents  = 'Great+Southern+Floors+is+a+timber+floor+installation+and+supply+business.+The+services+include+supply+of+solid+timber+floors%2C+engineered+floors+and+laminate+floors.+We+also+recoat+and+refurbish+existing+timber+floors+in+all+sizes+from+domestic+single+rooms+to+commercial+floors%2C++as+well+as+general+purpose+halls+and+basketball+courts.+We+are+also+happy+to+discuss+flooring+options+with+no+obligation+to+buy.+We+supply+and+install+floating+floors%3B+either+engineered+floors+or+laminate+floors.';
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();
};

