/* [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','3101',jdecode('CCC+Home'),jdecode(''), jdecode('%2F3101.html'), 'true',[],'',''],
	['PAGE','4022',jdecode('ITO+Coatings'),jdecode(''), jdecode('%2F4022.html'), 'true',[],'',''],
	['PAGE','3122',jdecode('Thin+Film+Coatings'),jdecode(''), jdecode('%2F3122.html'), 'true',[],'',''],
	['PAGE','12401',jdecode('R+%26+D'),jdecode(''), jdecode('%2F12401.html'), 'true',[],'',''],
	['PAGE','12422',jdecode('Consulting'),jdecode(''), jdecode('%2F12422.html'), 'true',[],'',''],
	['PAGE','12443',jdecode('Training+Classes'),jdecode(''), jdecode('%2F12443.html'), 'true',[],'',''],
	['PAGE','4064',jdecode('Equipment+Sales'),jdecode(''), jdecode('%2F4064.html'), 'true',[],'',''],
	['PAGE','4001',jdecode('About+CCC'),jdecode(''), jdecode('%2F4001.html'), 'true',[],'',''],
	['PAGE','4043',jdecode('Contact+CCC'),jdecode(''), jdecode('%2F4043.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Bow';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='12019';
theSitetree.keyvisualName='kv_12019.jpg';
theSitetree.fontsetId='33248';
theSitetree.graphicsetId='14117';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Bow',
				paletteFamily: 	'000000',
				keyvisualId: 	'12019',
				keyvisualName: 	'kv_12019.jpg',
				fontsetId: 		'33248',
				graphicsetId: 	'14117',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'F2F5F8',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3122',
internalId:  '',
customField: '20111205-232351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20111212-223453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20111205-232613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4022',
internalId:  '',
customField: '20111205-232155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4043',
internalId:  '',
customField: '20111205-232635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4064',
internalId:  '',
customField: '20111205-232545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12422',
internalId:  '',
customField: '20111205-232452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20111205-232412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12443',
internalId:  '',
customField: '20111205-232515'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2J27';
var companyName   = 'Colorado+Concept+Coatings+LLC';
var htmlTitle	  = 'ITO+Coated+Glass%2C+ITO+Glass%2C+ITO+Coated+Glass+Supplier%2C+ITO%2C+Indium+Tin+Oxide';
var metaKeywords  = 'ITO+Coated+Glass%2C+ITO+Glass%2C+ITO+Coatings%2C+ITO+Coated+Glass+Supplier%2C++ITO+Coated+Glass+Sales%2C+ITO+on+Glass%2C+Coatings%2C+Indium+Tin+Oxide%2C+Thin+Films%2C+Transparent+Conductive+Coatings%2C+AR+Coatings%2C+Antireflective+Coatings%2C+Touch+Panel%2C+LCD%2C+TN%2C+STN%2C+Corning%2C+Coated+Glass%2C+Polished+Glass%2C+OLED%2C+LED%2C+Displays%2C+Heaters%2C+Resistivity%2C+ohms%2Fsq.%2C+ohms+per+square%2C+Transmission%2C+Mirrors%2C+Metal+Coatings%2C+SiO2%2C+Solar%2C+Solar+Cells';
var metaContents  = 'ITO+Coated+Glass%2C+ITO+Coatings%2C+ITO+Glass%2C+ITO%2C+ITO+Glass+Supplier%2C+ITO+Coated+Glass+Sales%2C+Thin+Film+Coatings%2C+Touch+Panel%2C+Touch+Panel+Displays%2C+Anti-Reflective+Coatings%2C+Indium+Tin+Oxide%2C+Transparent+Conductive+Coatings%2C+AR+Coatings%2C+LCD+Patterning%2C+Solar+Panel+Coatings';
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();
};

