/* [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','6501',jdecode('Home'),jdecode(''),'/6501.html','true',[],''],
	['PAGE','6552',jdecode('Shop'),jdecode(''),'/6552.html','true',[],''],
	['PAGE','6573',jdecode('Contact+CWire'),jdecode(''),'/6573.html','true',[],''],
	['PAGE','6594',jdecode('Email+CWire'),jdecode(''),'/6594.html','true',[],''],
	['PAGE','6615',jdecode('About+CWire'),jdecode(''),'/6615.html','true',[],''],
	['PAGE','6636',jdecode('Partner+with+CWire'),jdecode(''),'/6636.html','true',[],''],
	['PAGE','6678',jdecode('Guestbook'),jdecode(''),'/6678.html','true',[],''],
	['PAGE','6657',jdecode('Community'),jdecode(''),'/6657.html','true',[],''],
	['PAGE','27023',jdecode('Voting'),jdecode(''),'/27023.html','true',[],''],
	['PAGE','6741',jdecode('Jobs'),jdecode(''),'/6741.html','true',[],''],
	['PAGE','14512',jdecode('Link-Share'),jdecode(''),'/14512.html','true',[],''],
	['PAGE','15312',jdecode('Investor+Relations'),jdecode(''),'/15312.html','true',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Toronto';
theSitetree.paletteFamily='3358C6';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16881';
theSitetree.graphicsetId='12318';
theSitetree.contentColor='0C2572';
theSitetree.contentBGColor='3358C6';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Toronto',
				paletteFamily: 	'3358C6',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16881',
				graphicsetId: 	'12318',
				contentColor: 	'0C2572',
				contentBGColor: '3358C6',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'3358C6',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-1082']={
webappId:    '7008',
documentId:  '6594',
internalId:  '1082',
customField: 'language:en;country:US;'
};
webappMappings['1003']=webappMappings['1003-anfi10inxzsf121c6702703']={
webappId:    '1003',
documentId:  '6657',
internalId:  'anfi10inxzsf121c6702703',
customField: 'en:US'
};
webappMappings['1002']=webappMappings['1002-6678anfi10inxzsf']={
webappId:    '1002',
documentId:  '6678',
internalId:  '6678anfi10inxzsf',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20090619-170059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6552',
internalId:  '',
customField: '20090623-160610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6573',
internalId:  '',
customField: '20090623-151747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6594',
internalId:  '',
customField: '20090619-164358'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-4892937']={
webappId:    '1501',
documentId:  '6501',
internalId:  '4892937',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6615',
internalId:  '',
customField: '20090617-171441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6741',
internalId:  '',
customField: '20090616-162351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6657',
internalId:  '',
customField: '20090619-165509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6636',
internalId:  '',
customField: '20090619-165218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6678',
internalId:  '',
customField: '20090619-165546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27023',
internalId:  '',
customField: '20090623-211156'
};
webappMappings['7005']=webappMappings['7005-23']={
webappId:    '7005',
documentId:  '27023',
internalId:  '23',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14512',
internalId:  '',
customField: '20090626-123803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15312',
internalId:  '',
customField: '20090618-191244'
};
var canonHostname = 'cm4all.netfirms.com';
var accountId     = 'ANFI10INXZSF';
var companyName   = 'CONSOLIDATED+WIRELESS';
var htmlTitle	  = 'Consolidated+Wireless';
var metaKeywords  = 'consolidated%2C+wireless%2C+mobile%2C+applications%2C+cellphone%2C+blackberry%2C+iphone%2C+palm%2C+pinksheets';
var metaContents  = 'Website+for+Consolidated+Wireless';
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();
};

