/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','552',jdecode('Our+Services'),jdecode(''), jdecode('%2F552.html'), 'true',[],'',''],
	['PAGE','573',jdecode('Contact+Us'),jdecode(''), jdecode('%2F573%2Findex.html'), 'true',[ 
		['PAGE','6101',jdecode('Contact+%28follow+up+page%29'),jdecode(''), jdecode('%2F573%2F6101.html'), 'false',[],'','']
	],'','']];
var siteelementCount=4;
theSitetree.topTemplateName='Fluent';
theSitetree.paletteFamily='4971AD';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10363';
theSitetree.graphicsetId='10523';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'wl_enom',
  product: 'WSCENOSSSLYTC21A'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Fluent',
				paletteFamily: 	'4971AD',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10363',
				graphicsetId: 	'10523',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'A4A5A4',
				e_color: 		'4971AD',
				f_color: 		'26487C',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100319-205625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100412-010054'
};
webappMappings['7008']=webappMappings['7008-1746']={
webappId:    '7008',
documentId:  '573',
internalId:  '1746',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20090906-172718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20060726-052559'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN020INERA6';
var companyName   = 'Melbourne+Caravan+Repairs';
var htmlTitle	  = 'Melbourne+Caravan+Repairs+-+Repairs%2C+Modifications+and+Servicing+Most+Makes+and+Models+of+Caravans%2C+Poptops+and+Campers%2C+Based+in+Victoria+-+Insurance+Repairs';
var metaKeywords  = 'Melbourne+Caravan+Repairs%2C+caravan%2C+rv%2C+pop+top%2C+poptop%2C+pop-top%2C+camper%2C+campervan%2C+van%2C+motorhome%2C+5th+wheeler%2C+modifications%2C+melbourne%2C+victoria%2C+australia%2C+camec%2C+arrid%2C+solar%2C+battery%2C+servicing%2C+awning%2C+fiesta%2C+carefree%2C+dometic%2C+electrolux%2C+blue%2C+seas+waeco%2C+vitrifrigo%2C+east%2C+west%2C+south%2C+north%2C+sunshine%2C+coromal%2C+jayco%2C+springvale%2C+decals%2C+stickers%2C+decallage%2C+pinstripe%2C+pinstriping%2C+pin+stripes%2C+stripes';
var metaContents  = 'We+are+specialists+in+caravan+insurance+repairs+and+servicing+with+over+70%25+of+our+insurance+work+coming+from+major+insurers+including+CIL%2C+AAMI%2C+NRMA%2C+RACV%2C+MHIA%2C+Allianz%2C+APIA%2C+Suncorp%2C+QBE%2C+HBA+and+many+more.Coromal%2C+Jayco%2C+Royal+Flair%2C+Supreme%2C+Golf%2C+Windsor%2C+Viscount%2C+All+makes+and+models+including+Millard%2C+Majestic%2C+Paramount%2C+Goldstream%2C+Baroma%2C+Billabong%2C+Compass%2C+Concept%2C+Golden+Eagle%2C+Nova%2C+Pheonix%2C+Roadstar%2C+Roma%2C+Traveller+and+many+many+more.We+are+also+warranty+agents+for+Coromal+Caravans+and+a+stockist+of+Coromal+parts+including+cladding%2C+decals+%28stickers+and+pinstripes%29+and+general+consumables+%28Waeco%2C+Camec%2C+Arrid%29.';
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();
};

