/* [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','14101',jdecode('ING+Bank+%C5%9Al%C4%85ski'),jdecode(''),'/14101.html','true',[],'',''],
	['PAGE','21101',jdecode('Produkty+ING'),jdecode(''),'/21101/index.html','true',[ 
		['PAGE','21122',jdecode('Zestawienie+Produkt%C3%B3w'),jdecode(''),'/21101/21122.html','true',[],'',''],
		['PAGE','21143',jdecode('Konta+m%C5%82odzie%C5%BCowe'),jdecode(''),'/21101/21143.html','true',[],'',''],
		['PAGE','21164',jdecode('Konta+osobiste'),jdecode(''),'/21101/21164.html','true',[],'',''],
		['PAGE','21185',jdecode('Konta+firmowe'),jdecode(''),'/21101/21185.html','true',[],'',''],
		['PAGE','21206',jdecode('Kredyty+na+start'),jdecode(''),'/21101/21206.html','true',[],'',''],
		['PAGE','21227',jdecode('Emerytury+%2F+OFE'),jdecode(''),'/21101/21227.html','true',[],'','']
	],'',''],
	['PAGE','22801',jdecode('Dom+Maklerski+ING'),jdecode(''),'/22801.html','true',[],'',''],
	['PAGE','21248',jdecode('Forum'),jdecode(''),'/21248.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Dots';
theSitetree.paletteFamily='E7E9D5';
theSitetree.keyvisualId='398';
theSitetree.keyvisualName='callcenter.jpg';
theSitetree.fontsetId='26690';
theSitetree.graphicsetId='50';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='E7E9D5';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Dots',
				paletteFamily: 	'E7E9D5',
				keyvisualId: 	'398',
				keyvisualName: 	'callcenter.jpg',
				fontsetId: 		'26690',
				graphicsetId: 	'50',
				contentColor: 	'000066',
				contentBGColor: 'E7E9D5',
				a_color: 		'E7E9D5',
				b_color: 		'CCCCCC',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21206',
internalId:  '',
customField: '20100124-215541'
};
webappMappings['1501']=webappMappings['1501-7626817']={
webappId:    '1501',
documentId:  '14101',
internalId:  '7626817',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20100125-092953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21122',
internalId:  '',
customField: '20100124-215541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21143',
internalId:  '',
customField: '20100124-215541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21164',
internalId:  '',
customField: '20100124-215541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21185',
internalId:  '',
customField: '20100124-215541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20100125-101234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21227',
internalId:  '',
customField: '20100125-094716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21248',
internalId:  '',
customField: '20100125-101328'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '14101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1003']=webappMappings['1003-ahpl10inzi1f12664af7f6e']={
webappId:    '1003',
documentId:  '21248',
internalId:  'ahpl10inzi1f12664af7f6e',
customField: 'pl:PL'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20100125-102054'
};
var canonHostname = 'wsc0.home.net.pl';
var accountId     = 'AHPL10INZI1F';
var companyName   = 'ING+Bank+%C5%9Al%C4%85ski';
var htmlTitle	  = '';
var metaKeywords  = 'ING+Bank%2C+ING+%C5%9Al%C4%85ski%2C+ING%2C+ING+Bank+%C5%9Al%C4%85ski%2Ckredyt%2C+po%C5%BCyczki%2C+konta+bankowe%2C+lokaty%2C+dom+maklerski+ING';
var metaContents  = 'Tanie+po%C5%BCyczki+ING+Banku+%C5%9Al%C4%85skiego+zdobywaj%C4%85+coraz+wi%C4%99ksz%C4%85+popularno%C5%9B%C4%87%21+Wybierz+produkty+finansowe+ING+-+oszcz%C4%99dzaj+i+inwestuj+pieni%C4%85dze+z+nami+-+mo%C5%BCesz+tylko+zyska%C4%87%21%60';
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();
};

