/* [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','6061',jdecode('Strona+g%C5%82%C3%B3wna'),jdecode(''),'/6061.html','true',[],'',''],
	['PAGE','6261',jdecode('Nasze+Produkty'),jdecode(''),'/6261/index.html','true',[ 
		['PAGE','41072',jdecode('Butelki+ozdobne'),jdecode(''),'/6261/41072.html','true',[],'',''],
		['PAGE','6461',jdecode('Dro%C5%BCd%C5%BCe+Gorzelnicze'),jdecode(''),'/6261/6461.html','true',[],'',''],
		['PAGE','39472',jdecode('Alembiki+miedziane'),jdecode(''),'/6261/39472.html','true',[],'',''],
		['PAGE','6482',jdecode('Dro%C5%BCd%C5%BCe+Winiarskie'),jdecode(''),'/6261/6482.html','true',[],'',''],
		['PAGE','33872',jdecode('Po%C5%BCywki'),jdecode(''),'/6261/33872.html','true',[],'',''],
		['PAGE','12861',jdecode('P%C5%82atki+d%C4%99bowe'),jdecode(''),'/6261/12861.html','true',[],'',''],
		['PAGE','12882',jdecode('P%C5%82atki+drzew+owocowych'),jdecode(''),'/6261/12882.html','true',[],'',''],
		['PAGE','11361',jdecode('W%C4%99giel+aktywny'),jdecode(''),'/6261/11361.html','true',[],'',''],
		['PAGE','29172',jdecode('Oczyszczanie+alkoholu'),jdecode(''),'/6261/29172.html','true',[],'',''],
		['PAGE','27772',jdecode('Stabilizacja%2FSiarkowanie'),jdecode(''),'/6261/27772.html','true',[],'',''],
		['PAGE','33472',jdecode('Klarowanie'),jdecode(''),'/6261/33472.html','true',[],'',''],
		['PAGE','33272',jdecode('Pasta+ENOPLASTICO'),jdecode(''),'/6261/33272.html','true',[],'',''],
		['PAGE','39872',jdecode('Prasy+do+owoc%C3%B3w'),jdecode(''),'/6261/39872.html','true',[],'',''],
		['PAGE','40272',jdecode('Prasa+INOX'),jdecode(''),'/6261/40272.html','true',[],'',''],
		['PAGE','40572',jdecode('Mini+prasy+metalowe'),jdecode(''),'/6261/40572.html','true',[],'','']
	],'',''],
	['PAGE','12903',jdecode('Czytelnia'),jdecode(''),'/12903/index.html','true',[ 
		['PAGE','31272',jdecode('P%C5%82atki+s%C4%85+EKOLOGICZNE+%3F%3F'),jdecode(''),'/12903/31272.html','true',[],'','']
	],'',''],
	['PAGE','36772',jdecode('Nasi+Partnerzy'),jdecode(''),'/36772.html','true',[],'',''],
	['PAGE','6561',jdecode('Kontakt'),jdecode(''),'/6561.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='9240';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='28204';
theSitetree.graphicsetId='12763';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Transluszent',
				paletteFamily: 	'660000',
				keyvisualId: 	'9240',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'28204',
				graphicsetId: 	'12763',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6061',
internalId:  '',
customField: '20090828-210412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6261',
internalId:  '',
customField: '20090820-215050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6461',
internalId:  '',
customField: '20090822-091826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6482',
internalId:  '',
customField: '20090828-211005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6561',
internalId:  '',
customField: '20100115-161052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11361',
internalId:  '',
customField: '20090820-223701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12861',
internalId:  '',
customField: '20090824-214355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12882',
internalId:  '',
customField: '20090820-223522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12903',
internalId:  '',
customField: '20090822-113206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27772',
internalId:  '',
customField: '20090824-224940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29172',
internalId:  '',
customField: '20090828-211558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31272',
internalId:  '',
customField: '20090821-161603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33272',
internalId:  '',
customField: '20090822-094401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33472',
internalId:  '',
customField: '20090828-211954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33872',
internalId:  '',
customField: '20090828-211321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36772',
internalId:  '',
customField: '20100115-160952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39472',
internalId:  '',
customField: '20100323-141230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39872',
internalId:  '',
customField: '20100323-142541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40272',
internalId:  '',
customField: '20100323-143015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40572',
internalId:  '',
customField: '20100323-143336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41072',
internalId:  '',
customField: '20100423-163423'
};
var canonHostname = 'wsc2.home.net.pl';
var accountId     = 'AHPL10INFDSL';
var companyName   = 'Produkty+do+wyrobu+alkoholi.';
var htmlTitle	  = 'Hurt+akcesoria+winiarskie%2C+dro%C5%BCd%C5%BCe+gorzelnicze%2C+piwowarskie%2C+po%C5%BCywki%2C+p%C5%82atki+d%C4%99bowe';
var metaKeywords  = 'dro%C5%BCd%C5%BCe+winiarskie%2C+drozd%C5%BCe+miodowe%2C+tr%C3%B3jniak%2C+mi%C3%B3d%2C+oenoferm%2C+oenoferm+fredo%2C+drozd%C5%BCe+aktywne%2C++dro%C5%BCd%C5%BCe+gorzelnicze%2C+po%C5%BCywki%2C+nutriferm%2C+p%C5%82atki+d%C4%99bowe%2C+beczka+d%C4%99bowa%2C+euro-win%2C+biowin%2C+browamator%2C+winohobby%2C+ares%2C+piwowar%2C+enartis%2C+ersbloh%2C+balon%2C+butelki%2C+korki%2C+korek%2C+korkownica%2C+kapslownica%2C+kapsle+do+piwa%2C+brew-kit%2C+brewkit%2C+piwowarstwo%2C+pojemnik+fermentacyjny%2C+bimber%2C+zacier%2C+destylacja%2C+fermentacja%2C+gorza%C5%82ka%2C+wodka%2C+wyrob+alkoholu%2C+zaprawki+do+alkoholu%2C+whisky%2C+nutriferm+arom%2C+anka%2C+tanina%2C+g%C5%82%C3%B3g%2C+tarnina%2C+jarz%C4%99bina%2C+r%C3%B3%C5%BCa%2C+wyr%C3%B3b+wina%2C+w%C4%99%C5%BCe+silikonowe%2C+w%C4%99giel+aktywny%2C+filtr%2C+filtr+winiarski%2C+filtrowanie+destylat%C3%B3w%2C+drinkit%2C+strand%2C+mixer+man%2C+vendor%2C+coobra%2C+dro%C5%BCd%C5%BCe+coobra%2C+coobra+24h%2C+turbo%2C+swimp%2C+klarowanie%2C+klarmedel%2C+wino.org.pl%2C+kolumna+destylacyjna%2C+';
var metaContents  = 'Import+i+dystrybucja+akcesoriow+winiarskich%3A+dro%C5%BCd%C5%BCe+winiarskie%2C+po%C5%BCywki%2C+dro%C5%BCd%C5%BCe+gorzelnicze%2C+p%C5%82atki+d%C4%99bowe%2C+dro%C5%BCd%C5%BCe+COOBRA.+Zaopatrujemy+winiarzy%2C+winnice+i+sklepy+specjalistyczne+w+ca%C5%82ej+Polsce.';
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();
};

