/* [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','3001',jdecode('Auto+Glass+'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','3136',jdecode('Free+Quote'),jdecode(''),'/3136.html','true',[],'',''],
	['PAGE','5501',jdecode('What+you+should+know'),jdecode(''),'/5501.html','true',[],'',''],
	['PAGE','3073',jdecode('Repair+or+Replace'),jdecode(''),'/3073.html','true',[],'',''],
	['PAGE','5522',jdecode('Insurance+Claims'),jdecode(''),'/5522.html','true',[],'',''],
	['PAGE','3157',jdecode('About+us'),jdecode(''),'/3157.html','true',[],'',''],
	['PAGE','3094',jdecode('Contact'),jdecode(''),'/3094.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Champagne';
theSitetree.paletteFamily='426388';
theSitetree.keyvisualId='11358';
theSitetree.keyvisualName='kv_11358.jpg';
theSitetree.fontsetId='31943';
theSitetree.graphicsetId='13786';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='426388';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Champagne',
				paletteFamily: 	'426388',
				keyvisualId: 	'11358',
				keyvisualName: 	'kv_11358.jpg',
				fontsetId: 		'31943',
				graphicsetId: 	'13786',
				contentColor: 	'000000',
				contentBGColor: '426388',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-20626']={
webappId:    '7008',
documentId:  '3136',
internalId:  '20626',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20100201-232407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3157',
internalId:  '',
customField: '20091117-014305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3073',
internalId:  '',
customField: '20100128-235324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5522',
internalId:  '',
customField: '20091202-110708'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3136',
internalId:  '',
customField: '20091117-015141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20091117-020931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3094',
internalId:  '',
customField: '20091117-014806'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3094',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '5501',
internalId:  'search',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INV0TC';
var companyName   = '800-810-9014';
var htmlTitle	  = 'Auto+Glass+Repair+and+Replacement+-+Auto+Glass+Perfections';
var metaKeywords  = 'Auto+Glass+Replacement%2C+Auto+Glass+repair%2C+auto+glass%2C+windshield+replacement%2C+auto+window+glass%2C+mobile+auto+glass+replacement%2C++automotive+glass%2C++new+auto+glass%2C++used+auto+glass%2C++auto+glass+fort+lauderdale%2C+auto+glass+west+palm+beach%2C+auto+glass+weston%2C+auto+glass+boca+raton%2C+auto+glass+shop%2C+glass+repair%2C+windshield+glass%2C+replacement+glass%2C+car+glass%2C+auto+windshield%2C+glass+window%2C+car+window+glass%2C+autoglass%2C+windshield+glass+installation%2C+auto+glass+installation%2C+car+window%2C+windshield+repair%2C+car+window%2C+windshields%2C+windshield%2C+rear+window%2C+car+windshield%2C+auto+glass+prices%2C+replace+windshield%2C+auto+windshield+replacement%2C+truck+window%2C+windshield+installation%2C+windshield+price%2C+auto+glass+quote%2C+Weston%2C+Boca+Raton%2C+West+Palm+Beach%2C+Delray+Beach%2C+Fort+Lauderdale%2C+Ft.+Laud%2C+Florida%2C+automobile+glass+replacement%2C+automobile+windshield+replacement%2C+automobile+windshield+repair%2C+Auto+Glass+Weston%2C+Auto+Glass+Boca+Raton%2C+Auto+Glass+West+Palm+Beach%2C+Auto+Glass+Delray+Beach%2C+Auto+Glass+Fort+Lauderdale%2C+Auto+Glass+Hollywood%2C+Auto+Glass+Wellington%2C+Auto+Glass+Pembroke+Pines%2C+Auto+Glass+Pompano%2C+Auto+Glass+Margate%2C+Auto+Glass+Lauderhill%2C+Auto+Glass+Hallandale%2C+Auto+Glass+Boyton+Beach%2C+Auto+Glass';
var metaContents  = 'Auto+Glass+Replacement%2C+Auto+Glass+repair%2C+auto+glass%2C+windshield+replacement%3B+Free+Mobile+Service+from+Palm+Beach%2C+Fort+Lauderdale+and+Miami';
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();
};

