/* [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','801',jdecode('Home'),jdecode(''), jdecode('%2F801.html'), 'true',[],'',''],
	['PAGE','852',jdecode('About+us'),jdecode(''), jdecode('%2F852.html'), 'false',[],'',''],
	['PAGE','957',jdecode('Contact'),jdecode(''), jdecode('%2F957.html'), 'true',[],'',''],
	['PAGE','894',jdecode('Body+Shop'),jdecode(''), jdecode('%2F894.html'), 'true',[],'',''],
	['PAGE','150512',jdecode('Commercial+Films'),jdecode(''), jdecode('%2F150512%2Findex.html'), 'true',[ 
		['PAGE','1020',jdecode('Project+List'),jdecode(''), jdecode('%2F150512%2F1020.html'), 'true',[],'','']
	],'',''],
	['PAGE','915',jdecode('Residential+Films'),jdecode(''), jdecode('%2F915%2Findex.html'), 'true',[ 
		['PAGE','1041',jdecode('Building+Projects'),jdecode(''), jdecode('%2F915%2F1041.html'), 'true',[],'',''],
		['PAGE','148612',jdecode('Decorative+Films'),jdecode(''), jdecode('%2F915%2F148612.html'), 'true',[],'','']
	],'',''],
	['PAGE','135512',jdecode('Automotive+Films'),jdecode(''), jdecode('%2F135512%2Findex.html'), 'true',[ 
		['PAGE','999',jdecode('Tips+%26+Tricks'),jdecode(''), jdecode('%2F135512%2F999.html'), 'true',[],'','']
	],'',''],
	['PAGE','34401',jdecode('Safety%2FAnti-Graffiti+Film'),jdecode(''), jdecode('%2F34401.html'), 'true',[],'',''],
	['PAGE','113601',jdecode('Accessories'),jdecode(''), jdecode('%2F113601.html'), 'true',[],'',''],
	['PAGE','936',jdecode('Offers'),jdecode(''), jdecode('%2F936.html'), 'true',[],'',''],
	['PAGE','29901',jdecode('News+%26+Events'),jdecode(''), jdecode('%2F29901.html'), 'false',[],'',''],
	['PAGE','7943',jdecode('Automotive+Gallery'),jdecode(''), jdecode('%2F7943.html'), 'false',[],'',''],
	['PAGE','122401',jdecode('Gallery'),jdecode(''), jdecode('%2F122401.html'), 'true',[],'',''],
	['PAGE','15601',jdecode('Map'),jdecode(''), jdecode('%2F15601.html'), 'false',[],'',''],
	['PAGE','16401',jdecode('FOR+SALE'),jdecode(''), jdecode('%2F16401.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='3E6E72';
theSitetree.keyvisualId='1743';
theSitetree.keyvisualName='ecommerce.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='354';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3E6E72';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'3E6E72',
				keyvisualId: 	'1743',
				keyvisualName: 	'ecommerce.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'354',
				contentColor: 	'FFFFFF',
				contentBGColor: '3E6E72',
				a_color: 		'3E6E72',
				b_color: 		'101C1D',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20111219-161501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '15601',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '852',
internalId:  '',
customField: '20100817-131010'
};
webappMappings['7060']=webappMappings['7060-6e405135be26f72c47cb8222a34dda52']={
webappId:    '7060',
documentId:  '122401',
internalId:  '6e405135be26f72c47cb8222a34dda52',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '894',
internalId:  '',
customField: '20111219-162154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '915',
internalId:  '',
customField: '20111025-124437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '936',
internalId:  '',
customField: '20111025-124047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '957',
internalId:  '',
customField: '20111219-161845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135512',
internalId:  '',
customField: '20110906-114958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '999',
internalId:  '',
customField: '20111205-115754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1020',
internalId:  '',
customField: '20111219-162957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1041',
internalId:  '',
customField: '20110209-172916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16401',
internalId:  '',
customField: '20111205-114757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7943',
internalId:  '',
customField: '20091231-121951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113601',
internalId:  '',
customField: '20110224-160709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20080811-125824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29901',
internalId:  '',
customField: '20101207-182753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122401',
internalId:  '',
customField: '20100122-134607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34401',
internalId:  '',
customField: '20111025-124604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148612',
internalId:  '',
customField: '20111025-124651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '150512',
internalId:  '',
customField: '20111219-162526'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INXXQA';
var companyName   = 'San+Luis+Customs+Inc.';
var htmlTitle	  = 'San+Luis+window+tinting';
var metaKeywords  = 'tint%2C+film%2C+window%2C+windows%2C+glass%2C+auto%2C+house%2C+car%2C+dark%2C+smoke%2C+collision%2C+vehicle%2C+hit%2C+damage%2C+paint%2C+body%2C+window%2C+hot%2C+cool%2C+wicked%2C+nice%2C+clean%2C+windshield%2C+repairs%2C+crash%2C+accident%2C+insurance%2C+repair%2C+fast%2C+smooth%2C+quick%2C+nice%2C+job%2C+tints%2C+3M%2C+glass%2C+tint%2C+windows%2C+windows+tint%2C+films%2C+car+window+tinting%2C+clear%2C+protection%2C+window+tint%2C+tinting%2C+tint%2C+tinted%2C+car+tint%2C+glass+tint%2C+solar+tint%2C+tinted+window%2C+tinted+windows%2C+3M+tinted+windows%2C3m+tint%2C+window+films%2C+auto+tint%2C+house+privacy%2C+cool%2C+cold%2C+keep+cool%2C+keep+warm%2C+decorative+film%2C+opaque%2C+opaque+film%2C+commercial+tint%2C+commercial+film%2C+auto+film%2C+tinted+auto+glass%2C+auto+glass%2C+auto+film+tint%2C+automotive+window+tinting%2C+automotive+window+films%2C+93405%2C+93401%2C+san+luis+customs%2C+san+luis+obispo%2C+san+luis+tint%2C+window+tinting+san+luis+obispo';
var metaContents  = '3M+window+films+and+auto+body+%2F+collision+repair%2C+window+tinting%2C+3M+window+films%2C+San+Luis+Custom+Tint%2C+Window+tinting+for+San+Luis+Obispo%2C+93405+window+tinting%2C+central+coast+tint%2C+window+tinting+san+luis+obispo';
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();
};

