/* [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','801',jdecode('HOME'),jdecode(''),'/801.html','true',[],'',''],
	['PAGE','430364',jdecode('UPCOMING+SALES'),jdecode(''),'/430364.html','true',[],'',''],
	['PAGE','768472',jdecode('Roslyn+Frid+Mar+12'),jdecode(''),'/768472.html','true',[],'',''],
	['PAGE','763472',jdecode('New+Hyde+Pk+Sat+Mar13th+'),jdecode(''),'/763472.html','true',[],'',''],
	['PAGE','275201',jdecode('ITEMS+FOR+SALE+1'),jdecode(''),'/275201.html','true',[],'',''],
	['PAGE','723161',jdecode('ITEMS+FOR+SALE+2'),jdecode(''),'/723161.html','false',[],'',''],
	['PAGE','677501',jdecode('SAMPLE+OF+PRIOR+SALE'),jdecode(''),'/677501.html','true',[],'',''],
	['PAGE','572701',jdecode('SAMPLE+OF+PRIOR+SALE'),jdecode(''),'/572701.html','true',[],'',''],
	['PAGE','572722',jdecode('SAMPLE+OF+PRIOR+SALE'),jdecode(''),'/572722.html','true',[],'',''],
	['PAGE','7001',jdecode('JOIN+OUR+EMAIL+LIST'),jdecode(''),'/7001.html','true',[],'',''],
	['PAGE','999',jdecode('CONTACT'),jdecode(''),'/999/index.html','true',[ 
		['PAGE','5501',jdecode('Contact+%28follow+up+page%29'),jdecode(''),'/999/5501.html','false',[],'','']
	],'',''],
	['PAGE','11801',jdecode('WHY+CHOOSE+US%3F'),jdecode(''),'/11801.html','true',[],'',''],
	['PAGE','48601',jdecode('TAG+SALE+PHOTOS'),jdecode(''),'/48601.html','true',[],'',''],
	['PAGE','11401',jdecode('TESTIMONIALS'),jdecode(''),'/11401.html','true',[],'',''],
	['PAGE','610343',jdecode('SENIOR+RESOURCES'),jdecode(''),'/610343.html','true',[],'',''],
	['PAGE','92001',jdecode('LOST+%26+FOUND+'),jdecode(''),'/92001.html','true',[],'',''],
	['PAGE','7022',jdecode('INTERESTING+LINKS'),jdecode(''),'/7022.html','true',[],'',''],
	['PAGE','609401',jdecode('MADELINE%26%23x27%3BS+BLOG'),jdecode(''),'/609401.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Sonnemond';
theSitetree.paletteFamily='D7F7FC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10759';
theSitetree.graphicsetId='10814';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='D7F7FC';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sonnemond',
				paletteFamily: 	'D7F7FC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10759',
				graphicsetId: 	'10814',
				contentColor: 	'000000',
				contentBGColor: 'D7F7FC',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'5C5898',
				e_color: 		'ED4747',
				f_color: 		'437D3B',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '610343',
internalId:  '',
customField: '20090929-045947'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-4533081']={
webappId:    '1501',
documentId:  '801',
internalId:  '4533081',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '999',
internalId:  '',
customField: '20080326-173157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20100226-111421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '609401',
internalId:  '',
customField: '20100305-181556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20060629-083003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '430364',
internalId:  '',
customField: '20100309-061853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20061011-214822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '275201',
internalId:  '',
customField: '20100224-210806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20090724-193027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48601',
internalId:  '',
customField: '20100304-191851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20090914-183155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92001',
internalId:  '',
customField: '20081022-222700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7022',
internalId:  '',
customField: '20100304-192210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '677501',
internalId:  '',
customField: '20100304-191405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '572701',
internalId:  '',
customField: '20090624-230455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '572722',
internalId:  '',
customField: '20090625-085134'
};
webappMappings['7008']=webappMappings['7008-591']={
webappId:    '7008',
documentId:  '999',
internalId:  '591',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '723161',
internalId:  '',
customField: '20100126-174625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '768472',
internalId:  '',
customField: '20100309-064346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '763472',
internalId:  '',
customField: '20100309-210615'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN020INENLY';
var companyName   = 'How+Can+We+Help+You%3F';
var htmlTitle	  = 'FULL+OF+SURPRIZES+TAG+SALES+%7C+MOVING+SALES+%7C+TAG+SALES%7C+ESTATE+SALES%7C+LIQUIDATIONS+%7C+MOVING+SALES+NEW+YORK+%7CTAG+SALES+LONG+ISLAND+%7C+ESTATE+SALES+LONG+ISLAND+%7C+TAG+SALES++CLEANOUT+PROS+%7C+TAG+SALES+LONG+ISLAND+%7C+ESTATE+SALES+LONG+ISLAND+%7C+ESTATE+SALES+NY%7C+M';
var metaKeywords  = 'LONG+ISLAND+TAG+SALES%2CESTATE+SALE%2CLONG+ISLAND+ESTATE+SALES%2CLONG+ISLAND+MOVING+SALES%2CFULLOFSURPRISES%2CFULLOFSURPRIZES%2CANTIQUES+DEALERS%2CMOVING+SALE%2CCONTENTS+OF+HOME%2CNASSAU+COUNTY+MOVING+SALE%2CNASSAU+COUNTY+NY%2CSUFFOLK+COUNTY+MOVING+SALE%2CSUFFOLK+COUNTY+ESTATE%2C+SALE%2CMOVING+SALES+LONG+ISLAND+NY%2C+LIQUIDATION%2C+LIQUIDATOR%2C+CLEANOUTS%2C+CLEAN-OUTS%2C+ESTATE+CLEANOUT+LONG+ISLAND';
var metaContents  = 'Long+Island+Tag+Sale%2C+Moving+Sale++Estate+Sale+Services.+Let+us+help+you+sell+your+furnishings+and+home+contents%21+We+do+everything+to+prepare%2C+promote+and+handle+your+sale+with+sensitivity+and+respect+to+your+needs.+We+will+advise+you+on+the+value+of+the+items+you+want+to+sell+and+will+research+to+obtain+the+best+value+for+you%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();
};
