/* [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','4460',jdecode('Home'),jdecode(''),'/4460.html','true',[],'',''],
	['PAGE','4679',jdecode('News'),jdecode(''),'/4679.html','true',[],'',''],
	['PAGE','4598',jdecode('Photos'),jdecode(''),'/4598.html','true',[],'',''],
	['PAGE','99099',jdecode('Meine+Stars'),jdecode(''),'/99099.html','true',[],'',''],
	['PAGE','73639',jdecode('Contact'),jdecode(''),'/73639.html','true',[],'',''],
	['PAGE','9896',jdecode('Guestbook'),jdecode(''),'/9896/index.html','true',[ 
		['PAGE','9897',jdecode('Messages'),jdecode(''),'/9896/9897.html','false',[],'','']
	],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Bigcity_NYC';
theSitetree.paletteFamily='7C0B0B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17892';
theSitetree.graphicsetId='13164';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7C0B0B';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Bigcity_NYC',
				paletteFamily: 	'7C0B0B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17892',
				graphicsetId: 	'13164',
				contentColor: 	'FFFFFF',
				contentBGColor: '7C0B0B',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-9896ahp010in2lmo']={
webappId:    '1002',
documentId:  '9896',
internalId:  '9896ahp010in2lmo',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4460',
internalId:  '',
customField: '20090518-022527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20090518-020420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99099',
internalId:  '',
customField: '20100426-132922'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4460',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4679',
internalId:  '',
customField: '20100329-003517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73639',
internalId:  '',
customField: '20090701-233101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9896',
internalId:  '',
customField: '20090518-021410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9897',
internalId:  '',
customField: '20050414-135350'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010IN2LMO';
var companyName   = 'BeatoBiagio+';
var htmlTitle	  = 'Beato+Biagio+Pisa';
var metaKeywords  = 'beat%2C+beato%2C+biagio%2C+pisa%2C+song%2C+pisasong%2C+il+mio+grido%2C+a+chi%2C+management%2C+italienischer%2C+tenor%2C+s%EF%BF%BDnger%2C+chor%2C+taufe%2C+hochzeit%2C+gesang%2C+klassik%2C+klassisch%2C+pop%2C+schlager%2C+oper%2C+ave+maria%2C+granada%2C+amore+blue%2C+Tradition%2C+Stimme%2C+gewaltig%2C+show%2C+arie%2C+arien%2C+b%EF%BF%BDhne%2C+naturtalent%2C+verdi%2C+lucciano+pavarotti%2C+moncerat+caballet%2C+andrea+bocelli%2C+sarah+brightman%2C+placido+domingo%2C+jose+careras%2C+enrico+caruso%2C+franco+corelli%2C+mario+lanza%2C+puccini%2C+la+boheme%2C+granada%2C+ave+maria%2C+maria+callas%2C+giuseppe+di+stefano%2C+del+monaco%2C+bizet%2C+donizetti%2C+turandot%2C+nessun+dorma%2C+tenorissimo%2C+bellcanto%2C+classic%2C+classics%2C+helmut+lotti%2C+Maxi+CD%2C+Promotion%2C+vater+unser%2C+padre+nostro';
var metaContents  = 'Beato+Biagio+ein+Naturtalent%2C+der+Tenor+mit+Herz+und+Seele+der+Herzen+%EF%BF%BDffnet.+Lassen+Sie+sich+von+dieser+Stimme+verzaubern.+Sie+werden+begeistert+sein.';
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();
};
