/* [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','5001',jdecode('Home'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','53101',jdecode('Home'),jdecode(''),'/53101.html','false',[],'',''],
	['PAGE','5052',jdecode('LED+For+Signage'),jdecode(''),'/5052/index.html','true',[ 
		['PAGE','17701',jdecode('Mini+Series+Module'),jdecode(''),'/5052/17701.html','true',[],'',''],
		['PAGE','23601',jdecode('PG+Series+Module'),jdecode(''),'/5052/23601.html','true',[],'',''],
		['PAGE','23622',jdecode('PA+Series+Module'),jdecode(''),'/5052/23622.html','true',[],'',''],
		['PAGE','23643',jdecode('PC+Series+Module'),jdecode(''),'/5052/23643.html','false',[],'',''],
		['PAGE','24201',jdecode('Power+Module'),jdecode(''),'/5052/24201.html','true',[],'',''],
		['PAGE','44201',jdecode('JS+Series+Module'),jdecode(''),'/5052/44201.html','false',[],'',''],
		['PAGE','44222',jdecode('LS+Series+Module'),jdecode(''),'/5052/44222.html','false',[],'',''],
		['PAGE','23664',jdecode('Flexibility+Strip'),jdecode(''),'/5052/23664.html','true',[],'',''],
		['PAGE','23685',jdecode('LED+Neon+Flex'),jdecode(''),'/5052/23685.html','true',[],'',''],
		['PAGE','17722',jdecode('LED+Lightbar'),jdecode(''),'/5052/17722.html','true',[],'',''],
		['PAGE','46201',jdecode('LED+Module'),jdecode(''),'/5052/46201.html','false',[],'','']
	],'',''],
	['PAGE','26601',jdecode('LED+Power+Supply'),jdecode(''),'/26601/index.html','true',[ 
		['PAGE','18401',jdecode('30W+Power+Supply'),jdecode(''),'/26601/18401.html','true',[],'',''],
		['PAGE','23706',jdecode('60W+Power+Supply'),jdecode(''),'/26601/23706.html','true',[],'',''],
		['PAGE','23727',jdecode('Powe+Supply+Box'),jdecode(''),'/26601/23727.html','true',[],'','']
	],'',''],
	['PAGE','17743',jdecode('LED+Lighting'),jdecode(''),'/17743/index.html','true',[ 
		['PAGE','26622',jdecode('C+Series+Bulb'),jdecode(''),'/17743/26622.html','true',[],'',''],
		['PAGE','26643',jdecode('T+Series+Bulb'),jdecode(''),'/17743/26643.html','true',[],'',''],
		['PAGE','26664',jdecode('LED+Spot+Light'),jdecode(''),'/17743/26664.html','true',[],'',''],
		['PAGE','26685',jdecode('MR16'),jdecode(''),'/17743/26685.html','true',[],'',''],
		['PAGE','29401',jdecode('LED+PAR+Light'),jdecode(''),'/17743/29401.html','true',[],'',''],
		['PAGE','26706',jdecode('Tunnel%2FStreet+Light'),jdecode(''),'/17743/26706.html','true',[],'',''],
		['PAGE','26727',jdecode('Wall+Washer'),jdecode(''),'/17743/26727.html','true',[],'','']
	],'',''],
	['PAGE','17764',jdecode('LED+Display'),jdecode(''),'/17764/index.html','true',[ 
		['PAGE','26748',jdecode('Message+Display'),jdecode(''),'/17764/26748.html','true',[],'',''],
		['PAGE','26769',jdecode('Full+Color+Display'),jdecode(''),'/17764/26769.html','true',[],'','']
	],'',''],
	['PAGE','17785',jdecode('Applications'),jdecode(''),'/17785.html','true',[],'',''],
	['PAGE','5073',jdecode('Service'),jdecode(''),'/5073/index.html','true',[ 
		['PAGE','36901',jdecode('Price+Quote'),jdecode(''),'/5073/36901.html','true',[],'',''],
		['PAGE','36922',jdecode('Warranty'),jdecode(''),'/5073/36922.html','true',[],'',''],
		['PAGE','36943',jdecode('Documentation'),jdecode(''),'/5073/36943.html','true',[],'','']
	],'',''],
	['PAGE','17806',jdecode('Contact'),jdecode(''),'/17806.html','true',[],'',''],
	['PAGE','39701',jdecode('Online+Store'),jdecode(''),'/39701.html','false',[],'','']];
var siteelementCount=36;
theSitetree.topTemplateName='Livinginamerica';
theSitetree.paletteFamily='6971B1';
theSitetree.keyvisualId='6330';
theSitetree.keyvisualName='kv_6330.jpg';
theSitetree.fontsetId='11153';
theSitetree.graphicsetId='12905';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='D6DAF6';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Livinginamerica',
				paletteFamily: 	'6971B1',
				keyvisualId: 	'6330',
				keyvisualName: 	'kv_6330.jpg',
				fontsetId: 		'11153',
				graphicsetId: 	'12905',
				contentColor: 	'000000',
				contentBGColor: 'D6DAF6',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20110621-140521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20110403-134153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5073',
internalId:  '',
customField: '20110115-111449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20110401-133706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17743',
internalId:  '',
customField: '20110207-090401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17722',
internalId:  '',
customField: '20110115-112602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18401',
internalId:  '',
customField: '20110115-112743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17764',
internalId:  '',
customField: '20110115-113743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17785',
internalId:  '',
customField: '20110113-153513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17806',
internalId:  '',
customField: '20110115-110314'
};
webappMappings['7060']=webappMappings['7060-bc3951fa9bc433351460e4ebfe17a628']={
webappId:    '7060',
documentId:  '17785',
internalId:  'bc3951fa9bc433351460e4ebfe17a628',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23601',
internalId:  '',
customField: '20110114-014216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23622',
internalId:  '',
customField: '20110401-133851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23643',
internalId:  '',
customField: '20110114-014247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24201',
internalId:  '',
customField: '20110114-014303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23664',
internalId:  '',
customField: '20110115-112525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23685',
internalId:  '',
customField: '20110115-112544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26601',
internalId:  '',
customField: '20110416-105133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26748',
internalId:  '',
customField: '20110115-113759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23706',
internalId:  '',
customField: '20110115-112728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23727',
internalId:  '',
customField: '20110416-105236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26622',
internalId:  '',
customField: '20110115-113203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26643',
internalId:  '',
customField: '20110115-113233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26664',
internalId:  '',
customField: '20110115-113506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26685',
internalId:  '',
customField: '20110115-113602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26706',
internalId:  '',
customField: '20110115-113700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26727',
internalId:  '',
customField: '20110207-092320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20110115-113625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26769',
internalId:  '',
customField: '20110117-001542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44201',
internalId:  '',
customField: '20110130-120053'
};
webappMappings['7008']=webappMappings['7008-3550']={
webappId:    '7008',
documentId:  '36901',
internalId:  '3550',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36943',
internalId:  '',
customField: '20110118-102521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36901',
internalId:  '',
customField: '20110115-110928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36922',
internalId:  '',
customField: '20110115-111058'
};
webappMappings['4001']=webappMappings['4001-15776239']={
webappId:    '4001',
documentId:  '39701',
internalId:  '15776239',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39701',
internalId:  '',
customField: '20110331-112759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44222',
internalId:  '',
customField: '20110130-120912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46201',
internalId:  '',
customField: '20110130-121740'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '5001',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53101',
internalId:  '',
customField: '20110413-221133'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'ANFI20IN2K5D';
var companyName   = 'Beyond+LED+Inc.';
var htmlTitle	  = 'Beyond+LED+Inc+LED+Module+LED+Transformer+LED+LED+lamps+LED+display+Toronto+Canada';
var metaKeywords  = 'Beyond+LED+Inc+Toronto+Ontario+Canada+LED+supplier+distributor+super+bright+LED+module+LED+strip+waterproof+SMD+Piranha+CREE+LED+lamps+lights+LED+Power+Supply+transformer+enclosure+LED+tunnel+lights+LED+display+moving+message+full+color+LED+neon+flex+Blueview+BV-Strip+BV-Square+BV-Strip-PC+BV-Strip-PG+BV-Square-PA+BV-Power+BV-AL+solar+wind+energy+saving+ALT+thin+box+slim+box+sign+box+changfang+cfled.com';
var metaContents  = 'Beyond+LED+Inc+is+a+Canadian+company+specialized+in+LED+products+and+services.+It+provides+high+quality+LED+modues%2C+LED+lamps%2C+LED+displays+and+other+LED+products+in+best+price+ever.+Contact+us+at+416-800-8500+or+admin%40beyondled.com';
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();
};

