/* [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','2201',jdecode('Home'),jdecode(''),'/2201.html','true',[],''],
	['PAGE','2252',jdecode('Golden+Boy+Mike'),jdecode(''),'/2252.html','true',[],''],
	['PAGE','2273',jdecode('MJS+Productions'),jdecode(''),'/2273.html','true',[],''],
	['PAGE','2294',jdecode('Artist+Management'),jdecode(''),'/2294.html','true',[],''],
	['PAGE','2315',jdecode('VIP+Membership'),jdecode(''),'/2315.html','true',[],''],
	['PAGE','2336',jdecode('Pictures'),jdecode(''),'/2336.html','true',[],''],
	['PAGE','2357',jdecode('MJS+Records'),jdecode(''),'/2357.html','true',[],''],
	['PAGE','2378',jdecode('Guest+Book'),jdecode(''),'/2378.html','true',[],''],
	['PAGE','2399',jdecode('Contact+and+Jobs'),jdecode(''),'/2399.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Stars';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10466';
theSitetree.graphicsetId='10916';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Stars',
				paletteFamily: 	'000000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10466',
				graphicsetId: 	'10916',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20100217-165115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20100217-165334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2273',
internalId:  '',
customField: '20100217-165758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2357',
internalId:  '',
customField: '20100216-214147'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2294',
internalId:  '',
customField: '20100217-170453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2315',
internalId:  '',
customField: '20100216-211427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2336',
internalId:  '',
customField: '20100216-060339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2378',
internalId:  '',
customField: '20100210-230558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2399',
internalId:  '',
customField: '20100210-230625'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2201',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2252',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2273',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2294',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2315',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2336',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2357',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2378',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2399',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-25920']={
webappId:    '7008',
documentId:  '2399',
internalId:  '25920',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-2378aendu0inl14g']={
webappId:    '1002',
documentId:  '2378',
internalId:  '2378aendu0inl14g',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-27583718']={
webappId:    '1501',
documentId:  '2201',
internalId:  '27583718',
customField: '1501'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INL14G';
var companyName   = 'MJS+Productions+-+since+1987';
var htmlTitle	  = 'MJS+Productions';
var metaKeywords  = 'MJS+Productions%2C+Golden+Boy+Mike%2C+Dj%2C+San+Diego+Dj%2C+Dj+Bookings%2C+GoGo+Dancer%2C+GoGo+Dancer+Bookings%2C+Artist+Management%2C+VIP%2C+MJS+Records%2C+Trance+Music%2C+San+Diego+Nightclubs%2C+Nightclubs%2C+New+Years+Eve%2C+Halloween%2C+Nightclub+Promotions+';
var metaContents  = 'MJS+Productions+was+founded+by+Golden+Boy+Mike+who+finished+2009+ranked+as+the+%231+Dj+in+San+Diego%2C+%23+63+Dj+in+the+United+States%2C+and+%23+92+Trance+Music+Dj+in+the+World+at+www.TheDjList.com.++MJS+Productions+provides+Dj+and+GoGo+Dancer+Bookings%2C+Artist+Management%2C+and+Nightclub+Promotions+and+Consultations+to+nightclubs+in+San+Diego+and+Southern+California.';
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();
};
