/* [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','4598',jdecode('Home'),jdecode(''), jdecode('%2F4598.html'), 'true',[],'',''],
	['PAGE','354727',jdecode('News'),jdecode(''), jdecode('%2F354727.html'), 'true',[],'',''],
	['PAGE','358772',jdecode('In+Arbeit'),jdecode(''), jdecode('%2F358772.html'), 'true',[],'',''],
	['PAGE','155215',jdecode('Damen+'),jdecode(''), jdecode('%2F155215%2Findex.html'), 'true',[ 
		['PAGE','351873',jdecode('Arwen+Kleider'),jdecode(''), jdecode('%2F155215%2F351873.html'), 'true',[],'',''],
		['PAGE','357649',jdecode('Reitmantel'),jdecode(''), jdecode('%2F155215%2F357649.html'), 'true',[],'',''],
		['PAGE','357658',jdecode('Engelskleid'),jdecode(''), jdecode('%2F155215%2F357658.html'), 'true',[],'',''],
		['PAGE','356996',jdecode('Bridge+Dress'),jdecode(''), jdecode('%2F155215%2F356996.html'), 'true',[],'',''],
		['PAGE','357667',jdecode('Farewell+Dress'),jdecode(''), jdecode('%2F155215%2F357667.html'), 'true',[],'',''],
		['PAGE','357676',jdecode('Hope+Dress'),jdecode(''), jdecode('%2F155215%2F357676.html'), 'true',[],'',''],
		['PAGE','357180',jdecode('Cranberry+Velvet'),jdecode(''), jdecode('%2F155215%2F357180.html'), 'true',[],'',''],
		['PAGE','357685',jdecode('Anfurten+Kleid'),jdecode(''), jdecode('%2F155215%2F357685.html'), 'true',[],'',''],
		['PAGE','357501',jdecode('Blood+Red+Dress'),jdecode(''), jdecode('%2F155215%2F357501.html'), 'true',[],'',''],
		['PAGE','357694',jdecode('Kr%C3%B6nungskleid'),jdecode(''), jdecode('%2F155215%2F357694.html'), 'true',[],'',''],
		['PAGE','357492',jdecode('Rose+Dress'),jdecode(''), jdecode('%2F155215%2F357492.html'), 'true',[],'',''],
		['PAGE','357483',jdecode('Bogen+Kleid'),jdecode(''), jdecode('%2F155215%2F357483.html'), 'true',[],'',''],
		['PAGE','357703',jdecode('Lila+besticktes+Kleid'),jdecode(''), jdecode('%2F155215%2F357703.html'), 'true',[],'',''],
		['PAGE','357712',jdecode('Battle+Dress'),jdecode(''), jdecode('%2F155215%2F357712.html'), 'true',[],'',''],
		['PAGE','351882',jdecode('Galadriel+Kleid'),jdecode(''), jdecode('%2F155215%2F351882.html'), 'true',[],'',''],
		['PAGE','358254',jdecode('Elben+Kleider'),jdecode(''), jdecode('%2F155215%2F358254.html'), 'true',[],'','']
	],'',''],
	['PAGE','356908',jdecode('Herren+'),jdecode(''), jdecode('%2F356908%2Findex.html'), 'true',[ 
		['PAGE','247777',jdecode('Haldirs+Uniform'),jdecode(''), jdecode('%2F356908%2F247777.html'), 'true',[],'',''],
		['PAGE','273678',jdecode('Gondor+Unifom'),jdecode(''), jdecode('%2F356908%2F273678.html'), 'true',[],'',''],
		['PAGE','255520',jdecode('Th%C3%A9odens+Tunika'),jdecode(''), jdecode('%2F356908%2F255520.html'), 'true',[],'','']
	],'',''],
	['PAGE','315510',jdecode('Email'),jdecode(''), jdecode('%2F315510.html'), 'true',[],'',''],
	['PAGE','354921',jdecode('Links'),jdecode(''), jdecode('%2F354921.html'), 'true',[],'',''],
	['PAGE','40747',jdecode('Guestbook'),jdecode(''), jdecode('%2F40747.html'), 'true',[],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Comedy';
theSitetree.paletteFamily='85A246';
theSitetree.keyvisualId='2796';
theSitetree.keyvisualName='spirale.jpg';
theSitetree.fontsetId='10601';
theSitetree.graphicsetId='10719';
theSitetree.contentColor='F2F5EA';
theSitetree.contentBGColor='9EBA61';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Comedy',
				paletteFamily: 	'85A246',
				keyvisualId: 	'2796',
				keyvisualName: 	'spirale.jpg',
				fontsetId: 		'10601',
				graphicsetId: 	'10719',
				contentColor: 	'F2F5EA',
				contentBGColor: '9EBA61',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'647C2F',
				e_color: 		'647C2F',
				f_color: 		'647C2F',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-40747ABW0X0INXEUO']={
webappId:    '1002',
documentId:  '40747',
internalId:  '40747ABW0X0INXEUO',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357703',
internalId:  '-',
customField: '20111113-200505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '354921',
internalId:  '',
customField: '20120128-002823'
};
webappMappings['1002']=webappMappings['1002-40747ABW0X0INXEUO']={
webappId:    '1002',
documentId:  '38804',
internalId:  '40747ABW0X0INXEUO',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20120131-090631'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357685',
internalId:  '-',
customField: '20111113-200054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '354727',
internalId:  '',
customField: '20120130-233124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '155215',
internalId:  '',
customField: '20120116-015151'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '358772',
internalId:  '-',
customField: '20120131-165633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '351873',
internalId:  '',
customField: '20111115-001045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '351882',
internalId:  '',
customField: '20110926-102711'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357501',
internalId:  '-',
customField: '20120131-170715'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357649',
internalId:  '-',
customField: '20111116-185739'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357658',
internalId:  '-',
customField: '20111123-193829'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '356996',
internalId:  '-',
customField: '20111110-003518'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357180',
internalId:  '-',
customField: '20111111-023908'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357483',
internalId:  '-',
customField: '20120120-154909'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357492',
internalId:  '-',
customField: '20111113-200229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '356908',
internalId:  '',
customField: '20110603-040304'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357712',
internalId:  '-',
customField: '20111113-053623'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '358254',
internalId:  '-',
customField: '20120120-164759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '247777',
internalId:  '',
customField: '20110603-040137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '255520',
internalId:  '',
customField: '20051022-002853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '273678',
internalId:  '',
customField: '20110603-035408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '315510',
internalId:  '',
customField: '20111111-224422'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357694',
internalId:  '-',
customField: '20120129-023107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40747',
internalId:  '',
customField: '20120124-144605'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357676',
internalId:  '-',
customField: '20120128-005924'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '357667',
internalId:  '-',
customField: '20120109-153902'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXEUO';
var companyName   = 'Eryndis+Waldlichtung';
var htmlTitle	  = 'Herr+der+Ringe+Film-Kleider+Elben+und+Elfen+Gew%C3%A4nder';
var metaKeywords  = 'Herr+der+Ringe+Kost%C3%BCme%2C+Mittelerde+Arwen++%C3%89owyn+Galadriel+Elrond+Elben+Tolkien';
var metaContents  = 'Herr+der+Ringe+Filmkost%C3%BCme';
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();
};

