/* [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','201',jdecode('Home'),jdecode(''),'/201.html','true',[],'',''],
	['PAGE','207',jdecode('Products'),jdecode(''),'/207/index.html','true',[ 
		['PAGE','212',jdecode('Information+Request'),jdecode(''),'/207/212/index.html','true',[ 
			['PAGE','6602',jdecode('Information+Request+%28follow+up+page%29'),jdecode(''),'/207/212/6602.html','false',[],'','']
		],'','']
	],'','']];
var siteelementCount=4;
theSitetree.topTemplateName='Seifenblase';
theSitetree.paletteFamily='C8E2FF';
theSitetree.keyvisualId='2355';
theSitetree.keyvisualName='event-agentur2.jpg';
theSitetree.fontsetId='381';
theSitetree.graphicsetId='427';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Seifenblase',
				paletteFamily: 	'C8E2FF',
				keyvisualId: 	'2355',
				keyvisualName: 	'event-agentur2.jpg',
				fontsetId: 		'381',
				graphicsetId: 	'427',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'6666CC',
				e_color: 		'3333CC',
				f_color: 		'9999CC',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-2352']={
webappId:    '7008',
documentId:  '212',
internalId:  '2352',
customField: 'language:en;country:US;'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010INXPFD';
var companyName   = 'COVERAGE+PLUS';
var htmlTitle	  = 'COVERAGE+PLUS%7C+triple+R+Coverage+%7C+Insurance+and+Financial+Products';
var metaKeywords  = 'business+loans%2Cfinance%2Ccommercial+loans%2Ccommercial+mortgages%2Cbusiness+capital%2Clife+insurance%2Clong+term+care%2CInsurance%2Cfinancial+planning%2CGE+Insurance%2Ctenant%2Ccoverage+plus%2Cgia%2Clife%2Ctenants%2Cpoint+reduction%2CHempstead%2CRosedale%2CGlendale%2CGE+Healthcare%2Cge%2Cauto%2Chome+owner%2Chome%2Ccar%2CNew+York%2Cterm%2Cwhole%2Cindemnity%2Cliability%2Cproperty%2CHealth+Care%2CNY%2CState%2Cnew+york+state%2CLI%2CLong+Island%2CNassau+County%2CValley+Stream%2CGreat+Neck%2CFarm%2CFarm+Equipment%2CFleet%2CCoverage+Plus%2CTriple+R%2CTriple+R+Coverage%2CCollision%2CProtection%2CSecurity%2CInsurance+Quotes%2CInsurance+Providers%2CMedicare%2CSupplemental%2CDisability%2CInsurers%2CFlood%2CCorporate%2CClaim%2CInvestment%2CLosses%2CDeductable%2CPlanning%2CRetirement%2CLoans%2CFinancing';
var metaContents  = 'COVERAGE+PLUS+INSURANCE+in+New+York+State+GE+Financial+Planning+Health+Care+Loans+Capital+Life%2Ftitle++meta+name%3Ddescription+content%3DCoverage+Plus+GE+Insurance+business+loans%2C+finance%2C+commercial%2C+mortgage%2C+capital%2C+life%2C+long+term.+Long+Island%2C+New+York%2C+Healthcare%2C+Financial+Planning.+Travelers%2C+Progressive%2C+Hartford%2C+Kemper%2C+CNA';
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();
};
