/* [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','3601',jdecode('Home'),jdecode(''),'/3601.html','true',[],''],
	['PAGE','3673',jdecode('Events'),jdecode(''),'/3673.html','true',[],''],
	['PAGE','3694',jdecode('Contact'),jdecode(''),'/3694.html','true',[],''],
	['PAGE','3715',jdecode('Residencies'),jdecode(''),'/3715.html','true',[],''],
	['PAGE','3736',jdecode('Past+Residencies'),jdecode(''),'/3736.html','true',[],'']];
var siteelementCount=5;
theSitetree.topTemplateName='Push';
theSitetree.paletteFamily='FF6E09';
theSitetree.keyvisualId='11121';
theSitetree.keyvisualName='kv_11121.jpg';
theSitetree.fontsetId='32013';
theSitetree.graphicsetId='13841';
theSitetree.contentColor='387074';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Push',
				paletteFamily: 	'FF6E09',
				keyvisualId: 	'11121',
				keyvisualName: 	'kv_11121.jpg',
				fontsetId: 		'32013',
				graphicsetId: 	'13841',
				contentColor: 	'387074',
				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: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20100314-172143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3673',
internalId:  '',
customField: '20100314-165805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3694',
internalId:  '',
customField: '20091219-040307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3715',
internalId:  '',
customField: '20091219-040934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3736',
internalId:  '',
customField: '20091219-041313'
};
webappMappings['1501']=webappMappings['1501-25768004']={
webappId:    '1501',
documentId:  '3601',
internalId:  '25768004',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3601',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEL29';
var companyName   = 'DJ++Hydro';
var htmlTitle	  = 'DJ+HYDRO';
var metaKeywords  = 'DJ+Services%2C+DJ%2C+DJs%2C+DJing%2C+DJ+HYDRO%2C+djhydro.com%2C+mixmaster%2C+mixmasters%2C+casey+morans%2C+casey+morans%2C+mixing%2C+dj+mixing%2C+dj+mixing+services%2C+chicago+djs%2C+chicago+dj%2C+indiana+dj%2C+indiana+djs%2C+mixmasteronline%2C+mixnight%2C+djay+hydro%2C+dj+wanted%2C+dee+jay%2C+vj%2C+vee+jay%2C+VJs%2C+VJing%2C+Club+VJ%2C+Internet+DJ%2C+Internet+VJ%2C+VJ%2C+Video+Jockey%2C+Private+Events%2C+Club+Events%2C+shoes%2C+parties%2C+holiday+parties%2C+traveling+dj%2C+traveling+vj%2C+mobile+vj%2C+traveling+dj%2C+raggeaton%2C+raggeaton+vj%2C+raggeaton+dj%2C+m2i%2C+m%5E2i%2C++';
var metaContents  = 'VJ%2FDJ+Hydro+is+a+Chicago-based+DJ+who+remixes+hip-hop%2C+house%2C+electro%2C+rock%2C+80s+retro%2C+techno%2C+disco%2C+and+reggaeton%2C+in+a+coalesce%2C+of+musical+arithmetic.++He+also+mixes+videos+to+create+visuals+to+compliment+the+music.++Though+he+is+known+as+a+hip-hop+DJ%2C+his+mixes+have+subtle+overtones+of+the+Chicago+House+genre%2C+with+the+strongest+influence+being+from+the+Hot+Mix+5.';
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();
};
