/* [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 theSitetree=[ 
	['PAGE','6401',jdecode('Home'),jdecode(''),'/6401.html','true',[],''],
	['PAGE','6473',jdecode('About+LIG'),jdecode(''),'/6473/index.html','true',[ 
		['PAGE','6515',jdecode('Our+history'),jdecode(''),'/6473/6515.html','true',[],''],
		['PAGE','6536',jdecode('How+to+find+us'),jdecode(''),'/6473/6536.html','true',[],''],
		['PAGE','6557',jdecode('Contact'),jdecode(''),'/6473/6557.html','true',[],'']
	],''],
	['PAGE','6494',jdecode('Our+Team'),jdecode(''),'/6494/index.html','true',[ 
		['PAGE','22301',jdecode('Dan+R.+Larsson+-+Attorney'),jdecode(''),'/6494/22301.html','true',[],''],
		['PAGE','22222',jdecode('Staff'),jdecode(''),'/6494/22222.html','true',[],'']
	],''],
	['PAGE','6452',jdecode('Immigration+Services'),jdecode(''),'/6452/index.html','true',[ 
		['PAGE','12901',jdecode('Family'),jdecode(''),'/6452/12901.html','true',[],''],
		['PAGE','12922',jdecode('Employment'),jdecode(''),'/6452/12922.html','true',[],''],
		['PAGE','12943',jdecode('Compliance'),jdecode(''),'/6452/12943.html','true',[],''],
		['PAGE','12964',jdecode('Deportation'),jdecode(''),'/6452/12964.html','true',[],''],
		['PAGE','12985',jdecode('U.S.+Citizenship'),jdecode(''),'/6452/12985.html','true',[],''],
		['PAGE','13006',jdecode('Consular'),jdecode(''),'/6452/13006.html','true',[],'']
	],''],
	['PAGE','34501',jdecode('Existing+Client+Services'),jdecode(''),'/34501.html','true',[],''],
	['PAGE','6599',jdecode('News+and+Events'),jdecode(''),'/6599.html','true',[],''],
	['PAGE','6578',jdecode('Immigration+Links'),jdecode(''),'/6578.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Kalkutta';
theSitetree.paletteFamily='5A5EB5';
theSitetree.keyvisualId='6172';
theSitetree.keyvisualName='kv_6172.jpg';
theSitetree.fontsetId='11141';
theSitetree.graphicsetId='11947';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='B2B4E6';
var theTemplate={
				name: 			'Kalkutta',
				paletteFamily: 	'5A5EB5',
				keyvisualId: 	'6172',
				keyvisualName: 	'kv_6172.jpg',
				fontsetId: 		'11141',
				graphicsetId: 	'11947',
				contentColor: 	'000000',
				contentBGColor: 'B2B4E6',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				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:  '6401',
internalId:  '',
customField: '20090422-094124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6452',
internalId:  '',
customField: '20081109-122305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6473',
internalId:  '',
customField: '20081110-144615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6494',
internalId:  '',
customField: '20081109-121440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6557',
internalId:  '',
customField: '20081109-102114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6515',
internalId:  '',
customField: '20081110-144439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6536',
internalId:  '',
customField: '20081109-124243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6599',
internalId:  '',
customField: '20081111-080230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6578',
internalId:  '',
customField: '20090408-185027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20081109-131832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12922',
internalId:  '',
customField: '20081109-102417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12943',
internalId:  '',
customField: '20081109-102417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12964',
internalId:  '',
customField: '20081109-102417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12985',
internalId:  '',
customField: '20081109-102417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13006',
internalId:  '',
customField: '20081109-102417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20090925-075353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22222',
internalId:  '',
customField: '20090408-184131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34501',
internalId:  '',
customField: '20081111-073442'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVBF3';
var companyName   = 'Larsson+Immigration+Group%2C+P.C.';
var htmlTitle	  = 'Larsson+Immigration+Group+-+providing+U.S.+immigration+services+world-wide';
var metaKeywords  = 'U.S.+immigration+law+lawyer+firm+america+AILA';
var metaContents  = 'U.S.+immigration+law+firm+providing+services+world+wide+member+of+American+Immigration+Lawyers+Association+%28AILA%29';
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();
};
