/* [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','6201',jdecode('Home'),jdecode(''),'/6201.html','true',[],''],
	['PAGE','15501',jdecode('Bogus+Jiggy+on+My+Mind'),jdecode(''),'/15501.html','true',[],''],
	['PAGE','15522',jdecode('Spread+the+Word'),jdecode(''),'/15522/index.html','true',[ 
		['PAGE','15543',jdecode('How+Words+Become+Words'),jdecode(''),'/15522/15543.html','true',[],'']
	],''],
	['PAGE','15564',jdecode('Get+Your+Jiggy+On'),jdecode(''),'/15564.html','true',[],''],
	['PAGE','15585',jdecode('Bogus+Jiggy+Top+Tens'),jdecode(''),'/15585/index.html','true',[ 
		['PAGE','21301',jdecode('Ruining+the+Environment'),jdecode(''),'/15585/21301.html','true',[],''],
		['PAGE','28006',jdecode('Sex+and+the+City'),jdecode(''),'/15585/28006.html','true',[],'']
	],''],
	['PAGE','17801',jdecode('About+Bogus+Jiggy'),jdecode(''),'/17801.html','true',[],''],
	['PAGE','28027',jdecode('Bogus+Jiggy+Voting+Booth'),jdecode(''),'/28027.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Tide';
theSitetree.paletteFamily='B8B8B9';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='13625';
theSitetree.graphicsetId='12071';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Tide',
				paletteFamily: 	'B8B8B9',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'13625',
				graphicsetId: 	'12071',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20090428-001326'
};
webappMappings['7050']=webappMappings['7050-8545']={
webappId:    '7050',
documentId:  '15501',
internalId:  '8545',
customField: 'language:en;country:US;'
};
webappMappings['1003']=webappMappings['1003-aendu0in3waq120173d5a33']={
webappId:    '1003',
documentId:  '15564',
internalId:  'aendu0in3waq120173d5a33',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20090324-004853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15564',
internalId:  '',
customField: '20090318-003535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15522',
internalId:  '',
customField: '20090324-004203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15585',
internalId:  '',
customField: '20090318-223202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20090319-181400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15543',
internalId:  '',
customField: '20090318-003428'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21301',
internalId:  '',
customField: '20090324-004806'
};
webappMappings['7005']=webappMappings['7005-1891']={
webappId:    '7005',
documentId:  '28027',
internalId:  '1891',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28027',
internalId:  '',
customField: '20090427-235602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28006',
internalId:  '',
customField: '20090428-015539'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN3WAQ';
var companyName   = '+++++++++++++Bogus+Jiggy...+When+Life+Gives+You+Lemons';
var htmlTitle	  = 'Bogus+Jiggy';
var metaKeywords  = 'bogus+jiggy%2C+bogus%2C+jiggy%2C+when+life+gives+you+lemons%2C+sham%2C+disappointment%2C+lemon';
var metaContents  = 'A+bogus+jiggy+is+a+sham%2C+a+disappointment%2C+a+lemon.+From+high+culture+to+pop+culture%2C+current+events+to+current+obsessions%2C+read+about+and+share+bogus+jiggies+here.';
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();
};

