/* [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','1501',jdecode('Home'),jdecode(''),'/1501.html','true',[],'',''],
	['PAGE','3501',jdecode('Flight+Training'),jdecode(''),'/3501.html','true',[],'',''],
	['PAGE','4001',jdecode('+Pilot+Services'),jdecode(''),'/4001.html','true',[],'',''],
	['PAGE','4022',jdecode('Maintenance'),jdecode(''),'/4022.html','true',[],'',''],
	['PAGE','4043',jdecode('Pilot+Resources'),jdecode(''),'/4043.html','true',[],'',''],
	['PAGE','10901',jdecode('Pilot+Report'),jdecode(''),'/10901.html','true',[],'',''],
	['PAGE','4064',jdecode('About+Us'),jdecode(''),'/4064.html','true',[],'',''],
	['PAGE','3722',jdecode('Contact'),jdecode(''),'/3722.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'353',
				contentColor: 	'FFFFFF',
				contentBGColor: '003390',
				a_color: 		'003390',
				b_color: 		'000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1501',
internalId:  '',
customField: '20100831-173146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20090624-232824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3501',
internalId:  '',
customField: '20100902-230035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20100914-220703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4022',
internalId:  '',
customField: '20090619-231439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4064',
internalId:  '',
customField: '20100901-230010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3722',
internalId:  '',
customField: '20100901-231842'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4043',
internalId:  '',
customField: '20090714-181052'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN36LG';
var companyName   = 'VICTORY+AVIATION';
var htmlTitle	  = '';
var metaKeywords  = 'CFI%2C+CFII%2C+MEI%2C+mei%2C+cfi%2C+cfii%2C+certified+flight+instructor%2C+certified+instrument+flight+instructor%2C+multi+engine+instructor%2C+San+Antonio+texas%2C+San+Antonio+tx+cfi%2C+San+Antonio+flight+instructor%2C+flight+training+san+antonio+texas%2C+KSAT%2C+KSSF%2C+KBAZ%2C+5c1%2C+t89%2C+1t7%2C+KHYI%2C+hyi%2C+ssf%2C+sat%2C+flight+instruction%2C+mooney%2C+beech%2C+cessna%2C+piper%2C+cirrus%2C+twin+comanche%2C+seneca%2C+baron%2C+b-55%2C+be55%2C+piper+gironimo%2C+pa-23%2C+m20j%2C+AP%2C+AP+san+antonio+tx%2C+airport%2C+airplane%2C+flying%2C+texas%2C+san+antonio%2C+wright+flyers%2C+alpha+tango+flying+service%2C+alpha+tango%2C+sky+safety%2C+stinson%2C+san+antonio+international%2C+wright+flyers+flight+instruction%2C+wright+flyers+san+antonio+texas%2C+flying+lesson%2C+learning+to+fly%2C+learn+to+fly%2C+airliner%2C+regional+jet%2C+atp%2C+atc%2C+air+traffic+control%2C+aopa%2C+flight+training%2C+jet%2C+stall%2C+lazy+eight%2C+chandelle%2C+power+on+stall%2C+cessna+152%2C+cessna+172%2C+piper+archer%2C+boerne+stage+airfield%2C+bulverde%2C+bulverde+airport%2C+willie+bolton%2C+kestrel+airpark%2C+cross+wind%2C+cross+wind+training%2C+ksat+12r%2C+16r%2C+jeppesen%2C+jepp%2C+private+pilot+kit%2C+asa%2C+student+pilot%2C++best+aviation%2C+landings.com%2C+atp+flight+school%2C+aircraft+clubs%2C+flying+club%2C+accelerated+flight+training%2C+gps%2C+instrument+approach%2C+accelerated+instrument%2C+instrument+rating%2C+private+pilot+license%2C+twin+engine%2C+skymates%2C+americanflyers.net%2C++flight+safety%2C+flight+school.+san+antonio+flight+school%2C+san+antonio+aero+club%2C+john+mitchell%2C+wrightflyers.com%2C+flight+training+academy%2C+san+antonio+flight+schools%2C+pilot+flight+training%2C+flight+academies%2C+ifr+gps%2C+texas+flight+schools%2C+texas+aviation%2C+flight+schools+in+texas%2C+multi+engine+aerodynamics%2C+initial+flight+training%2C+aviation+schools%2C+flight+schools+in+texas%2C+texas+aviation%2C+flight+training+academy%2C+flight+to+texas%2C+flight+training+texas%2C+aviation+schools+in+texas%2C+aerobatic+training%2C+harveyrihn.com%2C+atpflightschool.com%2C+pilot+license%2C+aviation+training%2C+pilot+lessons%2C+Commerical+Pilot+License%2C+Accelerated+Flight+School+%2C+Airline+Training+Programs%2C+atp%2C+skywest+airlines%2C+american+eagle+airlines%2C+cirrus+aircraft%2C+aircraft+rental%2C+training+aircraft%2C+rental+airplane%2C+charter+flight%2C+second+in+command%2C+sic%2C+air+taxi%2C++ipc%2C++bfr%2C+aviation+jobs%2C+pilot+journey%2C+sunstateaviation.com%2C+atpflightschool.com%2C+san+antonio+flight+schools%2C+skysafety.com%2C+ASA+Products%2C+I20+Form+Request%2C+Jeppesen+Private+Pilot+Kit+%2C+sportys.com%2C+sportys%2C++king+schools%2C+what+you+should+know%2C+john+and+martha+king%2C+Want+To+Be+A+Pilot%3F%2C+Need+Flight+Instruction%2C+david+clark%2C+DeltaConnectionAcademy.com%2C+langaAir.com%2C+aopa.org%2Fletsgoflying%2C+panamacademy.net%2C+AmericanFlyers.net%2C+becoming+an+airline+pilot%2C+how+to+become+an+airline+pilot%2C+aviation+careers%2C+flying+careers%2C+pilot+careers%2C+pilot+career%2C+aviation+career%2C+becoming+a+commercial+pilot%2C+american+flyer%2C+sky+king+tv+show%2C+learn+to+fly%2C+beapilot.com%2C+learning+to+fly%2C+commercial+pilot%2C+kingschools.com%2C+instrument+pilot%2C+FAA+Exam+Prep+Software%2C+soaring%2C+weather+information%2C+aviation+weather%2C+fltplan.com%2C+plight+plan%2C+flight+planning%2C+thirtythousandfeet.com%2C+100ll.com%2C+aviation+videos%2C+track+a+flight%2C+skysafety.com%2C+jeppesen+kit%2C+air+safety+flight+school%2C+i20+student+visa%2C+Aviation+Career+Training%2C+sanantonio.gov%2C+monarchair.com%2C+aviationschoolsonline.com%2C+faa.gov%2C+ntsb.gov%2C+aviation-safety.net%2C+controller.com%2C+airliners.net%2C+';
var metaContents  = 'San+Antonio+Texas+flight+school%2C+offering+full+service+flight+instruction.+Full+time+CFI%2C+CFII%2C+and+MEI+instructors.+We+also+offer+aircraft+maintenance+through+our+AP.+We+can+meet+all+of+your+flight+training+needs.';
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();
};

