/* [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','43',jdecode('Home'),jdecode(''), jdecode('%2F43.html'), 'true',[],'',''],
	['PAGE','64',jdecode('About+us'),jdecode(''), jdecode('%2F64.html'), 'true',[],'',''],
	['PAGE','73',jdecode('Products'),jdecode(''), jdecode('%2F73%2Findex.html'), 'true',[ 
		['PAGE','82',jdecode('Photos+For+Websites'),jdecode(''), jdecode('%2F73%2F82.html'), 'true',[],'',''],
		['PAGE','25106',jdecode('Videos'),jdecode(''), jdecode('%2F73%2F25106.html'), 'true',[],'',''],
		['PAGE','91',jdecode('Banners'),jdecode(''), jdecode('%2F73%2F91.html'), 'true',[],'',''],
		['PAGE','100',jdecode('eBay+Auctions'),jdecode(''), jdecode('%2F73%2F100.html'), 'true',[],'','']
	],'',''],
	['PAGE','109',jdecode('Contact'),jdecode(''), jdecode('%2F109.html'), 'true',[],'',''],
	['PAGE','1193',jdecode('Recently+Published+Photos'),jdecode(''), jdecode('%2F1193.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Pixelprofi';
theSitetree.paletteFamily='2E3836';
theSitetree.keyvisualId='1181';
theSitetree.keyvisualName='adresskartei.jpg';
theSitetree.fontsetId='184';
theSitetree.graphicsetId='223';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='2E3836';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Pixelprofi',
				paletteFamily: 	'2E3836',
				keyvisualId: 	'1181',
				keyvisualName: 	'adresskartei.jpg',
				fontsetId: 		'184',
				graphicsetId: 	'223',
				contentColor: 	'DDDDDD',
				contentBGColor: '2E3836',
				a_color: 		'2E3836',
				b_color: 		'5E726E',
				c_color: 		'000000',
				d_color: 		'455350',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '43',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-8082fc922eb673e383eb41ebb9f7def6']={
webappId:    '7060',
documentId:  '1193',
internalId:  '8082fc922eb673e383eb41ebb9f7def6',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43',
internalId:  '',
customField: '20110712-085717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64',
internalId:  '',
customField: '20110712-092206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73',
internalId:  '',
customField: '20110110-125437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82',
internalId:  '',
customField: '20080212-130537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91',
internalId:  '',
customField: '20080212-130009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100',
internalId:  '',
customField: '20100211-184335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109',
internalId:  '',
customField: '20110712-092500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1193',
internalId:  '',
customField: '20110712-093436'
};
webappMappings['1501']=webappMappings['1501-3417238']={
webappId:    '1501',
documentId:  '43',
internalId:  '3417238',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25106',
internalId:  '',
customField: '20110712-092348'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3UMZ';
var companyName   = 'Mark+Deutsch';
var htmlTitle	  = 'Auto+Trader++Photos';
var metaKeywords  = 'Autotrader%2C+Autobase%2C+Cars.com%2C+eBay%2C+eBay+Motors%2C+edmunds%2C+trucktrader%2CBarrett+Jackson++photos%2C+pictures%2C+photographs%2C+photography%2C+auction%2C+Dealerskins%2C+mercedes%2C+jaguar%2C+bmw%2C+hummer%2C+chevrolet%2C+dodge%2C+subaru%2C+toyota%2C+honda%2C+nissan%2C+audi%2C+GMC%2C+Isuzu%2C+Ford%2C+auto+dealer+solutions%2C+ebay+photos%2C+autotraderphotos%2C++photographer%2C+craigs+list+photos+long+island%2C+Ferrari+photographs+restored+long+island+photographs+restored+new+york+mark+deutsch+sell+your+car+truck+sales+mark+deutsch+ebay+Ferrari+Mustang+Corvette+Dino+Daytona+Ferrari+pictures%2C+mark+deutsch%2C+bentley+rolls+royce++++';
var metaContents  = 'Car+Dealers+Sell+more+cars+on+the+web.+Better+photographs+help+to+make+your+phone+ring+and+create+more+sales.+Auto+and+truck+Photos+for+Cars.com%2C+Autobase%2C+Autotrader%2C+eBay+Auctions%2C+barrett+jackson%2C+Robb+Report%2C+Facebook++and+other+automotive+sites.+Also%2C+ad+copy+for+automotive+and+truck+sales.+Photography+for+automotive+and+real+estate+industry+on+long+island+and+new+york+area.+';
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();
};

