/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],'',''],
	['ITEM','9401',jdecode('SPEED+TEST'),jdecode(''),'http://www.speakeasy.net/speedtest/','true',[],'','_blank'],
	['PAGE','9901',jdecode('CUSTOMER+SURVEY'),jdecode(''),'/9901.html','true',[],'',''],
	['ITEM','20501',jdecode('Lightband+Channel+Guide'),jdecode(''),'http://www.cdelightband.net/LineUp2_10.pdf','true',[],'','_blank'],
	['ITEM','20502',jdecode('LIGHTBAND+TV+USER+GUIDE'),jdecode(''),'http://www.cdelightband.net/usersguide.pdf','true',[],'','_blank'],
	['ITEM','20601',jdecode('CDE+Lightband+Pricing'),jdecode(''),'http://www.cdelightband.net/PriceList4-09.pdf','true',[],'','_blank'],
	['PAGE','20602',jdecode('SIGN+UP+FOR+SERVICE'),jdecode(''),'/20602.html','true',[],'',''],
	['PAGE','20623',jdecode('Service+Call+Request'),jdecode(''),'/20623.html','true',[],'',''],
	['PAGE','9402',jdecode('Weather'),jdecode(''),'/9402.html','true',[],'',''],
	['PAGE','9444',jdecode('CONTACT+US'),jdecode(''),'/9444.html','true',[],'',''],
	['PAGE','1852',jdecode('Products'),jdecode(''),'/1852.html','true',[],'',''],
	['PAGE','1915',jdecode('About+us'),jdecode(''),'/1915/index.html','true',[ 
		['PAGE','1936',jdecode('How+to+find+us'),jdecode(''),'/1915/1936.html','true',[],'','']
	],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Digital';
theSitetree.paletteFamily='B30117';
theSitetree.keyvisualId='54';
theSitetree.keyvisualName='digital_age.jpg';
theSitetree.fontsetId='37';
theSitetree.graphicsetId='41';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='B30117';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Digital',
				paletteFamily: 	'B30117',
				keyvisualId: 	'54',
				keyvisualName: 	'digital_age.jpg',
				fontsetId: 		'37',
				graphicsetId: 	'41',
				contentColor: 	'FFFFFF',
				contentBGColor: 'B30117',
				a_color: 		'B30117',
				b_color: 		'DEFDFB',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100108-171031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20100419-231906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1915',
internalId:  '',
customField: '20090707-160649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1936',
internalId:  '',
customField: '20090707-160932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9402',
internalId:  '',
customField: '20100108-172934'
};
webappMappings['1501']=webappMappings['1501-13913450']={
webappId:    '1501',
documentId:  '1801',
internalId:  '13913450',
customField: '1501'
};
webappMappings['7080']=webappMappings['7080-629']={
webappId:    '7080',
documentId:  '9402',
internalId:  '629',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-16464']={
webappId:    '7008',
documentId:  '20623',
internalId:  '16464',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-16463']={
webappId:    '7008',
documentId:  '20602',
internalId:  '16463',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-14103']={
webappId:    '7008',
documentId:  '9444',
internalId:  '14103',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9444',
internalId:  '',
customField: '20100108-173112'
};
webappMappings['7008']=webappMappings['7008-14104']={
webappId:    '7008',
documentId:  '9901',
internalId:  '14104',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20100419-232041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20602',
internalId:  '',
customField: '20100419-232223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20623',
internalId:  '',
customField: '20100419-232350'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHY32';
var companyName   = 'Beck+Communications';
var htmlTitle	  = 'Beck+Communications%2C+A+Technology+Store';
var metaKeywords  = '';
var metaContents  = '';
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();
};
