/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','552',jdecode('About+us'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','573',jdecode('Products'),jdecode(''),'/573/index.html','true',[ 
		['PAGE','594',jdecode('First+Product'),jdecode(''),'/573/594.html','true',[],'',''],
		['PAGE','615',jdecode('Second+Product'),jdecode(''),'/573/615.html','true',[],'','']
	],'',''],
	['PAGE','657',jdecode('Jobs'),jdecode(''),'/657.html','true',[],'',''],
	['PAGE','699',jdecode('Contact'),jdecode(''),'/699.html','true',[],'',''],
	['PAGE','13501',jdecode('Tips+%26+Tricks'),jdecode(''),'/13501.html','true',[],'',''],
	['PAGE','16006',jdecode('Guestbook'),jdecode(''),'/16006/index.html','true',[ 
		['PAGE','16001',jdecode('Read+Guestbook'),jdecode(''),'/16006/16001.html','true',[],'',''],
		['PAGE','38001',jdecode('New+page'),jdecode(''),'/16006/38001.html','true',[],'','']
	],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Impulse';
theSitetree.paletteFamily='84AACA';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10413';
theSitetree.graphicsetId='10679';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='84AACA';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Impulse',
				paletteFamily: 	'84AACA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10413',
				graphicsetId: 	'10679',
				contentColor: 	'000000',
				contentBGColor: '84AACA',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'517695',
				e_color: 		'4A6C8B',
				f_color: 		'2F6999',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-16006avec10inpnfb']={
webappId:    '1002',
documentId:  '16006',
internalId:  '16006avec10inpnfb',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-704']={
webappId:    '7008',
documentId:  '699',
internalId:  '704',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100623-160757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100301-175958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20100727-123208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20100428-135130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20090411-022103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100204-141316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20081028-141241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20090411-020038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16006',
internalId:  '',
customField: '20090922-003046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20080928-183817'
};
webappMappings['1501']=webappMappings['1501-11210904']={
webappId:    '1501',
documentId:  '501',
internalId:  '11210904',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38001',
internalId:  '',
customField: '20090608-203655'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPNFB';
var companyName   = 'Always+a+Step+Ahead';
var htmlTitle	  = '';
var metaKeywords  = 'Wine+Industry+Recruiter%2C+Recruiting%2C+Recruiter+Santa+Rosa%2C+CA%2C+Cork%2C+Barrel%2C+Wine';
var metaContents  = 'Recruiting+Associates+Network+is+a+key+resource+in+local+and+national+wine+industry+recruitment.+Our+efforts+are+driven+by+the+satisfaction+of+our+candidates+and+clients+alike.+We+are+a+one+stop+recruitment+solution+for+a+wide+variety+of+organizations+and+the++%E2%80%9Cin+the+know%E2%80%9D+recruitment+associates+for+busy+professionals.+The+simple+key+to+our+success+is+delivering+top+notch+talent+to+our+customers+and+providing+outstanding+opportunities+to+our+candidates.+';
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();
};
