/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','652',jdecode('Our+Products'),jdecode(''),'/652.html','true',[],'',''],
	['PAGE','24301',jdecode('Data+Conversion'),jdecode(''),'/24301.html','true',[],'',''],
	['PAGE','53501',jdecode('Conversion+Pricing'),jdecode(''),'/53501.html','true',[],'',''],
	['PAGE','61401',jdecode('Toner+%26+Supplies'),jdecode(''),'/61401.html','true',[],'',''],
	['PAGE','736',jdecode('Service+%26+Support'),jdecode(''),'/736.html','true',[],'',''],
	['PAGE','18901',jdecode('Used+Equipment'),jdecode(''),'/18901.html','true',[],'',''],
	['PAGE','757',jdecode('About+us'),jdecode(''),'/757.html','true',[],'',''],
	['PAGE','778',jdecode('Contact'),jdecode(''),'/778.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Stripes';
theSitetree.paletteFamily='CC6600';
theSitetree.keyvisualId='1617';
theSitetree.keyvisualName='cd_einlegen.jpg';
theSitetree.fontsetId='245';
theSitetree.graphicsetId='309';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FCFCFB';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stripes',
				paletteFamily: 	'CC6600',
				keyvisualId: 	'1617',
				keyvisualName: 	'cd_einlegen.jpg',
				fontsetId: 		'245',
				graphicsetId: 	'309',
				contentColor: 	'000000',
				contentBGColor: 'FCFCFB',
				a_color: 		'CC6600',
				b_color: 		'DEDECA',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-104']={
webappId:    '7008',
documentId:  '652',
internalId:  '104',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-105']={
webappId:    '7008',
documentId:  '778',
internalId:  '105',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-106']={
webappId:    '7008',
documentId:  '736',
internalId:  '106',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-107']={
webappId:    '7008',
documentId:  '18901',
internalId:  '107',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100228-103704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20081230-084432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24301',
internalId:  '',
customField: '20081204-131916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53501',
internalId:  '',
customField: '20081204-132139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20081205-103241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20100228-111156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20081204-132520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '778',
internalId:  '',
customField: '20100228-093833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61401',
internalId:  '',
customField: '20091023-111715'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INFSSD';
var companyName   = '';
var htmlTitle	  = '';
var metaKeywords  = 'scanning%2C+microfilm%2C%2C+microfiche%2C+document+scanning%2C+scanners%2C+imaging%2C+scan+to+cd%2C+scan+to+dvd%2C+microfilm+equipment+repair%2C+toner%2C+data+conversion%2C+equipment+service%2C+Minolta%2C+Canon%2C+Bell+%26+Howell%2C+Kodak%2C+Alos';
var metaContents  = 'Microfilm%2C+Imaging%2C+Document+Imaging%2C+Scanner%2C+Microfilming%2C+Data+Conversion';
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();
};
