/* [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','1501',jdecode('Home'),jdecode(''), jdecode('%2F1501.html'), 'true',[],'',''],
	['PAGE','48001',jdecode('Taxi-Dienst'),jdecode(''), jdecode('%2F48001.html'), 'true',[],'',''],
	['PAGE','2101',jdecode('Kontakt'),jdecode(''), jdecode('%2F2101.html'), 'true',[],'',''],
	['PAGE','2122',jdecode('Kontakformular'),jdecode(''), jdecode('%2F2122.html'), 'true',[],'',''],
	['PAGE','2143',jdecode('Taxi+%26+Limousinen'),jdecode(''), jdecode('%2F2143.html'), 'true',[],'',''],
	['PAGE','38001',jdecode('VW+T5+Limousine'),jdecode(''), jdecode('%2F38001.html'), 'true',[],'',''],
	['PAGE','50001',jdecode('Buick+Electra+1959'),jdecode(''), jdecode('%2F50001.html'), 'true',[],'',''],
	['PAGE','27201',jdecode('Stretch-Limousine'),jdecode(''), jdecode('%2F27201.html'), 'true',[],'',''],
	['PAGE','48801',jdecode('Personenschutz'),jdecode(''), jdecode('%2F48801.html'), 'true',[],'',''],
	['PAGE','2164',jdecode('Referenzen'),jdecode(''), jdecode('%2F2164.html'), 'true',[],'',''],
	['PAGE','8401',jdecode('Preise'),jdecode(''), jdecode('%2F8401.html'), 'true',[],'',''],
	['PAGE','8801',jdecode('Leistungen'),jdecode(''), jdecode('%2F8801.html'), 'true',[],'',''],
	['PAGE','50901',jdecode('iPhone+Tuning'),jdecode(''), jdecode('%2F50901.html'), 'true',[],'',''],
	['PAGE','10801',jdecode('Links'),jdecode(''), jdecode('%2F10801.html'), 'true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Shield';
theSitetree.paletteFamily='F3F6D5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10415';
theSitetree.graphicsetId='10687';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F3F6D5';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Shield',
				paletteFamily: 	'F3F6D5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10415',
				graphicsetId: 	'10687',
				contentColor: 	'000000',
				contentBGColor: 'F3F6D5',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'F30606',
				e_color: 		'6969FA',
				f_color: 		'7F7E7E',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1501',
internalId:  '',
customField: '20120115-132851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2143',
internalId:  '',
customField: '20110130-215237'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20101213-194201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2164',
internalId:  '',
customField: '20110130-215002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2122',
internalId:  '',
customField: '20091007-200056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20110813-203057'
};
webappMappings['7008']=webappMappings['7008-7509']={
webappId:    '7008',
documentId:  '2122',
internalId:  '7509',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20091007-195957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20110415-114816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20110125-200540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50001',
internalId:  '',
customField: '20110813-202851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38001',
internalId:  '',
customField: '20110125-194532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48001',
internalId:  '',
customField: '20110201-083033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48801',
internalId:  '',
customField: '20110415-112619'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '50901',
internalId:  '-',
customField: '20120115-132457'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEYQ5';
var companyName   = 'Tinos+PowerService';
var htmlTitle	  = 'Tinos+PowerService+-+Chauffeur-+Dienste+und+mehr...';
var metaKeywords  = 'VIP-Limousinen%2C+Fahrer+gesucht%2C+Inland%2CAusland%2C+Taxi%2C+Tinos+PowerService%2C+Aushilfe+Chauffeur%2C+Mieten%2C+iPhone-Umbau%2C+iPhone-Reparatur%2C+iPhone-Farben%2C+iPhone-Glas+kaputt.';
var metaContents  = 'Mieten%2C+Fahrer%2C+Chauffeur%2C+Taxi%2C+Limousinen%2C+Ausland%2C+Inland%2C+Aushilfe%2C+buchen%2CTaxi-Dienste%2CPf%C3%A4ffikon%2CMercedes%2CT5+VW%2CTinos+PowerService%2CiPhone-umbau%2CiPhone-Glas+kaputt%2CiPhone-farben%2CiPhone-Reparatur%2CiPhone+Tuning.';
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();
};

