/* [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','63',jdecode('HOME'),jdecode(''), jdecode('%2F63.html'), 'true',[],'',''],
	['PAGE','147',jdecode('CONTACT+US'),jdecode(''), jdecode('%2F147%2Findex.html'), 'true',[ 
		['PAGE','1648',jdecode('Contact+%28follow+up+page%29'),jdecode(''), jdecode('%2F147%2F1648.html'), 'false',[],'','']
	],'',''],
	['PAGE','2220',jdecode('QUICK+QUOTE'),jdecode(''), jdecode('%2F2220.html'), 'true',[],'',''],
	['PAGE','129',jdecode('APPLY+ONLINE'),jdecode(''), jdecode('%2F129.html'), 'true',[],'',''],
	['PAGE','1890',jdecode('DOWNLOAD+APPLICATION'),jdecode(''), jdecode('%2F1890.html'), 'true',[],'',''],
	['PAGE','84',jdecode('HEALTH+INSURANCE'),jdecode(''), jdecode('%2F84%2Findex.html'), 'true',[ 
		['PAGE','2146',jdecode('ALL+COMPANIES'),jdecode(''), jdecode('%2F84%2F2146.html'), 'true',[],'',''],
		['PAGE','46801',jdecode('AETNA'),jdecode(''), jdecode('%2F84%2F46801.html'), 'true',[],'',''],
		['PAGE','138',jdecode('ANTHEM+BLUE+CROSS'),jdecode(''), jdecode('%2F84%2F138.html'), 'true',[],'',''],
		['PAGE','1665',jdecode('BLUE+SHIELD'),jdecode(''), jdecode('%2F84%2F1665.html'), 'true',[],'',''],
		['PAGE','46822',jdecode('CIGNA'),jdecode(''), jdecode('%2F84%2F46822.html'), 'true',[],'',''],
		['PAGE','1674',jdecode('HEALTH+NET'),jdecode(''), jdecode('%2F84%2F1674.html'), 'true',[],'',''],
		['PAGE','42601',jdecode('KAISER+PERMANENTE'),jdecode(''), jdecode('%2F84%2F42601.html'), 'true',[],'','']
	],'',''],
	['PAGE','93',jdecode('DENTAL+PLANS'),jdecode(''), jdecode('%2F93.html'), 'true',[],'',''],
	['PAGE','52801',jdecode('PROVIDER+SEARCH'),jdecode(''), jdecode('%2F52801.html'), 'true',[],'',''],
	['PAGE','111',jdecode('MEDICARE+SUPPLEMENTS'),jdecode(''), jdecode('%2F111.html'), 'true',[],'',''],
	['PAGE','120',jdecode('LONG+TERM+CARE+INS.'),jdecode(''), jdecode('%2F120.html'), 'true',[],'',''],
	['PAGE','102',jdecode('LIFE+INSURANCE'),jdecode(''), jdecode('%2F102.html'), 'true',[],'',''],
	['PAGE','48501',jdecode('MEDICAL+JOKES'),jdecode(''), jdecode('%2F48501.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Easylife';
theSitetree.paletteFamily='B650B7';
theSitetree.keyvisualId='5821';
theSitetree.keyvisualName='kv_5821.jpg';
theSitetree.fontsetId='11095';
theSitetree.graphicsetId='11870';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Easylife',
				paletteFamily: 	'B650B7',
				keyvisualId: 	'5821',
				keyvisualName: 	'kv_5821.jpg',
				fontsetId: 		'11095',
				graphicsetId: 	'11870',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '63',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63',
internalId:  '',
customField: '20111219-010236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147',
internalId:  '',
customField: '20111218-200911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1648',
internalId:  '',
customField: '20080314-072120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2220',
internalId:  '',
customField: '20111218-171917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129',
internalId:  '',
customField: '20111218-171550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1890',
internalId:  '',
customField: '20111218-171649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84',
internalId:  '',
customField: '20111218-172219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2146',
internalId:  '',
customField: '20111218-172313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138',
internalId:  '',
customField: '20111218-172557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1665',
internalId:  '',
customField: '20111218-172718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1674',
internalId:  '',
customField: '20111218-172937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93',
internalId:  '',
customField: '20111218-173204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111',
internalId:  '',
customField: '20111218-173444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120',
internalId:  '',
customField: '20111218-173537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102',
internalId:  '',
customField: '20111218-173646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42601',
internalId:  '',
customField: '20111218-173055'
};
webappMappings['1501']=webappMappings['1501-155009']={
webappId:    '1501',
documentId:  '63',
internalId:  '155009',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46801',
internalId:  '',
customField: '20111218-172421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46822',
internalId:  '',
customField: '20111218-172828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48501',
internalId:  '',
customField: '20111218-203106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52801',
internalId:  '',
customField: '20111218-173315'
};
webappMappings['7008']=webappMappings['7008-9051']={
webappId:    '7008',
documentId:  '147',
internalId:  '9051',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INXENW';
var companyName   = 'Health+Quote+Plus';
var htmlTitle	  = 'Quotes+for+California+Medicare+Supplements+and+Health+Insurance%2C+Granada+Hills%2C+California';
var metaKeywords  = 'medical+insurance%2C+health+insurance+quotes%2C+affordable+health+insurance%2C+individual+health+insurance%2C+health+insurance+quote%2C+california+health+insurance%2C+medicare+advantage+plans%2C+turning+65';
var metaContents  = 'instant+quote+for+health+insurance+and+medicare+plans.%0AHealth+insurance+and+medicare+specialist+in+Granada+Hills%2C+CA';
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();
};

