/* [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','4922',jdecode('Home'),jdecode(''),'/4922.html','true',[],''],
	['PAGE','6101',jdecode('Specials'),jdecode(''),'/6101.html','true',[],''],
	['PAGE','6522',jdecode('Telephone+Services'),jdecode(''),'/6522.html','true',[],''],
	['PAGE','10201',jdecode('Computer+Services'),jdecode(''),'/10201.html','true',[],''],
	['PAGE','10001',jdecode('Voice+Over+Talent'),jdecode(''),'/10001.html','true',[],''],
	['PAGE','6501',jdecode('Products'),jdecode(''),'/6501.html','true',[],''],
	['PAGE','7901',jdecode('Schedule+A+Service+Call'),jdecode(''),'/7901.html','true',[],''],
	['PAGE','8901',jdecode('Email'),jdecode(''),'/8901.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='2178';
theSitetree.keyvisualName='telekommunikation.jpg';
theSitetree.fontsetId='358';
theSitetree.graphicsetId='408';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Medium',
				paletteFamily: 	'000000',
				keyvisualId: 	'2178',
				keyvisualName: 	'telekommunikation.jpg',
				fontsetId: 		'358',
				graphicsetId: 	'408',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'8EBFC6',
				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:  '4922',
internalId:  '',
customField: '20090827-003636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20090827-005001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20090428-013335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6522',
internalId:  '',
customField: '20090827-005043'
};
webappMappings['7008']=webappMappings['7008-6478']={
webappId:    '7008',
documentId:  '7901',
internalId:  '6478',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20090415-010855'
};
webappMappings['7008']=webappMappings['7008-6976']={
webappId:    '7008',
documentId:  '8901',
internalId:  '6976',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20090428-225317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20090826-233845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20090827-004051'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHMCN';
var companyName   = 'TouchTone+Telecom%2C+Inc.';
var htmlTitle	  = 'Telephone+Systems%2C+Voicemail+systems%2C+Telephone+Computer+wiring%2C+Computer+Networks%2C+Installation%2C+Repair%2C+MICHAEL+POSTAWA+IS+MICHAEL+POSTAWA+10%2F01%2F09+PLEASE+UPDATE';
var metaKeywords  = 'Telephone+system%2C+Voicemail+system%2C+telephone+repair%2C+telephone+system+installation%2C+Telephone+computer+cabling%2C+Cat5e%2C+Cat6%2C+telephone%2C+voicemail+repair%2C+Voip%2C+Michael+Postawa%2C+touchtone%2C+elgin%2C+chicago%2C+naperville%2C+elk+grove+village%2C+oakbrook%2C+schaumburg%2C+lombard%2C+hoffman+estates%2C+northbrook%2C+bolingbrook%2C+roselle%2C+rosemont%2C+des+plaines%2C+st.+charles%2C+mt.+prospect%2C+bensenville%2C+IL%2C+Avaya%2C+ATT%2C+Nortel%2C+Norstar%2C+Meridian%2C+Lucent%2C+';
var metaContents  = 'Telephone+systems%2C+Voicemail+systems%2C+Telephone+and+computer+wiring%2C+Cat5e++Cat6.%2C+installation%2C+repair.++Please+update+Michael+Postawa+is+Michael+Postawa+10-01-09.';
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();
};
