/* [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 theSitetree=[ 
	['PAGE','6001',jdecode('Real+Estate+Wholesale+King'),jdecode(''),'/6001.html','true',[],''],
	['PAGE','6301',jdecode('Turn+Key+Properties'),jdecode(''),'/6301.html','true',[],''],
	['PAGE','13523',jdecode('Complete+Care+KC'),jdecode(''),'/13523/index.html','true',[ 
		['PAGE','18923',jdecode('Property+Management'),jdecode(''),'/13523/18923.html','true',[],''],
		['PAGE','28023',jdecode('Property+Rehab%26%23x27%3Bs'),jdecode(''),'/13523/28023.html','true',[],'']
	],''],
	['PAGE','6136',jdecode('Mentorship'),jdecode(''),'/6136.html','true',[],''],
	['PAGE','6157',jdecode('Property+Request'),jdecode(''),'/6157.html','true',[],''],
	['PAGE','28523',jdecode('Sell+Us+Your+House'),jdecode(''),'/28523.html','true',[],''],
	['PAGE','22423',jdecode('Private+Funding+'),jdecode(''),'/22423.html','true',[],''],
	['PAGE','15623',jdecode('Testimonials'),jdecode(''),'/15623.html','true',[],''],
	['PAGE','6073',jdecode('Contact+Us'),jdecode(''),'/6073.html','true',[],'']];
var siteelementCount=11;
theSitetree.topTemplateName='Georgia';
theSitetree.paletteFamily='6080D3';
theSitetree.keyvisualId='5979';
theSitetree.keyvisualName='kv_5979.jpg';
theSitetree.fontsetId='11121';
theSitetree.graphicsetId='12923';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='6080D3';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Georgia',
				paletteFamily: 	'6080D3',
				keyvisualId: 	'5979',
				keyvisualName: 	'kv_5979.jpg',
				fontsetId: 		'11121',
				graphicsetId: 	'12923',
				contentColor: 	'FFFFFF',
				contentBGColor: '6080D3',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-1356']={
webappId:    '7008',
documentId:  '6157',
internalId:  '1356',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20100218-162658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15623',
internalId:  '',
customField: '20091229-133133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20091229-132948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6136',
internalId:  '',
customField: '20091229-132819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6157',
internalId:  '',
customField: '20091229-133014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13523',
internalId:  '',
customField: '20091229-132833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28523',
internalId:  '',
customField: '20100218-162416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6073',
internalId:  '',
customField: '20100128-140812'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6001',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-25387']={
webappId:    '7008',
documentId:  '22423',
internalId:  '25387',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-12038']={
webappId:    '7008',
documentId:  '28523',
internalId:  '12038',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18923',
internalId:  '',
customField: '20091229-132910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28023',
internalId:  '',
customField: '20090518-120254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22423',
internalId:  '',
customField: '20100128-140700'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2Q1M';
var companyName   = 'Real+Estate+Wholesale+King';
var htmlTitle	  = 'Real+Estate+Wholesale+King';
var metaKeywords  = 'Real+Estate%2C+Investors%2C+Wholesale%2C+Nationwide%2C+Single+Family%2C+Multifamily%2C+Apartments%2C+Amstar%2C+Rental+Units%2C+Cashflow%2C+Turn+Key%2C+Mentor%2C+Investor%2C+Kansas+City%2C+Missouri%2C+Testimonials%2C+Funding%2C+Testomonials%2C+Properties%2CPictures';
var metaContents  = 'Leading+edge+company+in+Real+Estate+deals+nationwide.+We+specialize+in+wholesale+properties%2C+and+Turn+Key+properties.+';
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();
};
