/* [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','1601',jdecode('Home'),jdecode(''), jdecode('%2F1601.html'), 'true',[],'',''],
	['PAGE','3601',jdecode('Why+Outsource%3F'),jdecode(''), jdecode('%2F3601.html'), 'true',[],'',''],
	['PAGE','3622',jdecode('Software+%26+Training'),jdecode(''), jdecode('%2F3622.html'), 'true',[],'',''],
	['PAGE','3643',jdecode('Our+Clients'),jdecode(''), jdecode('%2F3643.html'), 'true',[],'',''],
	['PAGE','3664',jdecode('QUICK+QUOTE'),jdecode(''), jdecode('%2F3664.html'), 'true',[],'',''],
	['PAGE','3685',jdecode('Tell+us+what+you+think%21'),jdecode(''), jdecode('%2F3685.html'), 'true',[],'',''],
	['PAGE','19201',jdecode('Contact'),jdecode(''), jdecode('%2F19201.html'), 'true',[],'',''],
	['PAGE','23201',jdecode('Tax+Refund+Services'),jdecode(''), jdecode('%2F23201.html'), 'true',[],'',''],
	['PAGE','26001',jdecode('Costs+of+Outsourcing'),jdecode(''), jdecode('%2F26001.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Easy';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='49';
theSitetree.graphicsetId='57';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Easy',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'49',
				graphicsetId: 	'57',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003366',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				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:  '1601',
internalId:  '',
customField: '20110331-173355'
};
webappMappings['7008']=webappMappings['7008-28855']={
webappId:    '7008',
documentId:  '3664',
internalId:  '28855',
customField: 'language:en;country:US;'
};
webappMappings['7005']=webappMappings['7005-3133']={
webappId:    '7005',
documentId:  '3685',
internalId:  '3133',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20100720-063650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3622',
internalId:  '',
customField: '20100707-145606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3643',
internalId:  '',
customField: '20100707-143321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3664',
internalId:  '',
customField: '20100706-160912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3685',
internalId:  '',
customField: '20100708-060909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20100922-123106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20101103-154645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26001',
internalId:  '',
customField: '20111011-144730'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INLBMJ';
var companyName   = 'PayNow+Payroll';
var htmlTitle	  = 'Payroll+Services+in+Dublin+Ireland+and+Thesaurus+Payroll+Software+at+a+discount';
var metaKeywords  = 'irish%2C+payroll%2C+Ireland%2C+outsourcing%2C+service%2C+processing+services%2C+Dublin%2C+bureau%2C+tax%2C+filing%2C+pensions%2C+pension%2C+VHI%2C+BUPA%2C+P30%2C+P60%2C+P35%2C+P45%2C+P30s%2C+P45s%2C+P60s%2C+ledger%2C+interface%2C+employee%2C+support%2C+paypath%2C+EFT%2C+BACS%2C+transfer%2C+year+end%2C+start-ups%2C+new+business%2C+software%2C+payroll+provider%2C+payrll%2C+payrol%2C+pyroll%2C+Clonskeagh%2C+Donnybrook%2C+softcom%2C+ceridian+HR%2C+northgate+payroll%2C+paycheckplus%2C+deloitte%2C+ernest++young%2C+pwc%2C+mazaars%2C+intelligo%2C+carigen%2C+ipass%2C+irish+payroll+associationThesaurus+Payroll%2CThesuaurus+Payroll+Software%2CThesaurus+Payroll+Download%2CThesaurus+Payroll+Training%2Csoftware+payroll%2Chuman+resource+management%2Chuman+resources%2Csmall+business+software%2Csmall+business+accounting+software%2Cfinancial+services+in+ireland%2Cpayroll+service+payroll%2Cpayroll+cork%2Cpayroll+dublin%2Cpayroll+small%2Cmanual+payroll%2Ctax+on+wages%2Cemployee+tax%2Csage+50+payroll%2Cpayroll+department%2Cpayroll+download%2Cpayroll+bureaux%2Cemployee+benefits%2Ctime+and+attendance%2Csalary+survey%2Chuman+resources+systems%2Cminimum+wage+ireland%2Cquick+book%2Chr+strategy%2Csalary+scale%2Coutsourcing+companies%2Cquickbooks%2Chr+policies%2Cwage+calculator%2Cpay+calculator%2Coutsource%2Ccpa%2Csoftware+outsourcing%2Cchartered+accountant%2Cpayroll+ireland%2Chrm%2Cadp%2Cservices+payroll%2Cpayroll+ptocessing%2Cpayroll+service%2Cpayroll+services%2Cservice+payroll%2Cservices+payroll%2Ccompany+payroll%2Cpayroll+bureaus%2Cpayroll+bureaux%2Coutsourcing+payroll+service%2Coutsourced+payroll+service%2Cpayroll+outsourcing+service%2C%0D%0A%0D%0A%0D%0A%0D%0A%2Cbusiness+accounting%2Csalary+calculator%2Ctax+calculator%2Cincome+tax+calculator%2Cquicken%2Chr+management%2Csmall+business%2Csmall+business+accounting%2Cbookkeeping%2Chr+outsourcing%0D%0A%0D%0Auniversal+social+charge%2Cbudget+2011%2Cusc%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%2C';
var metaContents  = 'Payroll+Services+in+Dublin+Ireland+and+Thesaurus+Payroll+Software+at+a+discountThesaurus+Payroll+Training';
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();
};

