/* [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','1301',jdecode('Home'),jdecode(''),'/1301.html','true',[],'',''],
	['PAGE','38512',jdecode('Search+MLS+Now%21'),jdecode(''),'/38512.html','true',[],'',''],
	['PAGE','4222',jdecode('My+Listings'),jdecode(''),'/4222.html','true',[],'',''],
	['PAGE','4822',jdecode('Buyers'),jdecode(''),'/4822/index.html','true',[ 
		['PAGE','29960',jdecode('Buyer+FAQs'),jdecode(''),'/4822/29960.html','true',[],'',''],
		['PAGE','4843',jdecode('Mortgage+Calculator'),jdecode(''),'/4822/4843.html','true',[],'',''],
		['PAGE','4864',jdecode('Referrals'),jdecode(''),'/4822/4864/index.html','true',[ 
			['PAGE','9001',jdecode('Referrals+%28follow+up+page%29'),jdecode(''),'/4822/4864/9001.html','false',[],'','']
		],'','']
	],'',''],
	['PAGE','4906',jdecode('Sellers'),jdecode(''),'/4906/index.html','true',[ 
		['PAGE','4927',jdecode('Helpful+Tips'),jdecode(''),'/4906/4927.html','true',[],'',''],
		['PAGE','4948',jdecode('Referrals'),jdecode(''),'/4906/4948/index.html','true',[ 
			['PAGE','10301',jdecode('Referrals+%28follow+up+page%29'),jdecode(''),'/4906/4948/10301.html','false',[],'','']
		],'','']
	],'',''],
	['PAGE','25501',jdecode('Area+School+Search'),jdecode(''),'/25501.html','true',[],'',''],
	['PAGE','17701',jdecode('Contact'),jdecode(''),'/17701.html','true',[],'',''],
	['PAGE','38554',jdecode('Testimonials'),jdecode(''),'/38554.html','true',[],'',''],
	['PAGE','4306',jdecode('City+Tour'),jdecode(''),'/4306.html','true',[],'',''],
	['PAGE','4348',jdecode('Photo+Album'),jdecode(''),'/4348.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
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: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-12503']={
webappId:    '1501',
documentId:  '1301',
internalId:  '12503',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '17701',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1301',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-7734']={
webappId:    '7008',
documentId:  '4864',
internalId:  '7734',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-7735']={
webappId:    '7008',
documentId:  '4948',
internalId:  '7735',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1301',
internalId:  '',
customField: '20100916-185212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4222',
internalId:  '',
customField: '20101008-145808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20100914-023856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38512',
internalId:  '',
customField: '20100916-005154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38554',
internalId:  '',
customField: '20100914-014426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4822',
internalId:  '',
customField: '20100914-024007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4843',
internalId:  '',
customField: '20100914-010505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4864',
internalId:  '',
customField: '20100911-045256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20071214-014719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4906',
internalId:  '',
customField: '20100822-023707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4927',
internalId:  '',
customField: '20100822-023721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4948',
internalId:  '',
customField: '20100911-045308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20071214-022824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20100822-023824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4306',
internalId:  '',
customField: '20100822-023647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4348',
internalId:  '',
customField: '20100822-023441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29960',
internalId:  '',
customField: '20100911-035053'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INXSUU';
var companyName   = 'Matthew+Patterson+-+REALTOR%C2%AE';
var htmlTitle	  = 'Matt+Patterson+-+Your+Arizona+REALTOR%C2%AE%21++Prudential+Arizona+Properties+-+Scottsdale';
var metaKeywords  = 'Arizona+Realtor%2C+AZ%2C+Relo%2C+Relocation%2C+GMAC%2C+Scottsdale%2C+Phoenix%2C+Mesa%2C+Gilbert%2C+Glendale%2C+Anthem%2C+Peoria%2C+Cave+Creek%2C+Carefree%2C+JOBS%2C+luxury%2C+golf%2C+best%2C+patterson%2C+matt+patterson%2C+property%2C+Chicago%2C+Canada%2C+Toronto%2C+Victoria%2C+fantastic%2C+barrett+jackson%2C+cars%2C+premiere%2C+property%2C+spec+homes%2C+home%2C+staging%2C+tramonto%2C+sonoran+foothills%2C+Prudential%2C+Family+First%2C+friendly%2C+Prudential%2C+Scottsdale%2C+Fountain+Hills%2C+Matthew+Scott+Patterson%2C+Gore%2C+Honeywell%2C+Ford%2C+Medicis%2C+Lincoln+Medical+Center%2C+Sonoran+Foothills%2C+Gore';
var metaContents  = 'Arizona+Realtor%2C+AZ%2C+Relo%2C+Relocation%2C+GMAC%2C+Scottsdale%2C+Phoenix%2C+Mesa%2C+Gilbert%2C+Glendale%2C+Anthem%2C+Peoria%2C+Cave+Creek%2C+Carefree%2C+JOBS%2C+luxury%2C+golf%2C+best%2C+patterson%2C+matt+patterson%2C+property%2C+Chicago%2C+Canada%2C+Toronto%2C+Victoria%2C+fantastic%2C+barrett+jackson%2C+cars%2C+premiere%2C+property%2C+spec+homes%2C+home%2C+staging%2C+tramonto%2C+sonoran+foothills%2C+Prudential%2C+Family+First%2C+friendly%2C+Prudential%2C+Scottsdale%2C+Fountain+Hills%2C+Matthew+Scott+Patterson%2C+Gore%2C+Honeywell%2C+Ford%2C+Medicis%2C+Lincoln+Medical+Center%2C+Sonoran+Foothills%2C+Gore';
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();
};

