/* [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','701',jdecode('INICIO'),jdecode(''), jdecode('%2F701.html'), 'true',[],'',''],
	['PAGE','752',jdecode('GALER%C3%8DA+DE+FOTOS'),jdecode(''), jdecode('%2F752.html'), 'true',[],'',''],
	['PAGE','59101',jdecode('CONTACTO'),jdecode(''), jdecode('%2F59101.html'), 'true',[],'',''],
	['PAGE','10401',jdecode('DONDE+ESTAMOS%3F'),jdecode(''), jdecode('%2F10401.html'), 'true',[],'',''],
	['PAGE','794',jdecode('COMO+IR+A...%3F'),jdecode(''), jdecode('%2F794.html'), 'true',[],'','']];
var siteelementCount=5;
theSitetree.topTemplateName='Motel';
theSitetree.paletteFamily='AC1313';
theSitetree.keyvisualId='12064';
theSitetree.keyvisualName='kv_12064.jpg';
theSitetree.fontsetId='33289';
theSitetree.graphicsetId='14166';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'piensa',
  product: 'WSCSYSSSSLYTC2IO'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Motel',
				paletteFamily: 	'AC1313',
				keyvisualId: 	'12064',
				keyvisualName: 	'kv_12064.jpg',
				fontsetId: 		'33289',
				graphicsetId: 	'14166',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20110315-224102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20101013-082416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59101',
internalId:  '',
customField: '20101027-222513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20110317-213710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20081003-185944'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INV9KZ';
var companyName   = 'www.hotelabelay.es';
var htmlTitle	  = 'Hotel+Abelay-Palma+de+Mallorca';
var metaKeywords  = 'afellay%2C+ibrahim+afellay%2C+afelai%2C+afelay%2C+Hotel+cerca+UIB%2C+hotel+cerca+Universidad+Illes+Balears%2C+Hotel+cerca+Son+Dureta%2C+Hotel+Abelay%2C+hotel%2C+abelay%2C+Palma%2C+Plaza+Toros%2C+plaza+de+toros%2C+Palma+de+Mallorca%2C+plaza+de+espa%C3%B1a%2C+valldemossa%2C+centro%2C+ciudad%2C+empresas%2C+restaurante%2C+abelay%2C+poligono+Son+Castello%2C+poligono%2C+Can+Valero%2C+hotel+abelux%2C+abelux%2C++hotel+palma%2C+hotel+palma+mallorca%2C+hotel+barato%2C+hotelabelay.es%2C+hoteles+baratos+palma%2C+hotel+barato+palma%2Choteles+baratos+palma+mallorca%2C+hotel+barato+palma+mallorca%2C+hotel+piscinas+son+hugo%2C+hotel+palma+arena%2C+hotel+son+hugo%2C+dropkick+new+album%2C+dropkick+abelay+hotel%2C+dropkick+abelay%2C+conservatorio+palma+mallorca+hotel%2C+hotel+conservatorio+palma%2C+conservatorio+palma+hotel%2C+alejandro+sanz%2C+hotel+plaza+de+toros%2C+david+bisbal+palma%2C+elton+john+palma%2C+palma+arena%2C+';
var metaContents  = 'Hotel+ABELAY.+Situado+junto+a+la+plaza+de+toros+de+Palma+y+a+escasos+cinco+minutos+de+la+plaza+de+espa%C3%B1a%2C+centro+de+la+ciudad.+El+hotel+esta+cerca+de+los+pol%C3%ADgonos+industriales+de+Son+Castello+y+Can+Valero%2C+de+las+piscinas+de+son+Hugo+y+del+Palma+Arena';
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();
};

