/* [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','80923',jdecode('Home'),jdecode(''), jdecode('%2F80923.html'), 'true',[],'',''],
	['PAGE','82023',jdecode('About+us'),jdecode(''), jdecode('%2F82023%2Findex.html'), 'true',[ 
		['PAGE','82044',jdecode('Our+team'),jdecode(''), jdecode('%2F82023%2F82044.html'), 'true',[],'','']
	],'',''],
	['PAGE','82065',jdecode('Conveyancing+Quote'),jdecode(''), jdecode('%2F82065.html'), 'true',[],'',''],
	['PAGE','82123',jdecode('Conveyancing+Process'),jdecode(''), jdecode('%2F82123%2Findex.html'), 'true',[ 
		['PAGE','82144',jdecode('Buying'),jdecode(''), jdecode('%2F82123%2F82144.html'), 'true',[],'',''],
		['PAGE','82165',jdecode('Selling'),jdecode(''), jdecode('%2F82123%2F82165.html'), 'true',[],'','']
	],'',''],
	['PAGE','82186',jdecode('Conveyancing+FAQ'),jdecode(''), jdecode('%2F82186%2Findex.html'), 'true',[ 
		['PAGE','84223',jdecode('Common+Terms'),jdecode(''), jdecode('%2F82186%2F84223.html'), 'true',[],'','']
	],'',''],
	['PAGE','82207',jdecode('Investor+Information'),jdecode(''), jdecode('%2F82207%2Findex.html'), 'true',[ 
		['PAGE','82228',jdecode('Foreign+Investors'),jdecode(''), jdecode('%2F82207%2F82228.html'), 'true',[],'',''],
		['PAGE','82249',jdecode('Self-Managed+Super+Fund'),jdecode(''), jdecode('%2F82207%2F82249.html'), 'true',[],'',''],
		['PAGE','84623',jdecode('Events'),jdecode(''), jdecode('%2F82207%2F84623.html'), 'true',[],'','']
	],'',''],
	['PAGE','82270',jdecode('Agents+Corner'),jdecode(''), jdecode('%2F82270%2Findex.html'), 'true',[ 
		['PAGE','82291',jdecode('News'),jdecode(''), jdecode('%2F82270%2F82291.html'), 'true',[],'','']
	],'',''],
	['PAGE','82312',jdecode('Testimonials'),jdecode(''), jdecode('%2F82312.html'), 'true',[],'',''],
	['PAGE','82333',jdecode('Interesting+Links'),jdecode(''), jdecode('%2F82333.html'), 'true',[],'',''],
	['PAGE','82354',jdecode('Contact+Us'),jdecode(''), jdecode('%2F82354.html'), 'true',[],'',''],
	['PAGE','86023',jdecode('msl+Website'),jdecode(''), jdecode('%2F86023.html'), 'true',[],'',''],
	['PAGE','87123',jdecode('Disclaimer'),jdecode(''), jdecode('%2F87123.html'), 'false',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='F1AA13';
theSitetree.keyvisualId='9818';
theSitetree.keyvisualName='kv_9818.jpg';
theSitetree.fontsetId='17626';
theSitetree.graphicsetId='13034';
theSitetree.contentColor='646464';
theSitetree.contentBGColor='FFFFFF';
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: 			'Valiant',
				paletteFamily: 	'F1AA13',
				keyvisualId: 	'9818',
				keyvisualName: 	'kv_9818.jpg',
				fontsetId: 		'17626',
				graphicsetId: 	'13034',
				contentColor: 	'646464',
				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:  '80923',
internalId:  '',
customField: '20110825-213401'
};
webappMappings['7008']=webappMappings['7008-4599']={
webappId:    '7008',
documentId:  '82065',
internalId:  '4599',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-4600']={
webappId:    '7008',
documentId:  '82354',
internalId:  '4600',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82023',
internalId:  '',
customField: '20110503-222822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82044',
internalId:  '',
customField: '20110503-222909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82065',
internalId:  '',
customField: '20110502-230037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82123',
internalId:  '',
customField: '20110502-230503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82144',
internalId:  '',
customField: '20110502-231740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82165',
internalId:  '',
customField: '20110502-232359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82186',
internalId:  '',
customField: '20110502-233506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84223',
internalId:  '',
customField: '20110503-164409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82207',
internalId:  '',
customField: '20110503-164650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82228',
internalId:  '',
customField: '20110503-165204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84623',
internalId:  '',
customField: '20110503-193724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82249',
internalId:  '',
customField: '20110503-165646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82270',
internalId:  '',
customField: '20110503-193940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82291',
internalId:  '',
customField: '20120110-165233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82312',
internalId:  '',
customField: '20110503-221731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82333',
internalId:  '',
customField: '20110503-222019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82354',
internalId:  '',
customField: '20110503-222231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86023',
internalId:  '',
customField: '20110503-222524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87123',
internalId:  '',
customField: '20110825-214049'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN330INF7VT';
var companyName   = 'Conveyancing+Services+-+QLD+%26+NSW';
var htmlTitle	  = 'Conveyancing+Gold+Coast+%7C+Conveyancing+Brisbane+%7C+Conveyancing+Solicitors%7C+msl+michael+sing+lawyers';
var metaKeywords  = 'conveyancing%2C+conveyancing+solicitors%2C+conveyancing+gold+coast%2C+conveyancing+brisbane%2C+conveyancing+bundall%2C+conveyancingn%2C+convayancing%2C+purchasing+property+in+Australia%2C+using+your+super+to+buy+property%2C+property+purchase+with+super%2C+foreign+investment+in+Australia%2C';
var metaContents  = 'Brisbane+Conveyancing%2C+Gold+Coast+Conveyancing+and+NSW+Conveyancing+services+provided+by+msl+%7C+michael+sing+lawyers.+';
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();
};

