/* [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 theSitetree=[ 
	['PAGE','43',jdecode('Home'),jdecode(''),'/43.html','true',[],''],
	['PAGE','6801',jdecode('Examples+of+our+work'),jdecode(''),'/6801.html','true',[],''],
	['PAGE','7101',jdecode('About+us'),jdecode(''),'/7101.html','true',[],''],
	['PAGE','15722',jdecode('Contact'),jdecode(''),'/15722.html','true',[],'']];
var siteelementCount=4;
theSitetree.topTemplateName='Card';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='427';
theSitetree.graphicsetId='479';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Card',
				paletteFamily: 	'990000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'427',
				graphicsetId: 	'479',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				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-dcafee9755935e57d43149e3d7f21634']={
webappId:    '7060',
documentId:  '6801',
internalId:  'dcafee9755935e57d43149e3d7f21634',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43',
internalId:  '',
customField: '20091029-092346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20091120-194138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20091029-092602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15722',
internalId:  '',
customField: '20091029-092938'
};
webappMappings['1501']=webappMappings['1501-6179793']={
webappId:    '1501',
documentId:  '43',
internalId:  '6179793',
customField: '1501'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3DFR';
var companyName   = 'SuperbDecals.com';
var htmlTitle	  = 'Superb+Graphics+and+decals';
var metaKeywords  = 'Rally+Stripes%2C+Decals%2C+Decal%2C+Sticker%2C+Stickers%2C+Logo%2C+Logos%2C+Car%2C+Truck%2C+Motorcycle%2C+Graphics%2C+Graphic%2C+Side%2C+Sayings%2C+Helmet%2C+Mustang%2C+Charger%2C+Avenger%2C+Camaro%2C+Ram+Air%2C+Mini%2C+Copper%2C+Hummer%2C+H2%2C+H1%2C+Hood%2C+Smart%2C+Smart+car%2C+Magnum%2C+Dodge%2C+Ford%2C+Chevy%2C+Honda%2C+Wing%2C+Helmet%2C+GO+Cart%2C+Kart%2C+Go+Kart%2C+Golf+Cart%2C+Flames%2C+Flame%2C+Side%2C+Subaru%2C+WRX%2C+STI%2C+SRT%2C+Srt4%2C+Neon%2C+Superlift%2C+Fox%2C+Skull%2C+Skulls%2C+Tribal%2C+Gothic%2C+Lift%2C+Lift+it%2C+Jeep%2C+';
var metaContents  = 'HTML++HEAD++meta+name%3Dgoogle-site-verification+content%3DfZ-T1XcVYnACvXAbzQWdH-SV0pIawH8aiThrTSIrwL4+%2F+TITLESuperb+Graphics+and+Decals%2FTITLE++META+NAME%3DKeywords+CONTENT%3DDecal%2C+Decals%2C+Graphics%2C+Graphic%2C+Helmet%2C+Rally+Stripes%2C+Stripe%2C+Helmet%2C+Motorcylce%2C+Carm+Truck%2C+Sticker%2C+Stickers+++META+NAME%3DDescription+CONTENT%3DVinyl+Graphics+Rallys+stripes+and+decals+for+cars+trucks+boats+and+Motorcycles++META+NAME%3DAuthor+CONTENT%3Dsuperbgraphics%40comcast.net++%21--+META+Tags+generated+by+http%3A%2F%2Fsubmitexpress.com%2Fmetatag.html+--++%2FHEAD++';
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();
};
