/* [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','4201',jdecode('Strona+g%C5%82%C3%B3wna'),jdecode(''),'/4201.html','true',[],'',''],
	['PAGE','4273',jdecode('Nowo%C5%9Bci'),jdecode(''),'/4273.html','true',[],'',''],
	['PAGE','4294',jdecode('O+indukcji'),jdecode(''),'/4294.html','true',[],'',''],
	['PAGE','4315',jdecode('Produkty'),jdecode(''),'/4315/index.html','true',[ 
		['PAGE','4722',jdecode('Urz%C4%85dzenia+indukcyjne'),jdecode(''),'/4315/4722.html','true',[],'',''],
		['PAGE','4701',jdecode('Meble+nierdzewne'),jdecode(''),'/4315/4701.html','true',[],'',''],
		['PAGE','43211',jdecode('Form1'),jdecode(''),'/4315/43211.html','false',[],'',''],
		['PAGE','52122',jdecode('Sprz+GA%2FSP%2FWO+3500'),jdecode(''),'/4315/52122.html','false',[],'',''],
		['PAGE','52522',jdecode('Sprz+GA%2FSP%2FDU%2FPO+5000'),jdecode(''),'/4315/52522.html','false',[],'',''],
		['PAGE','52622',jdecode('Sprz+GA%2FSP%2FDU%2FPO+5000SZ'),jdecode(''),'/4315/52622.html','false',[],'',''],
		['PAGE','18001',jdecode('Linia+podstawowa'),jdecode(''),'/4315/18001.html','false',[],'',''],
		['PAGE','19901',jdecode('Linia+WOK'),jdecode(''),'/4315/19901.html','false',[],'',''],
		['PAGE','4743',jdecode('Linia+Multi'),jdecode(''),'/4315/4743.html','false',[],'',''],
		['PAGE','26311',jdecode('Linia+Install'),jdecode(''),'/4315/26311.html','false',[],'',''],
		['PAGE','30911',jdecode('Linia+Modu%C5%82owa'),jdecode(''),'/4315/30911.html','false',[],'',''],
		['PAGE','37111',jdecode('Linia+smazalnikow'),jdecode(''),'/4315/37111.html','false',[],'',''],
		['PAGE','38811',jdecode('Linia+smazalnikow+Module'),jdecode(''),'/4315/38811.html','false',[],'',''],
		['PAGE','39211',jdecode('Linia+Hold'),jdecode(''),'/4315/39211.html','false',[],'',''],
		['PAGE','41311',jdecode('Linia+Hold+Install'),jdecode(''),'/4315/41311.html','false',[],'','']
	],'',''],
	['PAGE','51522',jdecode('Promocje+%21%21%21'),jdecode(''),'/51522.html','true',[],'',''],
	['PAGE','4336',jdecode('Kontakt'),jdecode(''),'/4336.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='28830';
theSitetree.graphicsetId='355';
theSitetree.contentColor='A3AFD5';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'28830',
				graphicsetId: 	'355',
				contentColor: 	'A3AFD5',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				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:  '4201',
internalId:  '',
customField: '20091207-105906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20091207-110804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4273',
internalId:  '',
customField: '20091206-183303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4315',
internalId:  '',
customField: '20091209-221641'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4294',
internalId:  '',
customField: '20091207-223203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4336',
internalId:  '',
customField: '20091130-010052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20091209-000623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20091209-225006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4743',
internalId:  '',
customField: '20091207-110900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20091207-110715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26311',
internalId:  '',
customField: '20091207-110948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30911',
internalId:  '',
customField: '20091207-111044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37111',
internalId:  '',
customField: '20091207-111127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38811',
internalId:  '',
customField: '20091207-111219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39211',
internalId:  '',
customField: '20091207-111948'
};
webappMappings['1501']=webappMappings['1501-16426224']={
webappId:    '1501',
documentId:  '4201',
internalId:  '16426224',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41311',
internalId:  '',
customField: '20091207-112028'
};
webappMappings['7008']=webappMappings['7008-5746']={
webappId:    '7008',
documentId:  '43211',
internalId:  '5746',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43211',
internalId:  '',
customField: '20091206-201029'
};
webappMappings['7008']=webappMappings['7008-5786']={
webappId:    '7008',
documentId:  '52122',
internalId:  '5786',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51522',
internalId:  '',
customField: '20091209-220738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52122',
internalId:  '',
customField: '20091209-214837'
};
webappMappings['7008']=webappMappings['7008-5789']={
webappId:    '7008',
documentId:  '52522',
internalId:  '5789',
customField: 'language:pl;country:PL;'
};
webappMappings['7008']=webappMappings['7008-5790']={
webappId:    '7008',
documentId:  '52622',
internalId:  '5790',
customField: 'language:pl;country:PL;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52522',
internalId:  '',
customField: '20091209-214936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52622',
internalId:  '',
customField: '20091209-214744'
};
var canonHostname = 'wsc0.home.net.pl';
var accountId     = 'AHPL10INPUST';
var companyName   = '++Urz%C4%85dzenia+i+meble+gastronomiczne';
var htmlTitle	  = 'Gastronomy+%7C+Gastronomiczne+urz%C4%85dzenia+indukcyjne%2C+Meble+ze+stali+nierdzewnej.';
var metaKeywords  = 'gastronomia%2C+sprz%C4%99t+gastronomiczny%2C+wyposa%C5%BCenie+gastronomii%2C+restauracji%2C+lokali%2C+kuchni%2C+urz%C4%85dzenia+indukcyjne%2C+grzewcze%2C+meble+gastronomiczne+ze+stali+nierdzewnej%2C+kwasoodopornej%2C+indukcja%2C+wok+indukcyjny%2C+kuchnie%2C+kuchenki';
var metaContents  = 'Gastronomiczne+urz%C4%85dzenia+indukcyjne%2C+Meble+ze+stali+nierdzewnej+i+kwasoodpornej.';
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();
};



