/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','752',jdecode('About+Us+%26+Our+Team'),jdecode(''),'/752.html','true',[],'',''],
	['PAGE','836',jdecode('Contact+%26+Shipping+Info'),jdecode(''),'/836.html','true',[],'',''],
	['PAGE','7169',jdecode('DEA+Letter+'),jdecode(''),'/7169.html','true',[],'',''],
	['PAGE','7190',jdecode('Ephedrine'),jdecode(''),'/7190.html','true',[],'',''],
	['PAGE','488796',jdecode('E-Cig+Informational'),jdecode(''),'/488796.html','true',[],'',''],
	['PAGE','27501',jdecode('Links'),jdecode(''),'/27501.html','true',[],'',''],
	['PAGE','483475',jdecode('Rainbow+Photos+%26+Fun'),jdecode(''),'/483475/index.html','true',[ 
		['PAGE','483496',jdecode('2009+Tradeshow'),jdecode(''),'/483475/483496.html','true',[],'',''],
		['PAGE','483517',jdecode('2009+Boat+Trip'),jdecode(''),'/483475/483517.html','true',[],'','']
	],'',''],
	['PAGE','453576',jdecode('Michael+Guy+Bio'),jdecode(''),'/453576.html','false',[],'',''],
	['PAGE','453597',jdecode('Dean+Krell+Bio'),jdecode(''),'/453597.html','false',[],'',''],
	['PAGE','453618',jdecode('Ed+Gray+Bio'),jdecode(''),'/453618.html','false',[],'',''],
	['PAGE','453639',jdecode('Joel+Evens+Bio'),jdecode(''),'/453639.html','false',[],'',''],
	['PAGE','453660',jdecode('Eric+Ostreicher+Bio'),jdecode(''),'/453660.html','false',[],'',''],
	['PAGE','453681',jdecode('Chuck+Gray+Bio'),jdecode(''),'/453681.html','false',[],'',''],
	['PAGE','453702',jdecode('John+Gray+Bio'),jdecode(''),'/453702.html','false',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Zoe';
theSitetree.paletteFamily='243356';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='414';
theSitetree.graphicsetId='456';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLYTC2ZA'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Zoe',
				paletteFamily: 	'243356',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'414',
				graphicsetId: 	'456',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'1B2B52',
				e_color: 		'676F74',
				f_color: 		'FE7F01',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-11173186']={
webappId:    '1501',
documentId:  '701',
internalId:  '11173186',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100318-152934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20091203-121920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7169',
internalId:  '',
customField: '20090507-102637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7190',
internalId:  '',
customField: '20100323-104347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '836',
internalId:  '',
customField: '20090727-122132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20080925-123815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '488796',
internalId:  '',
customField: '20100513-102645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '453576',
internalId:  '',
customField: '20090803-113105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '453597',
internalId:  '',
customField: '20090803-113527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '453618',
internalId:  '',
customField: '20090803-114448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '453639',
internalId:  '',
customField: '20090803-115111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '453660',
internalId:  '',
customField: '20090915-102715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '453681',
internalId:  '',
customField: '20090803-120705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '453702',
internalId:  '',
customField: '20090803-121016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '483475',
internalId:  '',
customField: '20091203-125443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '483496',
internalId:  '',
customField: '20091202-150357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '483517',
internalId:  '',
customField: '20091202-151015'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INP74B';
var companyName   = 'Rainbow+Sales+Distributing+Inc.';
var htmlTitle	  = 'RainbowSales.net';
var metaKeywords  = '';
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();
};

