/* [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','6601',jdecode('Home'),jdecode(''),'/6601.html','true',[],'',''],
	['PAGE','132061',jdecode('Leather+Repair'),jdecode(''),'/132061.html','true',[],'',''],
	['PAGE','135061',jdecode('Vinyl+Repair'),jdecode(''),'/135061.html','true',[],'',''],
	['PAGE','137761',jdecode('Plastic+Repair'),jdecode(''),'/137761.html','true',[],'',''],
	['PAGE','139461',jdecode('Fabric+Repair'),jdecode(''),'/139461.html','true',[],'',''],
	['PAGE','141075',jdecode('Stain+Removal'),jdecode(''),'/141075.html','true',[],'',''],
	['PAGE','27201',jdecode('Before+and+After+Pictures'),jdecode(''),'/27201/index.html','true',[ 
		['PAGE','112336',jdecode('before+%26+after+part+II'),jdecode(''),'/27201/112336.html','true',[],'','']
	],'',''],
	['PAGE','36001',jdecode('Doug+Snow%26%23x27%3Bs+Biography'),jdecode(''),'/36001.html','true',[],'',''],
	['PAGE','41001',jdecode('Leather+Repair+Contest'),jdecode(''),'/41001.html','true',[],'',''],
	['PAGE','41801',jdecode('Repairman+of+the+year'),jdecode(''),'/41801.html','true',[],'',''],
	['PAGE','105236',jdecode('Leather+Certification'),jdecode(''),'/105236.html','true',[],'',''],
	['PAGE','75125',jdecode('Video+About+Snow%26%23x27%3Bs+'),jdecode(''),'/75125.html','true',[],'',''],
	['PAGE','108936',jdecode('Short+Repair+Videos'),jdecode(''),'/108936.html','true',[],'',''],
	['PAGE','127161',jdecode('Contact+Us'),jdecode(''),'/127161.html','true',[],'',''],
	['PAGE','127661',jdecode('E-mail+Us'),jdecode(''),'/127661.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Metal';
theSitetree.paletteFamily='9E9E9E';
theSitetree.keyvisualId='772';
theSitetree.keyvisualName='autovermietung.jpg';
theSitetree.fontsetId='142';
theSitetree.graphicsetId='155';
theSitetree.contentColor='F00000';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Metal',
				paletteFamily: 	'9E9E9E',
				keyvisualId: 	'772',
				keyvisualName: 	'autovermietung.jpg',
				fontsetId: 		'142',
				graphicsetId: 	'155',
				contentColor: 	'F00000',
				contentBGColor: '000000',
				a_color: 		'9E9E9E',
				b_color: 		'E8EAEE',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20100610-000737'
};
webappMappings['7060']=webappMappings['7060-973e02ddb70067904373e7b046154b45']={
webappId:    '7060',
documentId:  '27201',
internalId:  '973e02ddb70067904373e7b046154b45',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20100131-173309'
};
webappMappings['1501']=webappMappings['1501-6756516']={
webappId:    '1501',
documentId:  '6601',
internalId:  '6756516',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36001',
internalId:  '',
customField: '20100119-152734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41001',
internalId:  '',
customField: '20100119-145000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41801',
internalId:  '',
customField: '20100119-120509'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '127161',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75125',
internalId:  '',
customField: '20100119-153356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105236',
internalId:  '',
customField: '20100119-153239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108936',
internalId:  '',
customField: '20100209-161051'
};
webappMappings['7060']=webappMappings['7060-07020472cb21fc2d7ba33d74c9c4e727']={
webappId:    '7060',
documentId:  '112336',
internalId:  '07020472cb21fc2d7ba33d74c9c4e727',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112336',
internalId:  '',
customField: '20100131-173436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127161',
internalId:  '',
customField: '20100119-204220'
};
webappMappings['7008']=webappMappings['7008-6343']={
webappId:    '7008',
documentId:  '127661',
internalId:  '6343',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127661',
internalId:  '',
customField: '20100119-212303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132061',
internalId:  '',
customField: '20100216-082435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135061',
internalId:  '',
customField: '20100209-001302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '137761',
internalId:  '',
customField: '20100209-001414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139461',
internalId:  '',
customField: '20100209-110050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141075',
internalId:  '',
customField: '20100209-100436'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6601',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INE9PK';
var companyName   = 'Snow%27s+Leather%2C+Vinyl%2C+Plastic%2C+%26+Fabric+Repair';
var htmlTitle	  = '';
var metaKeywords  = 'upholstery%2C+leather%2C+vinyl%2C+plastic%2C+fabric%2C+stain%2C+snows%2C+auto%2C+furniture%2C+repair%2C+dye%2C+restore%2C+van+nuys%2C+aircraft%2C+san+fernando+valley%2C+los+angeles';
var metaContents  = 'Expert+repair+and+restoration+of+leather%2C+vinyl%2C+plastic%2C+and+fabric+for+automobiles%2C+furniture%2C+aircraft+and+more%21';
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();
};
