/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','6943',jdecode('Entertainment'),jdecode(''),'/6943/index.html','true',[ 
		['PAGE','6964',jdecode('Band+%26+Corporate+Show'),jdecode(''),'/6943/6964.html','true',[],'',''],
		['PAGE','6985',jdecode('Young+Belafonte'),jdecode(''),'/6943/6985.html','true',[],'',''],
		['PAGE','7006',jdecode('+Rat+Pack+%26+Supremes'),jdecode(''),'/6943/7006.html','true',[],'','']
	],'',''],
	['PAGE','7027',jdecode('Contact+%26+Merchantdise'),jdecode(''),'/7027.html','true',[],'',''],
	['PAGE','7048',jdecode('Schedule'),jdecode(''),'/7048.html','true',[],'',''],
	['PAGE','27306',jdecode('Guestbook'),jdecode(''),'/27306.html','true',[],'',''],
	['PAGE','27301',jdecode('Read+Guestbook'),jdecode(''),'/27301.html','false',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Digital';
theSitetree.paletteFamily='010128';
theSitetree.keyvisualId='343';
theSitetree.keyvisualName='security.jpg';
theSitetree.fontsetId='38';
theSitetree.graphicsetId='42';
theSitetree.contentColor='DEFDFB';
theSitetree.contentBGColor='010128';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'aplus',
  product: 'WSCSYSSSSLYTCPZ2'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Digital',
				paletteFamily: 	'010128',
				keyvisualId: 	'343',
				keyvisualName: 	'security.jpg',
				fontsetId: 		'38',
				graphicsetId: 	'42',
				contentColor: 	'DEFDFB',
				contentBGColor: '010128',
				a_color: 		'010128',
				b_color: 		'DEFDFB',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-27306aaplu0in3iq5']={
webappId:    '1002',
documentId:  '27306',
internalId:  '27306aaplu0in3iq5',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-8382518']={
webappId:    '1501',
documentId:  '401',
internalId:  '8382518',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100609-150815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6943',
internalId:  '',
customField: '20100609-143201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6964',
internalId:  '',
customField: '20110529-221259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6985',
internalId:  '',
customField: '20101020-191105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7006',
internalId:  '',
customField: '20110529-203229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7027',
internalId:  '',
customField: '20110530-152512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7048',
internalId:  '',
customField: '20110515-061255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27306',
internalId:  '',
customField: '20100609-163826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27301',
internalId:  '',
customField: '20080727-061441'
};
var webAppHostname = 'cm4all.aplus.net:80';
var canonHostname = 'cm4all01.carrierzone.com';
var accountId     = 'AAPLU0IN3IQ5';
var companyName   = 'Universal+Nites+Productions';
var htmlTitle	  = 'UNIVERSAL+NITES+PRODUCTIONS';
var metaKeywords  = 'Entertainment%2FTribute+Shows';
var metaContents  = 'Entertainment+at+its+best';
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();
};

