/* [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','1201',jdecode('HOME+'),jdecode(''),'/1201.html','true',[],'',''],
	['PAGE','5664',jdecode('MISSION+STATEMENT'),jdecode(''),'/5664.html','true',[],'',''],
	['PAGE','19701',jdecode('EXECUTIVE+BOARD'),jdecode(''),'/19701.html','true',[],'',''],
	['PAGE','32301',jdecode('DRAFT+CONVENTION+'),jdecode(''),'/32301.html','true',[],'',''],
	['PAGE','82701',jdecode('EGYPT'),jdecode(''),'/82701.html','true',[],'',''],
	['PAGE','91501',jdecode('ARTICLE+19'),jdecode(''),'/91501.html','true',[],'',''],
	['PAGE','61001',jdecode('UN+REACTION'),jdecode(''),'/61001.html','true',[],'',''],
	['PAGE','19101',jdecode('EAST+AFRICA+'),jdecode(''),'/19101.html','true',[],'',''],
	['PAGE','82101',jdecode('EUROPEAN+JOURNALISTS'),jdecode(''),'/82101.html','true',[],'',''],
	['PAGE','92601',jdecode('GAZA+WAR'),jdecode(''),'/92601.html','true',[],'',''],
	['PAGE','65401',jdecode('GEORGIAN+JOURNALISTS'),jdecode(''),'/65401.html','true',[],'',''],
	['PAGE','37501',jdecode('KENYA+'),jdecode(''),'/37501.html','true',[],'',''],
	['PAGE','19122',jdecode('WEST+AFRICA+'),jdecode(''),'/19122.html','true',[],'',''],
	['PAGE','5769',jdecode('IRAQI+JOURNALISTS'),jdecode(''),'/5769.html','true',[],'',''],
	['PAGE','93701',jdecode('IRAQ'),jdecode(''),'/93701.html','true',[],'',''],
	['PAGE','58801',jdecode('LEBANON+'),jdecode(''),'/58801.html','true',[],'',''],
	['PAGE','59301',jdecode('MOROCCO+'),jdecode(''),'/59301.html','true',[],'',''],
	['PAGE','22801',jdecode('MYANMAR'),jdecode(''),'/22801.html','true',[],'',''],
	['PAGE','5853',jdecode('PALESTINE+'),jdecode(''),'/5853.html','true',[],'',''],
	['PAGE','17601',jdecode('PAKISTAN'),jdecode(''),'/17601.html','true',[],'',''],
	['PAGE','17622',jdecode('SOMALIA+'),jdecode(''),'/17622.html','true',[],'',''],
	['PAGE','5937',jdecode('SRI+LANKA+'),jdecode(''),'/5937.html','true',[],'',''],
	['PAGE','37522',jdecode('SUDAN+'),jdecode(''),'/37522.html','true',[],'',''],
	['PAGE','82722',jdecode('SWITZERLAND'),jdecode(''),'/82722.html','true',[],'',''],
	['PAGE','9001',jdecode('UAE+JOURNALISTS+'),jdecode(''),'/9001.html','true',[],'',''],
	['PAGE','41001',jdecode('SOUTH+EAST+EUROPE+'),jdecode(''),'/41001.html','true',[],'',''],
	['PAGE','52301',jdecode('AMERICA+REACTS+'),jdecode(''),'/52301.html','true',[],'',''],
	['PAGE','38701',jdecode('RADIO+JOURNALISTS+'),jdecode(''),'/38701.html','true',[],'',''],
	['PAGE','49901',jdecode('SATELLITES+'),jdecode(''),'/49901.html','true',[],'',''],
	['PAGE','110901',jdecode('INTERNET+FREEDOMS+'),jdecode(''),'/110901.html','true',[],'',''],
	['PAGE','43201',jdecode('MONTHLY+REPORT+'),jdecode(''),'/43201.html','true',[],'',''],
	['PAGE','17643',jdecode('UNDER+ATTACK+'),jdecode(''),'/17643.html','true',[],'',''],
	['PAGE','83501',jdecode('UN+OHCHR+'),jdecode(''),'/83501.html','true',[],'',''],
	['PAGE','85401',jdecode('SPECIAL+'),jdecode(''),'/85401.html','true',[],'',''],
	['PAGE','54401',jdecode('GOOD+NEWS+'),jdecode(''),'/54401.html','true',[],'',''],
	['PAGE','9043',jdecode('MEMBERS+'),jdecode(''),'/9043.html','true',[],'',''],
	['PAGE','24701',jdecode('LINKS'),jdecode(''),'/24701.html','true',[],'',''],
	['PAGE','24722',jdecode('CONTACT+'),jdecode(''),'/24722.html','true',[],'','']];
var siteelementCount=38;
theSitetree.topTemplateName='Basic';
theSitetree.paletteFamily='36566E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10829';
theSitetree.graphicsetId='11283';
theSitetree.contentColor='36566E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Basic',
				paletteFamily: 	'36566E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10829',
				graphicsetId: 	'11283',
				contentColor: 	'36566E',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5664',
internalId:  '',
customField: '20071020-191156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1201',
internalId:  '',
customField: '20100408-110544'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19701',
internalId:  '',
customField: '20080611-113759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32301',
internalId:  '',
customField: '20080221-072052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82701',
internalId:  '',
customField: '20081208-143022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61001',
internalId:  '',
customField: '20080611-112418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20071019-222253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82101',
internalId:  '',
customField: '20081208-144347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65401',
internalId:  '',
customField: '20080918-113954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37501',
internalId:  '',
customField: '20080131-194017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19122',
internalId:  '',
customField: '20071019-222253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5769',
internalId:  '',
customField: '20081212-063051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58801',
internalId:  '',
customField: '20080511-102506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59301',
internalId:  '',
customField: '20080511-102404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20080221-072335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5853',
internalId:  '',
customField: '20080311-205238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20080412-101331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17622',
internalId:  '',
customField: '20081208-064601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5937',
internalId:  '',
customField: '20080127-191803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37522',
internalId:  '',
customField: '20080221-072548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82722',
internalId:  '',
customField: '20081209-091130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20080318-081231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41001',
internalId:  '',
customField: '20080412-102358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52301',
internalId:  '',
customField: '20080405-220210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38701',
internalId:  '',
customField: '20080122-094643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49901',
internalId:  '',
customField: '20080312-093314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43201',
internalId:  '',
customField: '20080503-091027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17643',
internalId:  '',
customField: '20080503-091500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83501',
internalId:  '',
customField: '20081209-091833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85401',
internalId:  '',
customField: '20081209-093104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54401',
internalId:  '',
customField: '20080412-132714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9043',
internalId:  '',
customField: '20090824-085447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24701',
internalId:  '',
customField: '20071020-103346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24722',
internalId:  '',
customField: '20071023-162750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91501',
internalId:  '',
customField: '20090202-082354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92601',
internalId:  '',
customField: '20090202-092939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93701',
internalId:  '',
customField: '20090228-083257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110901',
internalId:  '',
customField: '20100408-105624'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INECY6';
var companyName   = 'International+Covenant+for+the+Protection+of+Journalists+%28ICPJ%29+';
var htmlTitle	  = 'INTERNATIONAL+COVENANT+FOR+THE+PROTECTION+OF+JOURNALISTS';
var metaKeywords  = 'CONVENTION+';
var metaContents  = 'MEDIA+COVENANT';
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();
};
