/* [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','1301',jdecode('Home'),jdecode(''),'/1301.html','true',[],'',''],
	['PAGE','2843',jdecode('FAQ'),jdecode(''),'/2843.html','true',[],'',''],
	['PAGE','2801',jdecode('Our+Mobile+Units'),jdecode(''),'/2801.html','true',[],'',''],
	['PAGE','2822',jdecode('Supplies'),jdecode(''),'/2822.html','true',[],'',''],
	['PAGE','29401',jdecode('Locations'),jdecode(''),'/29401.html','true',[],'',''],
	['PAGE','2864',jdecode('Dealership+Opportunities'),jdecode(''),'/2864/index.html','true',[ 
		['PAGE','3201',jdecode('Dealership+FAQ'),jdecode(''),'/2864/3201.html','true',[],'',''],
		['PAGE','14901',jdecode('Dealership+Application'),jdecode(''),'/2864/14901.html','true',[],'','']
	],'',''],
	['PAGE','2885',jdecode('Contact+Us'),jdecode(''),'/2885.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='003399';
theSitetree.keyvisualId='1246';
theSitetree.keyvisualName='callcenter.jpg';
theSitetree.fontsetId='194';
theSitetree.graphicsetId='229';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Profile',
				paletteFamily: 	'003399',
				keyvisualId: 	'1246',
				keyvisualName: 	'callcenter.jpg',
				fontsetId: 		'194',
				graphicsetId: 	'229',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'003399',
				b_color: 		'000066',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1301',
internalId:  '',
customField: '20080508-114255'
};
webappMappings['7008']=webappMappings['7008-10604']={
webappId:    '7008',
documentId:  '2885',
internalId:  '10604',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20080519-093926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20071016-085025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2822',
internalId:  '',
customField: '20080514-134201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2843',
internalId:  '',
customField: '20071016-082643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2864',
internalId:  '',
customField: '20070103-192551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20080604-142526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20070103-192630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2885',
internalId:  '',
customField: '20080514-133501'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INEAXC';
var companyName   = 'Call+1+-877-788-3311+Today%21';
var htmlTitle	  = 'Mobile+Storage+Raleigh%2C+Cary%2C+Durham%2C+Apex%2C+Chapel+Hill%2C+Fuquay';
var metaKeywords  = 'Raleigh+Mobile+Units%2C+Mobile+Units+Raleigh+NC%2C+Mobile+Storage+Raleigh+NC%2C+Cary+NC+Mobile+UnitsStorage%2C+storage+containers%2C+storage+units%2C+storage+rental%2C+mobile+storage%2C+mobile+storage+units%2C+mobile+storage+containers%2C+portable+storage%2C+self+storage%2C+pods+raleigh+nc%2C+pods+cary+nc%2C+pods+holly+springs+nc%2C+pods+durham+nc%2C';
var metaContents  = 'Mobile+Storage+Units+in+Raleigh+NC%2C+Cary+NC%2C+Durham+NC%2C+Apex+NC%2C+Chapel+Hill+NC.++Similar+to+PODS%2C+Units%2C+Pack+Rat+and+Pack+Man.+Personal+storage+containers.';
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();
};
