/* [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','4801',jdecode('Home'),jdecode(''), jdecode('%2F4801.html'), 'true',[],'',''],
	['PAGE','5601',jdecode('Introduction'),jdecode(''), jdecode('%2F5601%2Findex.html'), 'true',[ 
		['PAGE','5622',jdecode('Why+%22Go+Public%22'),jdecode(''), jdecode('%2F5601%2F5622.html'), 'true',[],'',''],
		['PAGE','5664',jdecode('An+IPO+is+not+an+Option'),jdecode(''), jdecode('%2F5601%2F5664.html'), 'true',[],'',''],
		['PAGE','5685',jdecode('The+Paragon+Option'),jdecode(''), jdecode('%2F5601%2F5685.html'), 'true',[],'','']
	],'',''],
	['PAGE','5706',jdecode('How+a+PIPE+Works'),jdecode(''), jdecode('%2F5706.html'), 'true',[],'',''],
	['PAGE','5727',jdecode('Reverse+Merger+Process'),jdecode(''), jdecode('%2F5727.html'), 'true',[],'',''],
	['PAGE','5748',jdecode('Reverse+Merger+and++PIPE'),jdecode(''), jdecode('%2F5748.html'), 'true',[],'',''],
	['PAGE','5769',jdecode('Criteria+for+an+APO'),jdecode(''), jdecode('%2F5769.html'), 'true',[],'',''],
	['PAGE','5790',jdecode('Partnering+with+Paragon'),jdecode(''), jdecode('%2F5790.html'), 'true',[],'',''],
	['PAGE','5811',jdecode('Articles+and+Information'),jdecode(''), jdecode('%2F5811.html'), 'true',[],'',''],
	['PAGE','5832',jdecode('Our+Team'),jdecode(''), jdecode('%2F5832.html'), 'true',[],'',''],
	['PAGE','5853',jdecode('Contact'),jdecode(''), jdecode('%2F5853.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='0A2447';
theSitetree.keyvisualId='2435';
theSitetree.keyvisualName='vertrag.jpg';
theSitetree.fontsetId='394';
theSitetree.graphicsetId='444';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0A2447';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Amaze',
				paletteFamily: 	'0A2447',
				keyvisualId: 	'2435',
				keyvisualName: 	'vertrag.jpg',
				fontsetId: 		'394',
				graphicsetId: 	'444',
				contentColor: 	'FFFFFF',
				contentBGColor: '0A2447',
				a_color: 		'0A2447',
				b_color: 		'081B35',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20111118-130141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20080710-160942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5622',
internalId:  '',
customField: '20080709-105622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5664',
internalId:  '',
customField: '20080710-160333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5685',
internalId:  '',
customField: '20080709-110416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5706',
internalId:  '',
customField: '20080710-132322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5727',
internalId:  '',
customField: '20080710-131117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5748',
internalId:  '',
customField: '20080710-131142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5769',
internalId:  '',
customField: '20080710-131215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5790',
internalId:  '',
customField: '20080710-160552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5811',
internalId:  '',
customField: '20100326-105641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5832',
internalId:  '',
customField: '20111118-125611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5853',
internalId:  '',
customField: '20111118-125646'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN221U';
var companyName   = 'PARAGON+CAPITAL';
var htmlTitle	  = 'Reverse+Mergers+Through+Paragon+Capital';
var metaKeywords  = 'Reverse+mergers%2C+alternative+public+offerings%2C+PIPEs%2C+PIPE%2C+Paragon%2C+Paragon+Capital';
var metaContents  = 'Paragon+Capital+sponsors+Reverse+Mergers+and+Alternative+Public+Offerings+for+U.S.+and+Chinese+Companies';
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();
};

