/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],''],
	['PAGE','652',jdecode('Radio+Equipment'),jdecode(''),'/652/index.html','true',[ 
		['PAGE','15501',jdecode('VHF+Handhelds'),jdecode(''),'/652/15501.html','true',[],''],
		['PAGE','673',jdecode('VHF+Mobile+Radios'),jdecode(''),'/652/673.html','true',[],''],
		['PAGE','15522',jdecode('UHF+Handhelds'),jdecode(''),'/652/15522.html','true',[],''],
		['PAGE','694',jdecode('UHF+Mobile+Radios'),jdecode(''),'/652/694.html','true',[],''],
		['PAGE','715',jdecode('Used+Radios+%28Motorola%29'),jdecode(''),'/652/715.html','true',[],'']
	],''],
	['PAGE','6601',jdecode('Tips+%26+Tricks'),jdecode(''),'/6601.html','true',[],''],
	['PAGE','757',jdecode('Contact'),jdecode(''),'/757.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Anniversary';
theSitetree.paletteFamily='730303';
theSitetree.keyvisualId='3725';
theSitetree.keyvisualName='kv_3725.jpg';
theSitetree.fontsetId='10559';
theSitetree.graphicsetId='10947';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F3EFDB';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Anniversary',
				paletteFamily: 	'730303',
				keyvisualId: 	'3725',
				keyvisualName: 	'kv_3725.jpg',
				fontsetId: 		'10559',
				graphicsetId: 	'10947',
				contentColor: 	'000000',
				contentBGColor: 'F3EFDB',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'F7EFDE',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'828181',
				e_color: 		'828181',
				f_color: 		'828181',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20070424-090942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20101025-134717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20070429-020924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20070429-031621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20070429-030957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15522',
internalId:  '',
customField: '20070425-094658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20070429-025708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20070423-134230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20070423-104211'
};
var canonHostname = 'cm4all01.carrierzone.com';
var accountId     = 'AAPLU0INVOEE';
var companyName   = 'The+Radio+Shop';
var htmlTitle	  = 'THE+RADIO+SHOP';
var metaKeywords  = 'frs+radio%2C++Icom+Radios%2C++icom+radio%2C++avionics%2C+Motorola+Radios%2C+2+way+radio%2C+GMRS+Radios%2C+walkie+talkie%2C+two+way+radio%2C+maxon%2C++motorola+two+way+radio%2C+++++maxon+radio%2C+Motorola+used+radios%2C+avionics+radios%2C+hf+radios%2C+Icom%2C+used+radios%2C+data+receivers%2C+data+transceivers+';
var metaContents  = '++The+Radio+Shop+++Icom%2C++Maxon+and+Motorola+2+Way+Radios++%E2%80%93+For+Less+++The+Radio+Shop+has+been+providing+customers+with+great+deals+on+Yaesu%2C+Icom%2C+Vertex+Radios%2C+Motorola+2+way+radios+and+more+since+1982.++As+well+as+used+notebook+computers+since+1992.+We%E2%80%99ve+built+our+business+on+integrity%2C+and+strive+to+provide+you+with+low+cost%2C+straight+facts%2C+and+high+standards+of+customer+service+whenever+you+purchase+radios%2C+receivers%2C+or+used+notebook+computers.+++Motorola+2+Way+Radios+Are+you+looking+for+used+Motorola+2+way+radios+that+will+give+you+optimum+features+of+new+Motorola+2+way+radios+at+a+considerably+lower+price%3F+The+Radio+Shop+carries+a+wide+range+of+Motorola+2+way+radios+from+the+Maxar+80+base+station+to+the+HT1000+handheld.+Ideal+for+demanding+2+way+communication+needs%2C+these+Motorola+2+way+radios+are+among+the+most+rugged+and+reliable+on+the+market.+++Icom+Radios+With+around+2+dozen+Icom+radio+models+to+choose+from%2C+the+Radio+Shop+can+offer+you+the+Icom+radio+features+you+expect+at+prices+that+can%E2%80%99t+be+beat.+From+the+Icom+IC+F621+mobile+unit%2C+to+the+Icom+F11+handheld+radio%2C+you%E2%80%99ll+find+the+model+that+answers+your+communication+needs.+++The+Radio+Shop+%E2%80%93+the+value+driven+radio+New+and+used+Radio+shop.+We%E2%80%99re+here+to+serve+you+and+to+make+a+difference+to+the+business+world.+Why+pay+more+for+less+when+you+can+pay+less+and+get+the+BEST%21+++We+are+listed+with+the+Small+Business+Administration+%28SBA%29+and+Pro-Net+%28Government%29+as+well+as+Dun+and+Bradstreet+as+a+small+business.+We+are+authorized+dealers+for+Topaz+%28Maxon%29%2C++Icom.+We+sell+these+products+as+well+as+reconditioned+%28mostly+Motorola%29+commercial+two-way+radio+equipment.+We+are+part+of+the+National+Service+Organization+%28NSO%29+supported+by+Motorola.';
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();
};

