/* [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 theSitetree=[ 
	['PAGE','301',jdecode('Home'),jdecode(''),'/301.html','true',[],''],
	['PAGE','18401',jdecode('Life+Insurance'),jdecode(''),'/18401.html','false',[],''],
	['PAGE','18422',jdecode('Property+Insurance'),jdecode(''),'/18422.html','false',[],'']];
var siteelementCount=3;
theSitetree.topTemplateName='Weekend';
theSitetree.paletteFamily='4A53AF';
theSitetree.keyvisualId='3953';
theSitetree.keyvisualName='kv_3953.jpg';
theSitetree.fontsetId='10526';
theSitetree.graphicsetId='11142';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5C65C1';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Weekend',
				paletteFamily: 	'4A53AF',
				keyvisualId: 	'3953',
				keyvisualName: 	'kv_3953.jpg',
				fontsetId: 		'10526',
				graphicsetId: 	'11142',
				contentColor: 	'FFFFFF',
				contentBGColor: '5C65C1',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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:  '301',
internalId:  '',
customField: '20090430-132814'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18422',
internalId:  '',
customField: '20090430-114835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18401',
internalId:  '',
customField: '20090430-114835'
};
webappMappings['7008']=webappMappings['7008-5999']={
webappId:    '7008',
documentId:  '301',
internalId:  '5999',
customField: 'language:en;country:US;'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPNL5';
var companyName   = 'Mary+Widner+Insurance+Agency+Sarasota+Florida';
var htmlTitle	  = 'Mary+Widner+Insurance+Agency+Sarasota+Florida';
var metaKeywords  = 'ATV+insurance+RV+for+collector+cars+auto+homeowners+renters+life+bonds+business+commercial+boat+umbrella+liability+Florida+brokers+Bradenton+manatee+Sarasota+service+home+Geico+State+Farm+All+mercury+AIG+21st+century+progressive+Safeco+Victoria+Nationwide+Allied+flood+sink+hole+honest+agent+Citizens34205+%2C34237+%2C34238+%2C34231+%2C34287+%2C34219+%2C34209+%2C34290+%2C34222+%2C34260+%2C34276+%2C34229+%2C34277+%2C34232+%2C34235+%2C34239+%2C34278+%2C34250+%2C34210+%2C34220+%2C34285+%2C34270+%2C34221+%2C34228+%2C34241+%2C34292+%2C34217+%2C34218+%2C34234+%2C34203+%2C34286+%2C34281+%2C34211+%2C34280+%2C34251+%2C34242+%2C34207+%2C34206+%2C34204+%2C34240+%2C34215+%2C34282+%2C34236+%2C34212+%2C34274+%2C34275+%2C34289+%2C34202+%2C34243+%2C34201+%2C34233+%2C34284+%2C34230+%2C34293+%2C34208+%2C34264+%2C34291';
var metaContents  = 'Solution+and+Service+that+is+Personal%2CPersonalized+and+Proactive%21MWA+works+with+multiple+insurance+companies+benefiting+YOU%21+MWA+asks+questions+to+better+understand+YOUR+insurance+needs+MWA+gives+expert++knowledgeable+adviceMWA+is+YOUR+1-stop-shoppingMWA+practices+continuous+learning+MWA+provides+expert+claim+adviceMWA+asks+questions+in+order+to+better+understand+a+customers+insurance+needs+MWA+gives+expert+and+knowledgeable+advice+MWA+practices+continuous+learningMWA+provides+customers+the+ability+for+one-stop-shopping.+MWA+provides+expert+claim+advice.MWA+has+the+ability+to+correctly+match+the+customer+with+the+carrier+Mary+Widner+Agency+has+the+flexibility+to+work+with+multiple+insurance+companies+on+the+customers+behalf';
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();
};

