/* [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 theSitetree=[ 
	['PAGE','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','5301',jdecode('AC+Milan+Prostars'),jdecode(''),'/5301.html','true',[],''],
	['PAGE','16201',jdecode('Select+500'),jdecode(''),'/16201.html','true',[],''],
	['PAGE','5385',jdecode('Baggio+Collection'),jdecode(''),'/5385.html','true',[],''],
	['PAGE','16222',jdecode('Maldini+Collection'),jdecode(''),'/16222.html','true',[],''],
	['PAGE','24401',jdecode('Xls'),jdecode(''),'/24401.html','true',[],''],
	['PAGE','80901',jdecode('Platinum'),jdecode(''),'/80901.html','true',[],''],
	['PAGE','5322',jdecode('Italy+Prostars'),jdecode(''),'/5322.html','true',[],''],
	['PAGE','5364',jdecode('Other+Figures'),jdecode(''),'/5364.html','true',[],''],
	['PAGE','5343',jdecode('Other+Prostars'),jdecode(''),'/5343.html','true',[],''],
	['PAGE','61401',jdecode('Memorabilia'),jdecode(''),'/61401.html','true',[],''],
	['PAGE','135101',jdecode('Swap%2FSale'),jdecode(''),'/135101.html','true',[],''],
	['PAGE','72401',jdecode('Wanted+List'),jdecode(''),'/72401.html','true',[],''],
	['PAGE','82201',jdecode('Release+Calendar'),jdecode(''),'/82201.html','true',[],''],
	['PAGE','62701',jdecode('Newspaper+collection'),jdecode(''),'/62701.html','true',[],''],
	['PAGE','14201',jdecode('Marco+%26+Cla%26%23x27%3Bs+photos'),jdecode(''),'/14201.html','true',[],''],
	['PAGE','28801',jdecode('Champions+L.+Story'),jdecode(''),'/28801.html','true',[],''],
	['PAGE','39401',jdecode('AC+Milan%26%23x27%3Bs+ballon+d%26%23x27%3Bor'),jdecode(''),'/39401.html','true',[],''],
	['PAGE','13301',jdecode('Write+me'),jdecode(''),'/13301.html','true',[],''],
	['PAGE','27601',jdecode('Links'),jdecode(''),'/27601.html','true',[],''],
	['PAGE','60901',jdecode('Collector%26%23x27%3Bs+area'),jdecode(''),'/60901.html','true',[],''],
	['PAGE','93401',jdecode('Video+Milan'),jdecode(''),'/93401.html','true',[],'']];
var siteelementCount=22;
theSitetree.topTemplateName='Noble';
theSitetree.paletteFamily='960000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17227';
theSitetree.graphicsetId='12669';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='960000';
var localeDef={
  language: 'it',
  country: 'IT'
};
var theTemplate={
				name: 			'Noble',
				paletteFamily: 	'960000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17227',
				graphicsetId: 	'12669',
				contentColor: 	'FFFFFF',
				contentBGColor: '960000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090601-205723'
};
webappMappings['7008']=webappMappings['7008-2656']={
webappId:    '7008',
documentId:  '13301',
internalId:  '2656',
customField: 'language:it;country:IT;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20090519-110212'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5322',
internalId:  '',
customField: '20080603-141842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5343',
internalId:  '',
customField: '20080527-143906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5364',
internalId:  '',
customField: '20080928-140331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5385',
internalId:  '',
customField: '20090506-223730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20071119-152140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16222',
internalId:  '',
customField: '20080527-143606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20081204-202516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16201',
internalId:  '',
customField: '20090506-223547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61401',
internalId:  '',
customField: '20080227-205511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24401',
internalId:  '',
customField: '20090131-202444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20090218-162244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28801',
internalId:  '',
customField: '20071207-120250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39401',
internalId:  '',
customField: '20071206-225343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72401',
internalId:  '',
customField: '20090428-090101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93401',
internalId:  '',
customField: '20080516-161443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82201',
internalId:  '',
customField: '20090526-111906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80901',
internalId:  '',
customField: '20080811-212543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135101',
internalId:  '',
customField: '20090601-204411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60901',
internalId:  '',
customField: '20071227-122748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62701',
internalId:  '',
customField: '20071218-152356'
};
var canonHostname = 'fe3.cm4all.tiscali.sys';
var accountId     = 'ATC030INXHKE';
var companyName   = 'Marco+e+Claudio+Corinthian';
var htmlTitle	  = '%2FMarcoClaudioCorinthianProstars';
var metaKeywords  = 'marco%2Cclaudio%2Ccorinthian%2Cprostars%2Cac+milan%2C';
var metaContents  = 'Collection+of+AC+Milan+and+Italy+Corinthian+Prostars+';
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();
};

