/* [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 theSitetree=[ 
	['PAGE','4601',jdecode('ALGRAZIS'),jdecode(''),'/4601.html','true',[],''],
	['PAGE','30101',jdecode('NOWO%C5%9ACI'),jdecode(''),'/30101.html','true',[],''],
	['PAGE','7122',jdecode('NASZE+PSY'),jdecode(''),'/7122/index.html','true',[ 
		['PAGE','7143',jdecode('PIKSEL'),jdecode(''),'/7122/7143.html','true',[],''],
		['PAGE','7164',jdecode('LEXUS'),jdecode(''),'/7122/7164.html','true',[],''],
		['PAGE','15401',jdecode('SNICKERS'),jdecode(''),'/7122/15401.html','true',[],'']
	],''],
	['PAGE','15422',jdecode('NASZE+SUKI'),jdecode(''),'/15422/index.html','true',[ 
		['PAGE','15443',jdecode('COGIE'),jdecode(''),'/15422/15443.html','true',[],''],
		['PAGE','15464',jdecode('MAGIA'),jdecode(''),'/15422/15464.html','true',[],'']
	],''],
	['PAGE','12501',jdecode('SZCZENI%C4%98TA'),jdecode(''),'/12501.html','true',[],''],
	['PAGE','12522',jdecode('FOTOGALERIA'),jdecode(''),'/12522.html','true',[],''],
	['PAGE','12543',jdecode('LINKI'),jdecode(''),'/12543.html','true',[],''],
	['PAGE','7269',jdecode('KONTAKT'),jdecode(''),'/7269.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Tide';
theSitetree.paletteFamily='314EB6';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='27983';
theSitetree.graphicsetId='12065';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pl',
  country: 'PL'
};
var theTemplate={
				name: 			'Tide',
				paletteFamily: 	'314EB6',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'27983',
				graphicsetId: 	'12065',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20090815-165258'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '4601',
internalId:  '1501',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7122',
internalId:  '',
customField: '20080922-162727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7143',
internalId:  '',
customField: '20090815-150933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7164',
internalId:  '',
customField: '20090815-154503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15464',
internalId:  '',
customField: '20090815-155059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15443',
internalId:  '',
customField: '20090815-154917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15422',
internalId:  '',
customField: '20090815-160041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20090815-154629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7269',
internalId:  '',
customField: '20090815-160538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20090308-212709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12522',
internalId:  '',
customField: '20090308-212709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12543',
internalId:  '',
customField: '20090308-212709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30101',
internalId:  '',
customField: '20090816-131706'
};
var canonHostname = 'wsc0.home.net.pl';
var accountId     = 'AHPL10INLYXU';
var companyName   = '++++++++++++++ALGRAZIS';
var htmlTitle	  = 'Hodowla+owczark%C3%B3w+szetlandzkich+ALGRAZIS';
var metaKeywords  = 'Owczarki+szetlandzkie%2C+Piksel.+Lexus%2C+Snikers%2C+Cogisia%2C+Magia%2C+Sheltie%2C+wystawy%2C+CACIB%2C+CAC%2C+CWC%2C+szetland%2C+szczeni%C4%99ta%2C+zwyci%C4%99stwo%2C+ranking%2C+tri%2C+%C5%9Bniady%2C+merle%2C+hodowla%2C+kennel%2C+owczarek%2C+Wsp%C3%B3lny+Dom%2C+Vanilla+Hills%2C+Archos%2C+Canis%2C+zwyci%C4%99zca%2C+BOB%2C+sheltie%2C+Magical+Monndance%2C+Quashie%2C+Great+Britain%2C+agility%2C+shetland+sheepdog%2C+FCI%2C+blue+merle%2C+best+of+breed%2C+wystawa+%C5%9Bwiatowa%2C+';
var metaContents  = 'Owczarki+szetlandzkie+-+Piksel.+Lexus%2C+Snikers%2C+Cogie%2C+Magia%2C+Shelti';
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();
};

