/* [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','201',jdecode('Home'),jdecode(''),'/201.html','true',[],'',''],
	['PAGE','111201',jdecode('Teen+Program'),jdecode(''),'/111201.html','true',[],'',''],
	['PAGE','111222',jdecode('Adult+Program'),jdecode(''),'/111222.html','true',[],'',''],
	['PAGE','140901',jdecode('*GDL+Laws*'),jdecode(''),'/140901.html','true',[],'',''],
	['PAGE','149501',jdecode('Discounts%2FCoupons'),jdecode(''),'/149501.html','true',[],'',''],
	['PAGE','166201',jdecode('Contact+Us'),jdecode(''),'/166201.html','true',[],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Blog';
theSitetree.paletteFamily='649B30';
theSitetree.keyvisualId='11532';
theSitetree.keyvisualName='kv_11532.jpg';
theSitetree.fontsetId='32865';
theSitetree.graphicsetId='13949';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='989696';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blog',
				paletteFamily: 	'649B30',
				keyvisualId: 	'11532',
				keyvisualName: 	'kv_11532.jpg',
				fontsetId: 		'32865',
				graphicsetId: 	'13949',
				contentColor: 	'FFFFFF',
				contentBGColor: '989696',
				a_color: 		'FFB434',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-1229']={
webappId:    '7008',
documentId:  '166201',
internalId:  '1229',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20100517-150828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111201',
internalId:  '',
customField: '20100521-202803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111222',
internalId:  '',
customField: '20100517-150655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '140901',
internalId:  '',
customField: '20091221-025258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149501',
internalId:  '',
customField: '20100404-162032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '166201',
internalId:  '',
customField: '20100517-150946'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010IN3WJQ';
var companyName   = 'NORTHWESTERN+DRIVING+SCHOOL';
var htmlTitle	  = 'NORTHWESTERN+DRIVING+SCHOOL';
var metaKeywords  = 'Skokie+driving+school+evanston+driving+school+morton+grove+driving+school++chicago+driving+school+rogers+park+driving+school+niles+driving+school+des+plaines+driving+school+teen+program+instruction+permit+license+driving+schools++niles+west+niles+north+maine+east+maine+south+mather+evanston+township+driving+school+drivers+ed+learn+to+drive+adult+driving+Illinois+IL+Wilmette+Winnetka+Glenview+Lincolnwood+Northbrook+park+ridge+lakeview+lake+view+edgewater+edge+water+Lincoln+park+downtown+epic+edgewater+glen+andersonville+driving+school+US+USA+Illinois+permit+gdl+touhy+niles+dempster+++niles+north+niles+west+maine+east+senn+mather+NilesWest++Niles+North++Maine+East+Evanston+Township+Northside+College+Preparatory%2C+Lane+Tech%2C+Lane+Tech%2C+Notre+Dame%2C+New+Trier%2C+Lubavitch+Girls+H.S%2C+Regina%2C+Resurrection%2C+Hanna+Sacks+Ida+Crown+Lubavitch+H.S+Ida+Crown+%28ICJA%29++Amundsen+High+School++Loyola++Whitney+Young+driving+school+Skokie%2C+il+niles%2C+il+des+plaines%2C+il+rogers+park+morton+grove%2C+il+wilmette%2C+il+northbrook%2C+il+evanston%2C+il+traffic+school';
var metaContents  = 'NORTHWESTERN+DRIVING+SCHOOL+is+proud+to+present+excellent+driving+lessons+to+teenagers+and+adults+to+Skokie%2C+Evanston%2C+Chicago%2C+Niles%2C+Des+Plaines%2C+Morton+Grove+and+more%21%21+Learn+to+drive+today%21+Illinois+IL+Niles+North+Niles+West+Maine+East+Evanston+Highschool+High+School';
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();
};
