/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],''],
	['PAGE','573',jdecode('Products'),jdecode(''),'/573/index.html','true',[ 
		['PAGE','594',jdecode('Splicers'),jdecode(''),'/573/594.html','true',[],''],
		['PAGE','636',jdecode('Portable+Creels'),jdecode(''),'/573/636.html','true',[],''],
		['PAGE','657',jdecode('Guides+%26+Eyelets'),jdecode(''),'/573/657.html','true',[],''],
		['PAGE','27922',jdecode('Blow-back+Guns'),jdecode(''),'/573/27922.html','true',[],''],
		['PAGE','34801',jdecode('Yarn+End-Caps'),jdecode(''),'/573/34801.html','true',[],''],
		['PAGE','27501',jdecode('Products+in+Action'),jdecode(''),'/573/27501.html','true',[],'']
	],''],
	['PAGE','20101',jdecode('Recently+Add'),jdecode(''),'/20101.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10344';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10344',
				graphicsetId: 	'10448',
				contentColor: 	'FFFFFF',
				contentBGColor: '5e5e5e',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'5E5E5E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100412-104405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20080918-111131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20100825-090714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20101',
internalId:  '',
customField: '20100825-121519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20080918-114400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20080918-114826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27922',
internalId:  '',
customField: '20100819-082323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34801',
internalId:  '',
customField: '20100819-082405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20100830-113922'
};
var canonHostname = 'cm4all01.carrierzone.com';
var accountId     = 'AAPLU0INLB45';
var companyName   = 'SRT+MACHINERY+COMPANY+INC.';
var htmlTitle	  = 'SRT+Machinery+-+Innovation+in+Action';
var metaKeywords  = 'S.R.T.%2C+Co.%2C+Co%2C+Splicers%2C+Splicer%2C+Splicing%2C+Creel+Racks%2C+Racks%2C+Creels%2C+Carpet%2C+Carpet%2C+Industry%2C+Yarn+Guides%2C+Guides%2C+Ceramic%2C+Ceramic++Eyelets%2C+Eyelets%2C+Thermal+Splicers%2C+Portable+Creels%2C+Beam+Splicers%2C+Beam%2C+SRT%2C+Splice+Rite%2C+Textile%2C+Splice%2C+Rite%2C+Textile%2C+Machinery%2C+Dalton%2C+Georgia%2C+Gauge+Bars%2C+Gauge+Bar%2C+CNC%2C+CNC+Work%2C+Machine+Work%2C+Lathe+Work%2C+Custom+machining%2C+Burners%2C+Burner%2C+Guide%2C+Welding%2C+AB+Carter%2C+Company%2C+Inc.%2C+Ind.%2C+A.B.+Carter%2C+AB%2C+A.B.%2C+A.B+Carter%2C+A.B%2C+Williams%2C+Williams%2C+Williams+Specialty%2C+Williams+Specialty%2C+Mesdan%2C+Pentwyn%2C+SP-92%2C+SP92%2C+SP-92+splicers%2C+SP92+splicers%2C+sp-92+splicer%2C+sp92+splicer%2C+med+chambers%2C+md+chambers%2C+med+chamber%2C+med.+chamber%2C+md.+chamber%2C+md+chambers%2C+chamber%2C+chambers%2C+splier+chamber%2C+splicer+chambers%2C+splicing+chamber%2C+splicing+chambers%2C+';
var metaContents  = 'S.R.T.%2C+Co.%2C+Co%2C+Splicers%2C+Splicer%2C+Splicing%2C+Creel+Racks%2C+Racks%2C+Creels%2C+Carpet%2C+Carpet%2C+Industry%2C+Yarn+Guides%2C+Guides%2C+Ceramic%2C+Ceramic++Eyelets%2C+Eyelets%2C+Thermal+Splicers%2C+Portable+Creels%2C+Beam+Splicers%2C+Beam%2C+SRT%2C+Splice+Rite%2C+Textile%2C+Splice%2C+Rite%2C+Textile%2C+Machinery%2C+Dalton%2C+Georgia%2C+Gauge+Bars%2C+Gauge+Bar%2C+CNC%2C+CNC+Work%2C+Machine+Work%2C+Lathe+Work%2C+Custom+machining%2C+Burners%2C+Burner%2C+Guide%2C+Welding%2C+AB+Carter%2C+Company%2C+Inc.%2C+Ind.%2C+A.B.+Carter%2C+AB%2C+A.B.%2C+A.B+Carter%2C+A.B%2C+Williams%2C+Williams%2C+Williams+Specialty%2C+Williams+Specialty%2C+Mesdan%2C+Pentwyn%2C+SP-92%2C+SP92%2C+SP-92+splicers%2C+SP92+splicers%2C+sp-92+splicer%2C+sp92+splicer%2C+med+chambers%2C+md+chambers%2C+med+chamber%2C+med.+chamber%2C+md.+chamber%2C+md+chambers%2C+chamber%2C+chambers%2C+splier+chamber%2C+splicer+chambers%2C+splicing+chamber%2C+splicing+chambers%2C+';
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();
};

