/* [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','14301',jdecode('Home'),jdecode(''),'/14301.html','true',[],'',''],
	['PAGE','14352',jdecode('Automotive'),jdecode(''),'/14352.html','true',[],'',''],
	['PAGE','14373',jdecode('Commercial'),jdecode(''),'/14373.html','true',[],'',''],
	['PAGE','14394',jdecode('Residential'),jdecode(''),'/14394.html','true',[],'',''],
	['PAGE','14478',jdecode('Windows'),jdecode(''),'/14478.html','true',[],'',''],
	['PAGE','14415',jdecode('Contact'),jdecode(''),'/14415.html','true',[],'',''],
	['PAGE','14436',jdecode('OUR+LOCATION'),jdecode(''),'/14436.html','true',[],'',''],
	['PAGE','17501',jdecode('Jobs'),jdecode(''),'/17501.html','true',[],'',''],
	['PAGE','19801',jdecode('Photo+Album'),jdecode(''),'/19801.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Sportsplace';
theSitetree.paletteFamily='1D2D7E';
theSitetree.keyvisualId='2624';
theSitetree.keyvisualName='architektur.jpg';
theSitetree.fontsetId='343';
theSitetree.graphicsetId='402';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sportsplace',
				paletteFamily: 	'1D2D7E',
				keyvisualId: 	'2624',
				keyvisualName: 	'architektur.jpg',
				fontsetId: 		'343',
				graphicsetId: 	'402',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'1D2D7E',
				b_color: 		'788EC9',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '14436',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['7060']=webappMappings['7060-25eb6fc9b22b027dc837a17031a85bdc']={
webappId:    '7060',
documentId:  '19801',
internalId:  '25eb6fc9b22b027dc837a17031a85bdc',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14301',
internalId:  '',
customField: '20101013-143508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14352',
internalId:  '',
customField: '20101015-081040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14373',
internalId:  '',
customField: '20100428-123837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14394',
internalId:  '',
customField: '20101013-151219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14415',
internalId:  '',
customField: '20100427-175605'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '14301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14436',
internalId:  '',
customField: '20100428-121801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20101013-143122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14478',
internalId:  '',
customField: '20101015-082119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20101220-215451'
};
var canonHostname = 'localhost';
var accountId     = 'ANFI20IN2076';
var companyName   = 'La+Place+Glass+Works%2C+Inc.';
var htmlTitle	  = 'LaPlace+Glass+%28985%29652-4222+Give+us+a+Break%2C+We%27ll+Fix+it%21+For+all+of+your+glass+needs';
var metaKeywords  = 'windshield%2C+autoglass%2C+rock+chip%2C+mirrors%2C+shower+door%2C+replacement+windows%2C+table+tops%2C+storefront%2C+curtain+wall%2C+door+repairs%2C+glass%2C+glazing%2C+window+panes%2C+heavy+equipment%2C+table+top%2C+window%2C+storm+door%2C+plate+glass%2C+hurricane+glass%2C+hurricane+impact%2C+laminated+glass%2C+tempered+glass%2C+custom+glass%2C+Safelite%2C+Kevs+Glass%2C+Zinsel+Glass%2C+laPlace%2C+Reserve%2C+Garyville%2C+Paulina%2C+Grand+Point%2C+Lutcher%2C+Gramercy%2C+Destrehan%2C+St+Rose%2C+Kenner%2C+New+Orleans%2C+';
var metaContents  = 'Full+service+glass+company+since+1984';
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();
};

