/* [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','1201',jdecode('Home'),jdecode(''),'/1201.html','true',[],''],
	['PAGE','1252',jdecode('About+us'),jdecode(''),'/1252.html','true',[],''],
	['PAGE','18975',jdecode('Contact+Us'),jdecode(''),'/18975.html','true',[],''],
	['PAGE','1315',jdecode('Public+Access+Systems'),jdecode(''),'/1315/index.html','true',[ 
		['PAGE','10001',jdecode('Wi-Fi+Networks'),jdecode(''),'/1315/10001.html','true',[],''],
		['PAGE','10022',jdecode('Kiosks'),jdecode(''),'/1315/10022.html','true',[],'']
	],''],
	['PAGE','1273',jdecode('Products'),jdecode(''),'/1273.html','true',[],''],
	['PAGE','1294',jdecode('Services'),jdecode(''),'/1294.html','true',[],''],
	['PAGE','19046',jdecode('SPECIAL+OFFERS'),jdecode(''),'/19046.html','true',[],''],
	['PAGE','6422',jdecode('What%26%23x27%3Bs+New'),jdecode(''),'/6422.html','true',[],''],
	['PAGE','6401',jdecode('Request+more+info'),jdecode(''),'/6401/index.html','true',[ 
		['PAGE','7701',jdecode('Request+for+more+info+%28follow+up+page%29'),jdecode(''),'/6401/7701.html','false',[],'']
	],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Metal';
theSitetree.paletteFamily='A3CAFE';
theSitetree.keyvisualId='724';
theSitetree.keyvisualName='labtop.jpg';
theSitetree.fontsetId='145';
theSitetree.graphicsetId='161';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var theTemplate={
				name: 			'Metal',
				paletteFamily: 	'A3CAFE',
				keyvisualId: 	'724',
				keyvisualName: 	'labtop.jpg',
				fontsetId: 		'145',
				graphicsetId: 	'161',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'A3CAFE',
				b_color: 		'87A7D2',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1001']=webappMappings['1001-ahw050inevcr666f5930af378bea']={
webappId:    '1001',
documentId:  '6401',
internalId:  'ahw050inevcr666f5930af378bea',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050inevcr666f5930af378bea']={
webappId:    '1001',
documentId:  '7701',
internalId:  'ahw050inevcr666f5930af378bea',
customField: 'followUp'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1201',
internalId:  '',
customField: '20080316-155746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1252',
internalId:  '',
customField: '20080316-180317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18975',
internalId:  '',
customField: '20090131-102054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1315',
internalId:  '',
customField: '20080316-180511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20080316-164027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10022',
internalId:  '',
customField: '20080316-165015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1273',
internalId:  '',
customField: '20080316-182538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1294',
internalId:  '',
customField: '20080316-183229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6422',
internalId:  '',
customField: '20080316-192750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20080223-155733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20080223-160121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19046',
internalId:  '',
customField: '20090214-142156'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEVCR';
var companyName   = 'THE+WIFI+HIGHWAY+LTD';
var htmlTitle	  = 'The+WiFi+Highway+Ltd';
var metaKeywords  = '1+HOTEL+WIFI++2+HOTEL+WIRELESS++3+MOTEL+WIFI++4+MOTEL+WIRELESS++5+WIFI+HOTSPOTS++6+WIRELESS+NETWORKS++7+WIRELESS+NETWORKING++8+WIRELESS+INTERNET++9+WIRELESS+SURVELLIANCE++10+WIRELESS+INTERNET+CAMERAS++11+INTERNET+SURVEILLIANCE++12+WIRELESS+CAMERAS++13+PUBLIC+WIRELESS+NETWORKS++14+PUBLIC+INTERNET+ACCESS++15+PUBLIC+INTERNET+COMPUTERS++16+PUBLIC+COMPUTERS++17+PUBLIC+KIOSKS++18+PUBLIC+INTERNET+KIOSKS++19+INTERNET+KIOSKS++20+WIRELESS+HOTSPOTS++21+HOME+WIFI++22+HOME+WIRELESS+NETWORKS++23+HOME+WIRELESS+INTERNET+CAMERAS++24+HOME+WEB+CAMERAS++25+HOME+WEB+CAMERA+SECURITY++26+BUSINESS+WIFI++27+BUSINESS+WIRELESS+NETWORKS++28+BUSINESS+WIRELESS+INTERNET+CAMERAS++29+BUSINESS+WEB+CAMERAS++30+BUSINESS+WEB+CAMERA+SECURITY++31+SMALL+BUSINESS+INFORMATION+TECHNOLOGY++32+DATA+BACKUP++33+WIRELESS+ANTENNAS++';
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();
};
