/* [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','5701',jdecode('Home'),jdecode(''), jdecode('%2F5701.html'), 'true',[],'',''],
	['PAGE','5752',jdecode('About+us'),jdecode(''), jdecode('%2F5752%2Findex.html'), 'true',[ 
		['PAGE','16401',jdecode('Staff'),jdecode(''), jdecode('%2F5752%2F16401.html'), 'true',[],'',''],
		['PAGE','18301',jdecode('Governing+Body'),jdecode(''), jdecode('%2F5752%2F18301.html'), 'true',[],'','']
	],'',''],
	['PAGE','5794',jdecode('Kidney+Stones'),jdecode(''), jdecode('%2F5794%2Findex.html'), 'true',[ 
		['PAGE','7401',jdecode('Types+of+Stones'),jdecode(''), jdecode('%2F5794%2F7401.html'), 'true',[],'',''],
		['PAGE','8401',jdecode('Risks+%2F+Diagnosis'),jdecode(''), jdecode('%2F5794%2F8401.html'), 'true',[],'',''],
		['PAGE','8443',jdecode('Treatment+%2F+Prevention'),jdecode(''), jdecode('%2F5794%2F8443.html'), 'true',[],'','']
	],'',''],
	['PAGE','6501',jdecode('SWL'),jdecode(''), jdecode('%2F6501%2Findex.html'), 'true',[ 
		['PAGE','9101',jdecode('Advantages+of+SWL'),jdecode(''), jdecode('%2F6501%2F9101.html'), 'true',[],'',''],
		['PAGE','9301',jdecode('Post-SWL+Patient+Instructions+'),jdecode(''), jdecode('%2F6501%2F9301.html'), 'true',[],'',''],
		['PAGE','9322',jdecode('What+to+Expect'),jdecode(''), jdecode('%2F6501%2F9322.html'), 'true',[],'','']
	],'',''],
	['PAGE','13501',jdecode('BPH'),jdecode(''), jdecode('%2F13501%2Findex.html'), 'true',[ 
		['PAGE','15801',jdecode('Causes'),jdecode(''), jdecode('%2F13501%2F15801.html'), 'true',[],'',''],
		['PAGE','15822',jdecode('Symptoms+%2F+Diagnosis'),jdecode(''), jdecode('%2F13501%2F15822.html'), 'true',[],'',''],
		['PAGE','14601',jdecode('Treatment+and+Recovery'),jdecode(''), jdecode('%2F13501%2F14601.html'), 'true',[],'','']
	],'',''],
	['PAGE','6522',jdecode('TUMT'),jdecode(''), jdecode('%2F6522.html'), 'true',[],'',''],
	['PAGE','5815',jdecode('Contact'),jdecode(''), jdecode('%2F5815.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Simple';
theSitetree.paletteFamily='F9FADA';
theSitetree.keyvisualId='4621';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='10346';
theSitetree.graphicsetId='10460';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='f9fada';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLY0XNM4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Simple',
				paletteFamily: 	'F9FADA',
				keyvisualId: 	'4621',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'10346',
				graphicsetId: 	'10460',
				contentColor: 	'000000',
				contentBGColor: 'f9fada',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'857157',
				e_color: 		'AAAAAA',
				f_color: 		'817E7E',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20111220-151648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5752',
internalId:  '',
customField: '20111220-151857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20111208-105037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5794',
internalId:  '',
customField: '20111208-101032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16401',
internalId:  '',
customField: '20111220-160710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20110712-160348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20111208-102514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18301',
internalId:  '',
customField: '20111208-143921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8443',
internalId:  '',
customField: '20111208-103108'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20111208-103430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20111207-144652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20111207-164955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9322',
internalId:  '',
customField: '20111207-145243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15822',
internalId:  '',
customField: '20111208-105134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6522',
internalId:  '',
customField: '20111208-144544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5815',
internalId:  '',
customField: '20111207-155332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15801',
internalId:  '',
customField: '20111208-105305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20111208-105251'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INZH4Y';
var companyName   = 'BAY+AREA+PARTNERS%2C+LTD.';
var htmlTitle	  = '';
var metaKeywords  = 'SWL+ESWL+Shock+Wave+Lithotripsy+Kidney+Stones+Renal+Stones+TUMT+Trans+Uretheral+Microwave+Thermotherapy+Prostate+Benign+Cancer';
var metaContents  = '';
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();
};

