/* [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','901',jdecode('Home'),jdecode(''), jdecode('%2F901%2Findex.html'), 'true',[ 
		['PAGE','11522',jdecode('Francais'),jdecode(''), jdecode('%2F901%2F11522.html'), 'true',[],'',''],
		['PAGE','11543',jdecode('Espanol'),jdecode(''), jdecode('%2F901%2F11543.html'), 'true',[],'',''],
		['PAGE','11901',jdecode('Deutsch'),jdecode(''), jdecode('%2F901%2F11901.html'), 'true',[],'','']
	],'',''],
	['PAGE','973',jdecode('Contact+%26+Subway'),jdecode(''), jdecode('%2F973.html'), 'true',[],'',''],
	['PAGE','31301',jdecode('Guest+Reviews'),jdecode(''), jdecode('%2F31301.html'), 'true',[],'',''],
	['PAGE','16301',jdecode('Guest+Photos'),jdecode(''), jdecode('%2F16301.html'), 'true',[],'',''],
	['PAGE','11564',jdecode('Links'),jdecode(''), jdecode('%2F11564%2Findex.html'), 'true',[ 
		['PAGE','17322',jdecode('Sights'),jdecode(''), jdecode('%2F11564%2F17322.html'), 'true',[],'',''],
		['PAGE','28101',jdecode('Restaurants'),jdecode(''), jdecode('%2F11564%2F28101.html'), 'true',[],'',''],
		['PAGE','17364',jdecode('Food'),jdecode(''), jdecode('%2F11564%2F17364.html'), 'true',[],'',''],
		['PAGE','28122',jdecode('Shopping'),jdecode(''), jdecode('%2F11564%2F28122.html'), 'true',[],'',''],
		['PAGE','18101',jdecode('Flea+Markets'),jdecode(''), jdecode('%2F11564%2F18101.html'), 'true',[],'',''],
		['PAGE','18122',jdecode('Music'),jdecode(''), jdecode('%2F11564%2F18122.html'), 'true',[],'',''],
		['PAGE','18701',jdecode('Film'),jdecode(''), jdecode('%2F11564%2F18701.html'), 'true',[],'',''],
		['PAGE','18722',jdecode('Books'),jdecode(''), jdecode('%2F11564%2F18722.html'), 'true',[],'',''],
		['PAGE','17343',jdecode('Lesbian'),jdecode(''), jdecode('%2F11564%2F17343.html'), 'true',[],'',''],
		['PAGE','35701',jdecode('Gay'),jdecode(''), jdecode('%2F11564%2F35701.html'), 'true',[],'',''],
		['PAGE','18743',jdecode('Guides'),jdecode(''), jdecode('%2F11564%2F18743.html'), 'true',[],'','']
	],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Picture';
theSitetree.paletteFamily='F6EEDE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10727';
theSitetree.graphicsetId='10751';
theSitetree.contentColor='4D3B17';
theSitetree.contentBGColor='F6EEDE';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'wl_enom',
  product: 'WSCENOSSSLYTC21T'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Picture',
				paletteFamily: 	'F6EEDE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10727',
				graphicsetId: 	'10751',
				contentColor: 	'4D3B17',
				contentBGColor: 'F6EEDE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20080401-044053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11522',
internalId:  '',
customField: '20100323-084443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11543',
internalId:  '',
customField: '20061024-120435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20061105-081119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20110221-092103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31301',
internalId:  '',
customField: '20070207-122912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16301',
internalId:  '',
customField: '20070331-082102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11564',
internalId:  '',
customField: '20100315-083329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17322',
internalId:  '',
customField: '20100312-162748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28101',
internalId:  '',
customField: '20100322-113115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17364',
internalId:  '',
customField: '20100322-113405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28122',
internalId:  '',
customField: '20070207-124730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20100313-064000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18122',
internalId:  '',
customField: '20080922-204511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20100313-184548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18722',
internalId:  '',
customField: '20070207-130146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17343',
internalId:  '',
customField: '20100312-161258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35701',
internalId:  '',
customField: '20070424-131447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18743',
internalId:  '',
customField: '20100322-113648'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN020INE0IW';
var companyName   = 'NYC+Bed+%26+Breakfast';
var htmlTitle	  = 'NYC+Bed++Breakfast';
var metaKeywords  = 'NYC+Bed+and+breakfast%2C+NYC+Hotels%2C+NYC+accomodations%2C++NYC+hostels%2C++NYC+travel%2C+Euro+travel%2C+New+York+Hotels%2C+New+York+NY%2C+hotel%2C+hotels%2C+hostel%2C+bed+and+breakfast%2C+room%2C+rooms%2C+Jersey+City%2C+NJ%2C+rent%2C+sublet%2C+cheap+rooms%2C+motel%2C+motels%2C+room+for+rent%2C++NYC+Francais%2C+NYC+French%2C+NYC+Deutsch%2C+NYC+German%2C+NYC+business+traveler';
var metaContents  = 'NYC+Bed+and+breakfast%2C+NYC+Hotels%2C+NYC+accomodations%2C++NYC+hostels%2C++NYC+travel%2C+Euro+travel%2C+New+York+Hotels%2C+New+York+NY%2C+hotel%2C+hotels%2C+hostel%2C+bed+and+breakfast%2C+room%2C+rooms%2C+Jersey+City%2C+NJ%2C+rent%2C+sublet%2C+cheap+rooms%2C+motel%2C+motels%2C+room+for+rent%2C+NYC+Francais%2C+NYC+French%2C+NYC+Deutsch%2C+NYC+German%2C+NYC+business+traveler';
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();
};

