/* [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','5201',jdecode('Home'),jdecode(''),'/5201.html','true',[],'',''],
	['PAGE','14601',jdecode('How+to+Order'),jdecode(''),'/14601/index.html','true',[ 
		['PAGE','14622',jdecode('EMAILED+Order'),jdecode(''),'/14601/14622.html','true',[],'',''],
		['PAGE','5252',jdecode('MAILED+or+FAXED+Order'),jdecode(''),'/14601/5252.html','true',[],'','']
	],'',''],
	['PAGE','25701',jdecode('Email+sign+up+for+FREE+SAMPLES'),jdecode(''),'/25701.html','true',[],'',''],
	['PAGE','26301',jdecode('CD-1+Content+Safety+Graphics'),jdecode(''),'/26301/index.html','true',[ 
		['PAGE','5273',jdecode('2D+Safety+Clipart+Examples'),jdecode(''),'/26301/5273.html','true',[],'',''],
		['PAGE','26322',jdecode('3D+Safety+Clipart+Examples'),jdecode(''),'/26301/26322.html','true',[],'',''],
		['PAGE','13301',jdecode('Safety+Animations+Examples'),jdecode(''),'/26301/13301.html','true',[],'','']
	],'',''],
	['PAGE','7985',jdecode('Safety+Photographs+on+CD'),jdecode(''),'/7985.html','true',[],'',''],
	['PAGE','8006',jdecode('PowerPoint+Safety+Slides+on+CD'),jdecode(''),'/8006.html','true',[],'',''],
	['PAGE','28201',jdecode('Safety+Screensavers'),jdecode(''),'/28201.html','true',[],'',''],
	['PAGE','28243',jdecode('Paycheck+Envelope+Safety+Stuffers'),jdecode(''),'/28243.html','true',[],'',''],
	['PAGE','28222',jdecode('Smaller+Clipart+Packages'),jdecode(''),'/28222.html','true',[],'',''],
	['PAGE','29501',jdecode('MULTIPLE+PURCHASE+DISCOUNTS'),jdecode(''),'/29501.html','true',[],'',''],
	['PAGE','27101',jdecode('Frequently+Asked+Questions'),jdecode(''),'/27101.html','true',[],'',''],
	['PAGE','8027',jdecode('Consultive+Safety+Services'),jdecode(''),'/8027.html','true',[],'',''],
	['PAGE','30201',jdecode('Vinyl+Stick+Ups'),jdecode(''),'/30201.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='25882F';
theSitetree.keyvisualId='9810';
theSitetree.keyvisualName='kv_9810.jpg';
theSitetree.fontsetId='17626';
theSitetree.graphicsetId='13033';
theSitetree.contentColor='25882F';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Valiant',
				paletteFamily: 	'25882F',
				keyvisualId: 	'9810',
				keyvisualName: 	'kv_9810.jpg',
				fontsetId: 		'17626',
				graphicsetId: 	'13033',
				contentColor: 	'25882F',
				contentBGColor: 'FFFFFF',
				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:  '5201',
internalId:  '',
customField: '20090810-160117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5252',
internalId:  '',
customField: '20090724-181357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5273',
internalId:  '',
customField: '20090727-190642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7985',
internalId:  '',
customField: '20090727-194247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8006',
internalId:  '',
customField: '20090727-201516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8027',
internalId:  '',
customField: '20090628-223017'
};
webappMappings['7008']=webappMappings['7008-1936']={
webappId:    '7008',
documentId:  '14622',
internalId:  '1936',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20090725-160122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14622',
internalId:  '',
customField: '20090725-160330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20090724-163727'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26301',
internalId:  '',
customField: '20090727-192453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26322',
internalId:  '',
customField: '20090727-192935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27101',
internalId:  '',
customField: '20090727-193334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20090727-200555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28222',
internalId:  '',
customField: '20090727-202322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28243',
internalId:  '',
customField: '20090727-202008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29501',
internalId:  '',
customField: '20090727-202237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20090810-184819'
};
webappMappings['7008']=webappMappings['7008-1954']={
webappId:    '7008',
documentId:  '25701',
internalId:  '1954',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20090727-184433'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN330INFCK9';
var companyName   = 'Safety+Services+of+Texas++%28Your+Safety+Graphics+Source%29';
var htmlTitle	  = 'Safety+clipart+safety+graphics+safety++animations+safety+photos+safety+screensavers+-+20%2C000%2B+images';
var metaKeywords  = 'safety%2C+safety+clipart%2C+safety+graphics%2C+safety+photographs%2C+safety+screensavers%2C+safety+animations%2C+safety+training%2C+safety+banners%2C+safety+badges%2C+chemical+safety%2C+ergonomic+safety%2C+personal+protective+equipment+safety%2C+medical+safety%2C+environmental+safety%2C+pipe+markers%2C+MSDS%2C+Hazard+Communication+safety%2C+universal+safety+symbols%2C+danger+signs%2C+caution+signs%2C+warning+signs%2C+safety+posters%2C+school+safety%2C+ladder+safety%2C+fall+protection%2C+fire+extinguisher+safety%2C+forklift+sfety%2C+guarding+safety%2C+hand+safety%2C+marine+safety%2C+manual+material+handling%2C+mechanical+material+handling%2C+mmh%2C+ppe%2C+safety+first%2C+slip+trip+fall+safety%2C+crane+safety%2C+industrial+hygiene+safety%2C+excavation+safety%2C+DOT+plackarding%2C+fleet+safety%2C+traffic+safety%2C+bloodborne+pathogen+safety%2C+landscaping+safety%2C+machine+safety%2C+housekeeping+safety%2C+sling+safety%2C+rgging+safety%2C+shipping+labels%2C+welding+safety%2C+tool+safety%2C+think+safety+signs%2C+safety+sign+maker%2C+safety+tag+maker%2Cconstruction+safety%2C+safety+photos%2C+safety+photographs%2C+powerpoint+safety+slides%2C+safety+screensavers+paycheck+envelope+safety+stuffers%2C+lockout-tagout+safety%2C+security+safety%2C+';
var metaContents  = 'The+source+of+the+largest+number+of+safety+graphics+on+the+market.++Get+20%2C000%2B+safety+images+on+CD+including+2D++3D+images%2C+men%2Fwomen+images%2C+ethnic+images%2C+many+spanish+working+images.';
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();
};

