/* [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','94',jdecode('Home'),jdecode(''),'/94.html','true',[],'',''],
	['PAGE','1416',jdecode('Property+Details'),jdecode(''),'/1416.html','true',[],'',''],
	['PAGE','2380',jdecode('Logistics'),jdecode(''),'/2380.html','true',[],'',''],
	['PAGE','1628',jdecode('Site+Plan'),jdecode(''),'/1628.html','true',[],'',''],
	['PAGE','1637',jdecode('Floor+Plan'),jdecode(''),'/1637.html','true',[],'',''],
	['PAGE','2006',jdecode('Property+Photos'),jdecode(''),'/2006.html','true',[],'',''],
	['PAGE','1425',jdecode('Location+Map'),jdecode(''),'/1425.html','true',[],'',''],
	['PAGE','124',jdecode('Availabilities'),jdecode(''),'/124.html','true',[],'',''],
	['PAGE','133',jdecode('Contact'),jdecode(''),'/133.html','true',[],'',''],
	['PAGE','142',jdecode('About+Us'),jdecode(''),'/142.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Dots';
theSitetree.paletteFamily='E7E9D5';
theSitetree.keyvisualId='396';
theSitetree.keyvisualName='buero.jpg';
theSitetree.fontsetId='45';
theSitetree.graphicsetId='50';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E7E9D5';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Dots',
				paletteFamily: 	'E7E9D5',
				keyvisualId: 	'396',
				keyvisualName: 	'buero.jpg',
				fontsetId: 		'45',
				graphicsetId: 	'50',
				contentColor: 	'000000',
				contentBGColor: 'E7E9D5',
				a_color: 		'E7E9D5',
				b_color: 		'CCCCCC',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '94',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94',
internalId:  '',
customField: '20100215-065644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133',
internalId:  '',
customField: '20090423-223139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1416',
internalId:  '',
customField: '20080228-200504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2380',
internalId:  '',
customField: '20080228-200538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1628',
internalId:  '',
customField: '20080205-014334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1637',
internalId:  '',
customField: '20060728-073342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2006',
internalId:  '',
customField: '20080325-074142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1425',
internalId:  '',
customField: '20060720-015041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124',
internalId:  '',
customField: '20080124-180756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142',
internalId:  '',
customField: '20100421-134056'
};
var canonHostname = 'cm4all01.west-datacenter.net';
var accountId     = 'AWH010IN2CO3';
var companyName   = 'MERIDIAN+DISTRIBUTION+CENTER';
var htmlTitle	  = 'Meridian+Distribution+Center+-+945%2C403+SF+of+Bulk+Distrubtion+Space+Available+for+Lease+in+Sarasota%2C+Florida';
var metaKeywords  = 'Meridian+Development+Group%2C+Meridian%2C+Development%2C+Construction%2C+Bulk%2C+Bulk+Distribution%2C+Industrial%2C+Warehouse%2C+Sarasota%2C+Meridian+Distribution+Center%2C+Warehouse+Space+for+Lease%2C+Warehouse+Space%2C+racked+space';
var metaContents  = 'Meridian+Development+Group%2C+Meridian%2C+Development%2C+Construction%2C+Bulk%2C+Bulk+Distribution%2C+Industrial%2C+Warehouse%2C+Sarasota%2C+Meridian+Distribution+Center%2C+Warehouse+Space+for+Lease%2C+Warehouse+Space%2C+racked+space';
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();
};
