/* [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','2201',jdecode('Home'),jdecode(''),'/2201.html','true',[],''],
	['PAGE','2252',jdecode('About+us'),jdecode(''),'/2252.html','true',[],''],
	['PAGE','9401',jdecode('News'),jdecode(''),'/9401.html','false',[],''],
	['PAGE','2273',jdecode('Products'),jdecode(''),'/2273/index.html','true',[ 
		['PAGE','2357',jdecode('Arrow+Boards'),jdecode(''),'/2273/2357.html','true',[],''],
		['PAGE','2420',jdecode('Barricade+Lights'),jdecode(''),'/2273/2420.html','true',[],''],
		['PAGE','2294',jdecode('Channelizers'),jdecode(''),'/2273/2294.html','true',[],''],
		['PAGE','2315',jdecode('Construction+Signs'),jdecode(''),'/2273/2315.html','true',[],''],
		['PAGE','7301',jdecode('Flags'),jdecode(''),'/2273/7301.html','true',[],''],
		['PAGE','2399',jdecode('Pavement+Markings'),jdecode(''),'/2273/2399.html','true',[],''],
		['PAGE','2378',jdecode('Permanent+Signs'),jdecode(''),'/2273/2378.html','true',[],''],
		['PAGE','57601',jdecode('Posts+and+Accessories'),jdecode(''),'/2273/57601.html','true',[],''],
		['PAGE','40901',jdecode('Roll-ups+%26+Accessories'),jdecode(''),'/2273/40901.html','true',[],''],
		['PAGE','2336',jdecode('Sign+Stands'),jdecode(''),'/2273/2336.html','true',[],''],
		['PAGE','2441',jdecode('Vests'),jdecode(''),'/2273/2441.html','true',[],''],
		['PAGE','7322',jdecode('Misc.+Products'),jdecode(''),'/2273/7322.html','true',[],'']
	],''],
	['PAGE','11101',jdecode('Partners'),jdecode(''),'/11101.html','true',[],''],
	['PAGE','2462',jdecode('Contact'),jdecode(''),'/2462.html','true',[],''],
	['PAGE','19701',jdecode('Request+A+Quote'),jdecode(''),'/19701.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='02325B';
theSitetree.keyvisualId='11074';
theSitetree.keyvisualName='kv_11074.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13796';
theSitetree.contentColor='FCFDFD';
theSitetree.contentBGColor='02325B';
var theTemplate={
				name: 			'Displace',
				paletteFamily: 	'02325B',
				keyvisualId: 	'11074',
				keyvisualName: 	'kv_11074.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13796',
				contentColor: 	'FCFDFD',
				contentBGColor: '02325B',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20090219-141009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20080627-053214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2273',
internalId:  '',
customField: '20080705-161837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2294',
internalId:  '',
customField: '20080628-182736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2462',
internalId:  '',
customField: '20080703-050954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2357',
internalId:  '',
customField: '20080628-073657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2420',
internalId:  '',
customField: '20080628-164315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2315',
internalId:  '',
customField: '20080629-071139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20080629-074637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2399',
internalId:  '',
customField: '20080629-180800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2378',
internalId:  '',
customField: '20080629-183142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2336',
internalId:  '',
customField: '20080630-195906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2441',
internalId:  '',
customField: '20080703-061950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7322',
internalId:  '',
customField: '20080709-044238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20080625-055509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20080626-162512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40901',
internalId:  '',
customField: '20080701-063034'
};
webappMappings['7008']=webappMappings['7008-5586']={
webappId:    '7008',
documentId:  '19701',
internalId:  '5586',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19701',
internalId:  '',
customField: '20080701-205447'
};
webappMappings['7008']=webappMappings['7008-5795']={
webappId:    '7008',
documentId:  '2462',
internalId:  '5795',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57601',
internalId:  '',
customField: '20080709-040654'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2EXK';
var companyName   = 'CQ+Traffic+Control+Products';
var htmlTitle	  = 'CQ+Traffic+Control+Products';
var metaKeywords  = 'cq+traffic+control+products%2C+construction+signs%2C+traffic+signs%2C+arrow+boards%2C+barricade+lights%2C+construction+drums%2C+traffic+cones%2C+safety+flags%2C+pavement+markers%2C+pavement+tape%2C+roll-up+signs%2C+sign+stands%2C+ANSI+Class+2+vests';
var metaContents  = 'CQ+Traffic+Control+Products+manufacturers+construction+signs+and+traffic+signs.+The+company+also+provides+other+related+traffic+control+materials+such+as%3A+arrow+boards%2C+barricade+lights%2C+construction+drums%2C+traffic+cones%2C+safety+flags%2C+pavement+markers+and+pavement+tape%2C+roll-up+signs%2C+sign+stands%2C+ANSI+Class+2+vests+as+well+as+other+products.';
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();
};
