/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','1901',jdecode('Legal+Areas'),jdecode(''),'/1901.html','true',[],'',''],
	['PAGE','1922',jdecode('Contact+Us'),jdecode(''),'/1922.html','true',[],'',''],
	['PAGE','11212',jdecode('Immigration+Glossary'),jdecode(''),'/11212.html','true',[],'',''],
	['PAGE','1943',jdecode('Updates'),jdecode(''),'/1943.html','true',[],'',''],
	['PAGE','1964',jdecode('About+Us'),jdecode(''),'/1964/index.html','true',[ 
		['PAGE','1985',jdecode('Our+Team'),jdecode(''),'/1964/1985.html','true',[],'',''],
		['PAGE','2006',jdecode('Our+History'),jdecode(''),'/1964/2006.html','true',[],'',''],
		['PAGE','2027',jdecode('How+to+find+us'),jdecode(''),'/1964/2027.html','true',[],'','']
	],'',''],
	['PAGE','2048',jdecode('Interesting+Links+%26+Atlanta+USCIS+Direction'),jdecode(''),'/2048.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Hustings';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='26642';
theSitetree.graphicsetId='13457';
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: 			'Hustings',
				paletteFamily: 	'990000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'26642',
				graphicsetId: 	'13457',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FBFBFB',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100228-064351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20100228-065147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1922',
internalId:  '',
customField: '20100723-073608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1943',
internalId:  '',
customField: '20100622-102147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1964',
internalId:  '',
customField: '20100622-104911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1985',
internalId:  '',
customField: '20100622-105110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2006',
internalId:  '',
customField: '20090115-165449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2027',
internalId:  '',
customField: '20090310-223902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2048',
internalId:  '',
customField: '20090422-235125'
};
webappMappings['7008']=webappMappings['7008-195']={
webappId:    '7008',
documentId:  '1922',
internalId:  '195',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11212',
internalId:  '',
customField: '20090312-224407'
};
var canonHostname = 'localhost';
var accountId     = 'ANFI10INX27E';
var companyName   = 'Shabani+%26+Associates%2C+P.C.+Global+U.S.+and+Canada+Immigration+';
var htmlTitle	  = 'Shabani+%26+Associates%2C+P.C.';
var metaKeywords  = 'Alabama%2C+Birmingham%2C+Jefferson+County%2C+Shelby+county%2C+Etowah%2C+legal+news%2C+immigration+law%2C+lawyer%2C+attorney+news%2C+in-house+counsel%2C+law+magazine%2C+legal+professionals+only%2C+court+decision%2C+law+firm+intelligence%2C+legal+courts%2C+Am+Law+100%2C+supreme+court%2C+national+law+news%2C+national+legal+news%2C+legal+newspaper%2C+law+firms%2C+Extraordinary+Ability%2C+Specialized+Immigration+Knowledge%2C+fiancee+visas%2C+fiancee+visa+process%2C+marriage%2C+marry+US+citizen%2C+spouse%2C+K-1+Visa%2C+fiancees+of+US+citizen%2C+marriage+between+nationals%2C+K-1+Fiancee+Visa%2C+compare+Fiancee+Visa+Spouse+Visa%2C+Spouse+Visa%2C+K-3+Spouse+Visa%2C+Fiancee+Visa+lawyer%2C+Fiancee+Visa+Alabama+Lawyer%2B+';
var metaContents  = 'Michaelshabani.com+is+the+Webs+leading+Alabama%2C+Birmingham+legal+site+and+immigration+law%2C+investment%2C+detention%2C+and+deportation+for+business+and+the+public';
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();
};
