/* [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('EMPRESA'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','15301',jdecode('VIDEOCONFER%C3%8ANCIA'),jdecode(''),'/15301.html','true',[],'',''],
	['PAGE','4001',jdecode('MOBILE+MARKETING'),jdecode(''),'/4001.html','true',[],'',''],
	['PAGE','30301',jdecode('I%26D'),jdecode(''),'/30301.html','true',[],'',''],
	['PAGE','34101',jdecode('PARCEIROS'),jdecode(''),'/34101.html','true',[],'',''],
	['PAGE','4022',jdecode('CASOS'),jdecode(''),'/4022.html','true',[],'',''],
	['PAGE','4043',jdecode('NOTICIAS'),jdecode(''),'/4043.html','true',[],'',''],
	['PAGE','5801',jdecode('NEWSLETTER'),jdecode(''),'/5801/index.html','true',[ 
		['PAGE','6801',jdecode('Newsletter%28p%C3%A1gina+seguir%29'),jdecode(''),'/5801/6801.html','false',[],'','']
	],'',''],
	['PAGE','4064',jdecode('CONTACTOS'),jdecode(''),'/4064.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Measure';
theSitetree.paletteFamily='8A9FD6';
theSitetree.keyvisualId='3874';
theSitetree.keyvisualName='kv_3874.jpg';
theSitetree.fontsetId='10705';
theSitetree.graphicsetId='11068';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'PT'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Measure',
				paletteFamily: 	'8A9FD6',
				keyvisualId: 	'3874',
				keyvisualName: 	'kv_3874.jpg',
				fontsetId: 		'10705',
				graphicsetId: 	'11068',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'4F65A0',
				e_color: 		'4F65A0',
				f_color: 		'4F65A0',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100618-231639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20100607-133709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4022',
internalId:  '',
customField: '20100211-182901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4043',
internalId:  '',
customField: '20100506-165331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4064',
internalId:  '',
customField: '20091230-012640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20091230-013305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20080523-140512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15301',
internalId:  '',
customField: '20100618-231105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34101',
internalId:  '',
customField: '20100506-163814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20100607-134707'
};
webappMappings['7008']=webappMappings['7008-6670']={
webappId:    '7008',
documentId:  '5801',
internalId:  '6670',
customField: 'language:pt;country:PT;'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20IN36E8';
var companyName   = '';
var htmlTitle	  = '';
var metaKeywords  = 'video+chamada++3g++video+interprete++comunidade+surda++interpretes+por+video++videoconferencia++video+conferencia++grandstream++tandberg++radvision++scopia++transito++servi%C3%A7o+de+transito++tmn++vodafone++optimus++pt++cofidis++web+phone+agendamento+automatico+agendamento+sem+custos';
var metaContents  = 'Video+chamada%2C+3g%2C+vodafone%2C+cofidis%2C+surdos%2C+video+click+to+call%2C+click+to+call%2C+agente+em+video%2Ccriar+leads%2C+camaras+de+transito%2C+comunidade+surda%2C+tandberg%2C+radvision%2C+videoconferencia%2C+scopia%2C+APS%2C+associa%C3%A7%C3%A3o+portuguesa+de+surdos%2C+servi%C3%A7o+de+video+interprete%2C+agendamento+automatico%2C+phone+web%2C+web+phone%2C+agendamento+automatico';
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();
};
