/* [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','38201',jdecode('allheatradio.com'),jdecode(''),'/38201.html','true',[],'']];
var siteelementCount=1;
theSitetree.topTemplateName='Anlage';
theSitetree.paletteFamily='92B4DE';
theSitetree.keyvisualId='2021';
theSitetree.keyvisualName='zahnrad2.jpg';
theSitetree.fontsetId='331';
theSitetree.graphicsetId='387';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='92BEDE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Anlage',
				paletteFamily: 	'92B4DE',
				keyvisualId: 	'2021',
				keyvisualName: 	'zahnrad2.jpg',
				fontsetId: 		'331',
				graphicsetId: 	'387',
				contentColor: 	'000000',
				contentBGColor: '92BEDE',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'92B4DE',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38201',
internalId:  '',
customField: '20100511-104609'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '38201',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2GW4';
var companyName   = 'ALL+HEAT+ALL+THE+TIME';
var htmlTitle	  = 'allheatradio.com';
var metaKeywords  = '-myspace%2C+r+and+b%2C+rb%2C+Old+School%2C+Classics%2C+Hip+Hop%2C+50+cent%2C+mya%2C+ashanti%2C+murder+inc%2C+ja+rule%2C++nas%2C+aalyah%2C+ailyah%2C+jennifer%2C+j+lo%2C+jennifer+lopez%2C+vida%2C+%2C+mya%2C+pictures%2C+pics%2C+downloads%2C+music+artists%2C+old+school%2C+mixes%2C+jay+z%2C+hova%2C+beyonce%2C+destinys+child%2C+lil+kim%2C+eminem%2C+g+unit%2C+big+pun%2C+terror+squad%2C+fat+joe%2C+joey+crack%2C+chante+moore%2C+biggie+smalls%2C+notorious+big%2C+tupac+%2C+shakkur%2C+shakur%2C+pac%2C+janet+jackson%2C+michael+jackson%2C+dmx%2C+ll%2C+ll+cool+j%2C+james+todd%2C+todd+smith%2C+nelly%2C+toni+braxton%2C+alicia+keys%2C+music+artist+%2C++celebrities%2C+singers%2C+rappers%2C+memphis+bleek%2C+pink%2C+method+man%2C+wu+tang%2C+christina+aguilera%2C+cristina+aguilera%2C+agulera%2C+b+e+t%2C+def+jam%2C+new+york%2C+mixed+cds%2C+mix+cds%2C+reggaeton%2C+promos%2C+promotional%2C+wallpaper%2C+blends%2C+reggae%2C+hip+hop%2C+radiostation+%2C+classics+%2C+allheatradio+%2C+radio+%2C+online+%2C+onlineradio%2C+onlineradiostation+%2C+freeway%2C+beanie+%2C+jholiday+%2C+dream+%2C+dj+%2C+defence+%2C+djdavedefence+%2C+davedefence+%2C+djdefence';
var metaContents  = 'PLAYING+THE+HOTTEST+IN+RB+HIP+HOP+AND+REGGAE+THE+BEST+RADIOSTATION+ON+THE+WEB+COME+AND+SEE+FOR+YOUR+SELF';
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();
};
