/* [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','4558',jdecode('Home'),jdecode(''),'/4558.html','true',[],'',''],
	['PAGE','15544',jdecode('Restaurant+POS'),jdecode(''),'/15544/index.html','true',[ 
		['PAGE','15571',jdecode('Maitre%26%23x27%3BD'),jdecode(''),'/15544/15571.html','true',[],'',''],
		['PAGE','40109',jdecode('SAM4s+SPS-2000'),jdecode(''),'/15544/40109.html','true',[],'',''],
		['PAGE','53882',jdecode('SAM4s+SPS-500'),jdecode(''),'/15544/53882.html','true',[],'',''],
		['PAGE','4723',jdecode('HANDHELD+POS'),jdecode(''),'/15544/4723.html','true',[],'','']
	],'',''],
	['PAGE','15245',jdecode('Cash+Registers'),jdecode(''),'/15245.html','true',[],'',''],
	['PAGE','15841',jdecode('Surveillance'),jdecode(''),'/15841/index.html','true',[ 
		['PAGE','15895',jdecode('Cameras'),jdecode(''),'/15841/15895.html','true',[],'','']
	],'',''],
	['PAGE','15760',jdecode('Restaurant+Pagers'),jdecode(''),'/15760.html','true',[],'',''],
	['PAGE','15679',jdecode('Drive-thru+Systems'),jdecode(''),'/15679.html','true',[],'',''],
	['PAGE','4642',jdecode('Services'),jdecode(''),'/4642.html','true',[],'',''],
	['PAGE','55382',jdecode('Testimonials'),jdecode(''),'/55382.html','true',[],'',''],
	['PAGE','55482',jdecode('Affiliations'),jdecode(''),'/55482.html','true',[],'',''],
	['PAGE','4615',jdecode('About+Diamond+Data'),jdecode(''),'/4615.html','true',[],'',''],
	['PAGE','39446',jdecode('Contact+Us'),jdecode(''),'/39446/index.html','true',[ 
		['PAGE','39496',jdecode('Contact+Us+%28follow+up+page%29'),jdecode(''),'/39446/39496.html','false',[],'','']
	],'',''],
	['PAGE','19418',jdecode('Directions'),jdecode(''),'/19418.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Proton';
theSitetree.paletteFamily='FFFFFF';
theSitetree.keyvisualId='3532';
theSitetree.keyvisualName='kv_3532.jpg';
theSitetree.fontsetId='10445';
theSitetree.graphicsetId='10827';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Proton',
				paletteFamily: 	'FFFFFF',
				keyvisualId: 	'3532',
				keyvisualName: 	'kv_3532.jpg',
				fontsetId: 		'10445',
				graphicsetId: 	'10827',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'747474',
				e_color: 		'864242',
				f_color: 		'A9A9A9',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4558',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-219162']={
webappId:    '1501',
documentId:  '4558',
internalId:  '219162',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-56']={
webappId:    '7008',
documentId:  '39446',
internalId:  '56',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4558',
internalId:  '',
customField: '20100112-214828'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '19418',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4615',
internalId:  '',
customField: '20050720-200005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4642',
internalId:  '',
customField: '20080502-123654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53882',
internalId:  '',
customField: '20100113-214048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55382',
internalId:  '',
customField: '20091221-161707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55482',
internalId:  '',
customField: '20100518-204624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40109',
internalId:  '',
customField: '20091227-125311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4723',
internalId:  '',
customField: '20091227-125407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15544',
internalId:  '',
customField: '20091227-133935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15571',
internalId:  '',
customField: '20091227-125157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15245',
internalId:  '',
customField: '20050207-103349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15679',
internalId:  '',
customField: '20091227-133716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15760',
internalId:  '',
customField: '20071003-213548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15841',
internalId:  '',
customField: '20100517-112606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15895',
internalId:  '',
customField: '20070228-230818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19418',
internalId:  '',
customField: '20100801-192659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39446',
internalId:  '',
customField: '20091226-143303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39496',
internalId:  '',
customField: '20051214-194223'
};
var canonHostname = 'cm1b.dca2.superb.net';
var accountId     = 'ASB010INXEKF';
var companyName   = 'Service+excellence%2C+our+driving+force%21';
var htmlTitle	  = 'Diamond+Data%3ARestaurant+System+Solution+Provider%2C+Point+of+Sale+Systems.';
var metaKeywords  = 'Point+of+Sale%2C+POS%2C+POS+Albany%2C+POS+Saratoga%2C+POS+Troy%2C+POS+Schenectady%2C+Cash+Registers%2C+Surveillance+Systems%2C+DVRs%2C+Digital+Recorders%2C+Cameras%2C+Deli+Scales%2C+Drive-Thru+Communications%2C+Computer+Service%2C+Networking%2C+Pagers%2C+Restaurant+equipment%2C+Credit+Card+Processing%2C+scales%2C+panasonic+headsets%2C+headsets%2C+drive+thru+timers%2C+drive-thru+timers%2C+dvr%2C+camera%2C+computer%2C+maitred%2C+maitredpos%2C+maitred+point+of+sale%2C+POS%2C+pos%2C+POS+albany%2C+digital+dining+pos%2C+micros+pos%2C+aloha+pos%2C+restaurant+manager+pos';
var metaContents  = 'Diamond+Data+provides+sales+and+service+of+Point+of+sale+systems%2C+POS%2C+Cameras%2C+cash+registers%2C+and+loss+prevetion+tools+to+help+restaurants.+POS%2C+Cash+regsiters%2C+Handhelds%2C+Credit+Card%2C+Frequent+diner%2C+Gift+Cards%2C+Pagers%2C+headsets%2C+timers.';
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();
};
