/* [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(''),'/501.html','true',[],'',''],
	['PAGE','20626',jdecode('AUCTION+SCHEDULE'),jdecode(''),'/20626/index.html','true',[ 
		['PAGE','25301',jdecode('Personal+Property'),jdecode(''),'/20626/25301.html','true',[],'',''],
		['PAGE','25322',jdecode('Real+Estate'),jdecode(''),'/20626/25322.html','true',[],'','']
	],'',''],
	['PAGE','615',jdecode('Steve%26%23x27%3Bs+Bio'),jdecode(''),'/615.html','true',[],'',''],
	['PAGE','594',jdecode('Steve%26%23x27%3Bs+Blog'),jdecode(''),'/594.html','true',[],'',''],
	['PAGE','21019',jdecode('RE+Auction+School'),jdecode(''),'/21019.html','true',[],'',''],
	['PAGE','21057',jdecode('Auction+Photos'),jdecode(''),'/21057.html','true',[],'',''],
	['PAGE','21906',jdecode('Auction+Myths'),jdecode(''),'/21906.html','true',[],'',''],
	['PAGE','21028',jdecode('Auction+Tips'),jdecode(''),'/21028.html','true',[],'',''],
	['PAGE','21983',jdecode('Auction+Glossary+A-Z'),jdecode(''),'/21983.html','true',[],'',''],
	['PAGE','636',jdecode('Contact+Us'),jdecode(''),'/636.html','true',[],'',''],
	['PAGE','657',jdecode('Links'),jdecode(''),'/657.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Kalkutta';
theSitetree.paletteFamily='AC9662';
theSitetree.keyvisualId='6195';
theSitetree.keyvisualName='kv_6195.jpg';
theSitetree.fontsetId='11141';
theSitetree.graphicsetId='11951';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='DACC9B';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Kalkutta',
				paletteFamily: 	'AC9662',
				keyvisualId: 	'6195',
				keyvisualName: 	'kv_6195.jpg',
				fontsetId: 		'11141',
				graphicsetId: 	'11951',
				contentColor: 	'000000',
				contentBGColor: 'DACC9B',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100510-114053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20100510-123110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25301',
internalId:  '',
customField: '20100510-113345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20626',
internalId:  '',
customField: '20100510-113852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20090817-115004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20100510-101653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20090215-180241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21983',
internalId:  '',
customField: '20090817-135716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21906',
internalId:  '',
customField: '20090817-125230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21028',
internalId:  '',
customField: '20090817-131407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21057',
internalId:  '',
customField: '20090817-122910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21019',
internalId:  '',
customField: '20090817-115126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25322',
internalId:  '',
customField: '20100510-141351'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INE2IE';
var companyName   = 'Steve+Van+Gordon+Company%2C+LLC';
var htmlTitle	  = 'Steve+Van+Gordon+Auctioneer';
var metaKeywords  = 'auction%2C+auctioneer%2C+foreclosure%2C+business+liquidation%2C+real+estate+auction%2C+heavy+equipment%2C+farm+auction%2C+personal+property';
var metaContents  = 'Canby%2C+Oregon+auction+company+conducting+auctions+since+1979+for+personal+property%2C+business+liquidations%2C+commercial+real+estate%2C+personal+real+estate%2C+farm+auctions%2C+heavy+equipment%2C+and+much+more%21';
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();
};

