/* [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','75',jdecode('Home'),jdecode(''),'/75.html','true',[],'',''],
	['PAGE','3432',jdecode('Residential+Listings+'),jdecode(''),'/3432/index.html','true',[ 
		['PAGE','3511',jdecode('%2456%2C900-%2489%2C000'),jdecode(''),'/3432/3511.html','true',[],'',''],
		['PAGE','3520',jdecode('%2499%2C900-%24199%2C900'),jdecode(''),'/3432/3520.html','true',[],'',''],
		['PAGE','3529',jdecode('%24210%2C000-%24499%2C900'),jdecode(''),'/3432/3529.html','true',[],'','']
	],'',''],
	['PAGE','39301',jdecode('Request+More+Info'),jdecode(''),'/39301.html','true',[],'',''],
	['PAGE','6797',jdecode('Multi-Family'),jdecode(''),'/6797.html','true',[],'',''],
	['PAGE','37801',jdecode('Land+%26+Lots'),jdecode(''),'/37801.html','true',[],'',''],
	['PAGE','4344',jdecode('Commercial+Listings'),jdecode(''),'/4344.html','true',[],'',''],
	['PAGE','1112',jdecode('Services'),jdecode(''),'/1112/index.html','true',[ 
		['PAGE','2728',jdecode('Selling+Your+Home+'),jdecode(''),'/1112/2728.html','true',[],'',''],
		['PAGE','7029',jdecode('Showcase+of+Homes+TV'),jdecode(''),'/1112/7029.html','true',[],'',''],
		['PAGE','5848',jdecode('Money+Back+Guarantee'),jdecode(''),'/1112/5848.html','true',[],'','']
	],'',''],
	['PAGE','1157',jdecode('Mortgage'),jdecode(''),'/1157.html','true',[],'',''],
	['PAGE','2879',jdecode('Insurance'),jdecode(''),'/2879.html','true',[],'',''],
	['PAGE','2229',jdecode('Sales+Associates'),jdecode(''),'/2229.html','true',[],'',''],
	['PAGE','1096',jdecode('How+to+find+us'),jdecode(''),'/1096.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='766455';
theSitetree.keyvisualId='1267';
theSitetree.keyvisualName='alte_moebel.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='235';
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: 			'Profile',
				paletteFamily: 	'766455',
				keyvisualId: 	'1267',
				keyvisualName: 	'alte_moebel.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'235',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'766455',
				b_color: 		'52443C',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '1096',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '75',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75',
internalId:  '',
customField: '20100428-115417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3432',
internalId:  '',
customField: '20100611-124820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3511',
internalId:  '',
customField: '20100611-125815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3520',
internalId:  '',
customField: '20100611-130458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3529',
internalId:  '',
customField: '20100611-131711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4344',
internalId:  '',
customField: '20091009-105928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6797',
internalId:  '',
customField: '20090519-152143'
};
webappMappings['7008']=webappMappings['7008-1867']={
webappId:    '7008',
documentId:  '39301',
internalId:  '1867',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1112',
internalId:  '',
customField: '20090131-134428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2728',
internalId:  '',
customField: '20080522-135533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7029',
internalId:  '',
customField: '20080602-191807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5848',
internalId:  '',
customField: '20080326-184402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2229',
internalId:  '',
customField: '20091009-103855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1157',
internalId:  '',
customField: '20090212-104723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2879',
internalId:  '',
customField: '20080307-042321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1096',
internalId:  '',
customField: '20080122-180119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37801',
internalId:  '',
customField: '20100129-134557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39301',
internalId:  '',
customField: '20090212-123205'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INXEKV';
var companyName   = 'ROSEWOOD++814-677-5895++814-827-8552';
var htmlTitle	  = 'Howard+Hanna+Rosewood+Real+Estate%2C+Seneca+%26+Titusville%2CVenango+County%2C+PA%2C+USA';
var metaKeywords  = 'Venango+County+Real+Estate%2C+Cranberry%2C+Clarion%2C+Oil+City%2C+Titusville%2C+Seneca%2C+Franklin%2C+PA%2C+Brokerage%2C+Realtor%2C+Real+Estate%2C+MLS%2C+Selling%2C+Buying%2C+Residential%2C+Investment%2C+Riverfront%2C+Homes%2C+Land%2C+Commercial%2C+Property%2C+Land%2C+Lots';
var metaContents  = 'Venango+County+Real+Estate%2C+Venango+%28PA%29%2C+Cranberry+%28PA%29%2C+Clarion+%28PA%29%2C+Oil+City+%28PA%29%2C+Titusville+%28PA%29%2C+Seneca+%28PA%29%2C+Franklin+%28PA%29%2C+Brokerage%2C+Realtor%2C+MLS%2C+Selling%2C+Buying%2C+Investment%2C+Riverfront%2C++Homes%2C+Land%2C+Commercial%2C+Property%2C+Land%2C+Lots';
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();
};
