/* [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(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','652',jdecode('Accommodation'),jdecode(''), jdecode('%2F652.html'), 'true',[],'',''],
	['PAGE','19301',jdecode('Accommodation+Photos'),jdecode(''), jdecode('%2F19301.html'), 'true',[],'',''],
	['PAGE','673',jdecode('Sites'),jdecode(''), jdecode('%2F673.html'), 'true',[],'',''],
	['PAGE','19701',jdecode('site+photos'),jdecode(''), jdecode('%2F19701.html'), 'true',[],'',''],
	['PAGE','694',jdecode('Prices'),jdecode(''), jdecode('%2F694.html'), 'true',[],'',''],
	['PAGE','715',jdecode('Contact+Us'),jdecode(''), jdecode('%2F715.html'), 'true',[],'',''],
	['PAGE','736',jdecode('Things+to+see'),jdecode(''), jdecode('%2F736.html'), 'true',[],'',''],
	['PAGE','757',jdecode('Pilots'),jdecode(''), jdecode('%2F757.html'), 'true',[],'',''],
	['PAGE','778',jdecode('Flying+Training'),jdecode(''), jdecode('%2F778.html'), 'true',[],'',''],
	['PAGE','9406',jdecode('Guestbook'),jdecode(''), jdecode('%2F9406%2Findex.html'), 'true',[ 
		['PAGE','9401',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F9406%2F9401.html'), 'false',[],'','']
	],'',''],
	['PAGE','10501',jdecode('Glider+Pilot+Photos'),jdecode(''), jdecode('%2F10501.html'), 'true',[],'',''],
	['PAGE','11301',jdecode('SAAA'),jdecode(''), jdecode('%2F11301.html'), 'true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Beach';
theSitetree.paletteFamily='E7D794';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10565';
theSitetree.graphicsetId='10926';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E7C794';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'wl_enom',
  product: 'WSCENOSSSLYTC21T'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Beach',
				paletteFamily: 	'E7D794',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10565',
				graphicsetId: 	'10926',
				contentColor: 	'000000',
				contentBGColor: 'E7C794',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FF503F',
				e_color: 		'FF503F',
				f_color: 		'FF503F',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-9406aen010invuta']={
webappId:    '1002',
documentId:  '9406',
internalId:  '9406aen010invuta',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-bcc51432c94b15b438a8dba82b9949bf']={
webappId:    '7060',
documentId:  '10501',
internalId:  'bcc51432c94b15b438a8dba82b9949bf',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-112d44ba59c2b0ebe0f030a1f259ef11']={
webappId:    '7060',
documentId:  '19701',
internalId:  '112d44ba59c2b0ebe0f030a1f259ef11',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-7e53c8d766ffaaf59058edbcbe7b22f7']={
webappId:    '7060',
documentId:  '19301',
internalId:  '7e53c8d766ffaaf59058edbcbe7b22f7',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20111029-223833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20110818-221759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19301',
internalId:  '',
customField: '20110324-155107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20110818-224319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19701',
internalId:  '',
customField: '20080707-015455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20120102-171348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20091024-143333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20110818-220338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20120102-165203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '778',
internalId:  '',
customField: '20120102-172205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9406',
internalId:  '',
customField: '20071230-045943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20071230-045943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20080204-155819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20120102-141725'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INVUTA';
var companyName   = 'Narromine+Tourist+Park+%26+Motel';
var htmlTitle	  = 'www.narrominetouristpark.com.au';
var metaKeywords  = 'Narromine%2C+accomodation%2C+caravan+park%2C+caravan%2C+park+stay%2C+gliding%2C+caravaning%2C+camp%2C+flying%2C+ultralights%2C+aeroclub%2C+NSW%2C+tourist%2C+park%2C+natfly%2C+holiday%2C+airport%2C+aviation+museum%2C+visit%2C+aerodrome%2C+australia+gliding+centre%2C+wright+flyer%2C+mitchell+highway%2C+trangie+road%2C+newell+highway%2C+';
var metaContents  = 'Narromine+Caravan+park%2C+Narromine+tourist+park%2C+Narromine+accommodation%2C+Narromine+gliding%2C++camping+Narromine%2C+Narromine+tourist%2C+Aerodrome+Caravan+Park%2C+Narromine+Aerodrome%2C+parks+Narromine%2C+Rose+Garden+Caravan+Park%2C+newell+highway%2C';
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();
};

