/* [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','4901',jdecode('About+Us'),jdecode(''), jdecode('%2F4901.html'), 'true',[],'',''],
	['PAGE','12701',jdecode('Our+Products'),jdecode(''), jdecode('%2F12701.html'), 'true',[],'',''],
	['PAGE','83313',jdecode('Insurance+Carrier+Partners'),jdecode(''), jdecode('%2F83313.html'), 'true',[],'',''],
	['PAGE','12901',jdecode('Personal+Insurance+'),jdecode(''), jdecode('%2F12901%2Findex.html'), 'true',[ 
		['PAGE','12722',jdecode('Auto+Insurance'),jdecode(''), jdecode('%2F12901%2F12722.html'), 'true',[],'',''],
		['PAGE','12801',jdecode('Homeowners+Insurance'),jdecode(''), jdecode('%2F12901%2F12801.html'), 'true',[],'',''],
		['PAGE','67901',jdecode('Personal+Umbrella'),jdecode(''), jdecode('%2F12901%2F67901.html'), 'true',[],'',''],
		['PAGE','75113',jdecode('Mobile%2FManufactured+Home'),jdecode(''), jdecode('%2F12901%2F75113.html'), 'true',[],'',''],
		['PAGE','73913',jdecode('Flood+Insurance'),jdecode(''), jdecode('%2F12901%2F73913.html'), 'true',[],'',''],
		['PAGE','68401',jdecode('Boat+Insurance'),jdecode(''), jdecode('%2F12901%2F68401.html'), 'true',[],'',''],
		['PAGE','68422',jdecode('Motorcycle%2FOff+Road'),jdecode(''), jdecode('%2F12901%2F68422.html'), 'true',[],'',''],
		['PAGE','73113',jdecode('Antique%2FModified+Auto'),jdecode(''), jdecode('%2F12901%2F73113.html'), 'true',[],'',''],
		['PAGE','87313',jdecode('Teen+Drivers'),jdecode(''), jdecode('%2F12901%2F87313.html'), 'true',[],'','']
	],'',''],
	['PAGE','12843',jdecode('Property+Investor+Program'),jdecode(''), jdecode('%2F12843.html'), 'true',[],'',''],
	['PAGE','12943',jdecode('Business+Insurance+'),jdecode(''), jdecode('%2F12943.html'), 'true',[],'',''],
	['PAGE','67801',jdecode('Strategic+Partners'),jdecode(''), jdecode('%2F67801.html'), 'true',[],'',''],
	['PAGE','78413',jdecode('Insurance+Talk'),jdecode(''), jdecode('%2F78413.html'), 'true',[],'',''],
	['PAGE','11801',jdecode('Request+A+Quote+Proposal'),jdecode(''), jdecode('%2F11801.html'), 'true',[],'',''],
	['PAGE','79513',jdecode('Service+My+Policy'),jdecode(''), jdecode('%2F79513.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Blossom';
theSitetree.paletteFamily='A4681A';
theSitetree.keyvisualId='7111';
theSitetree.keyvisualName='kv_7111.jpg';
theSitetree.fontsetId='16394';
theSitetree.graphicsetId='12131';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E5E2E2';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'verizon',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blossom',
				paletteFamily: 	'A4681A',
				keyvisualId: 	'7111',
				keyvisualName: 	'kv_7111.jpg',
				fontsetId: 		'16394',
				graphicsetId: 	'12131',
				contentColor: 	'000000',
				contentBGColor: 'E5E2E2',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12943',
internalId:  '',
customField: '20081222-191132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20091220-163303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20090625-090850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20090106-193906'
};
webappMappings['7008']=webappMappings['7008-889']={
webappId:    '7008',
documentId:  '11801',
internalId:  '889',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12722',
internalId:  '',
customField: '20081215-071522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20081222-203008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20081223-063302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12843',
internalId:  '',
customField: '20081229-142837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67801',
internalId:  '',
customField: '20090625-090527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67901',
internalId:  '',
customField: '20081224-074433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78413',
internalId:  '',
customField: '20081225-113004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75113',
internalId:  '',
customField: '20081222-202416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68401',
internalId:  '',
customField: '20081222-184115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68422',
internalId:  '',
customField: '20081222-200602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73113',
internalId:  '',
customField: '20081222-201245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73913',
internalId:  '',
customField: '20081222-190233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83313',
internalId:  '',
customField: '20090612-061545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79513',
internalId:  '',
customField: '20081229-145844'
};
webappMappings['1003']=webappMappings['1003-ahw050invewn11e695fed9e']={
webappId:    '1003',
documentId:  '78413',
internalId:  'ahw050invewn11e695fed9e',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87313',
internalId:  '',
customField: '20100122-074940'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INVEWN';
var companyName   = 'Risk+Management+Services+of+Maryland%3A+410-526-6690';
var htmlTitle	  = 'Risk+Management+Services+of+Maryland';
var metaKeywords  = 'Auto+Insurance+Maryland%2C+Risk+Management+Services%2C+RSMMD%2C+Boat+Insurance+Maryland%2C+MD%2C+Business+Insurance+Maryland%2C+Commercial+Insurance%2C+Workers+Compensation+Maryland%2C+Mobile+Home+Insurance+Maryland%2C+Motorcycle+Insurance+Maryland%2C+Motorcycle+Insurance%2C+Recreational+Products+Maryland';
var metaContents  = 'Risk+Management+Services+of+Maryland+is+a+full+service+independent+insurance+agency+specializing+in+both+personal+and+commercial+risks.+We+offer+very+competitive+rates+and+are+able+to+utilize+comparitive+rating+technology+to+shop+the+best+coverage+and+the+best+price';
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();
};

