/* [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','19401',jdecode('Home'),jdecode(''), jdecode('%2F19401.html'), 'true',[],'',''],
	['PAGE','19701',jdecode('Services'),jdecode(''), jdecode('%2F19701.html'), 'true',[],'',''],
	['PAGE','19473',jdecode('Samples+of+our+work'),jdecode(''), jdecode('%2F19473.html'), 'true',[],'',''],
	['PAGE','19743',jdecode('Products'),jdecode(''), jdecode('%2F19743.html'), 'true',[],'',''],
	['PAGE','27201',jdecode('Sinks+and+Faucets'),jdecode(''), jdecode('%2F27201.html'), 'true',[],'',''],
	['PAGE','47701',jdecode('Tiles'),jdecode(''), jdecode('%2F47701.html'), 'true',[],'',''],
	['PAGE','71601',jdecode('Remanent+Material'),jdecode(''), jdecode('%2F71601.html'), 'true',[],'',''],
	['PAGE','33801',jdecode('Granite+Materials'),jdecode(''), jdecode('%2F33801.html'), 'true',[],'',''],
	['PAGE','56001',jdecode('Soapstone'),jdecode(''), jdecode('%2F56001.html'), 'true',[],'',''],
	['PAGE','70201',jdecode('Soapstone+from+Virginia+'),jdecode(''), jdecode('%2F70201.html'), 'true',[],'',''],
	['PAGE','70801',jdecode('Soapstone+from+Vermont'),jdecode(''), jdecode('%2F70801.html'), 'true',[],'',''],
	['PAGE','48101',jdecode('Marble+Materials'),jdecode(''), jdecode('%2F48101.html'), 'true',[],'',''],
	['PAGE','33001',jdecode('Monuments'),jdecode(''), jdecode('%2F33001.html'), 'true',[],'',''],
	['PAGE','50601',jdecode('Pet+Monuments%2CEtching'),jdecode(''), jdecode('%2F50601.html'), 'true',[],'',''],
	['PAGE','49701',jdecode('Cutting+Blocks'),jdecode(''), jdecode('%2F49701.html'), 'true',[],'',''],
	['PAGE','54301',jdecode('Quarry+Pic%26%23x27%3Bs'),jdecode(''), jdecode('%2F54301.html'), 'true',[],'',''],
	['PAGE','72401',jdecode('The+Truth+about+Radon'),jdecode(''), jdecode('%2F72401.html'), 'true',[],'',''],
	['PAGE','19494',jdecode('About+us'),jdecode(''), jdecode('%2F19494.html'), 'true',[],'',''],
	['PAGE','66701',jdecode('Contact+Us+'),jdecode(''), jdecode('%2F66701.html'), 'true',[],'',''],
	['PAGE','92612',jdecode('Businesses+We+Recommend'),jdecode(''), jdecode('%2F92612.html'), 'true',[],'',''],
	['PAGE','98812',jdecode('Butcher+Block+Tops'),jdecode(''), jdecode('%2F98812.html'), 'true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1763';
theSitetree.keyvisualName='tischler.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1763',
				keyvisualName: 	'tischler.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20100526-114536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19701',
internalId:  '',
customField: '20110308-133113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19473',
internalId:  '',
customField: '20111111-094522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66701',
internalId:  '',
customField: '20100526-192857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19743',
internalId:  '',
customField: '20110309-180735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19494',
internalId:  '',
customField: '20110809-181939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20091029-195702'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '19401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33001',
internalId:  '',
customField: '20110308-132850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33801',
internalId:  '',
customField: '20091019-194557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47701',
internalId:  '',
customField: '20091117-191637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48101',
internalId:  '',
customField: '20091117-191858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49701',
internalId:  '',
customField: '20110310-134751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50601',
internalId:  '',
customField: '20100519-110324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92612',
internalId:  '',
customField: '20110608-141248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54301',
internalId:  '',
customField: '20100312-082805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56001',
internalId:  '',
customField: '20110308-130458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70201',
internalId:  '',
customField: '20110309-175850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70801',
internalId:  '',
customField: '20110308-132704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71601',
internalId:  '',
customField: '20110309-180701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72401',
internalId:  '',
customField: '20110310-135625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98812',
internalId:  '',
customField: '20111129-173841'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INL6GL';
var companyName   = 'Winchester+Granite+and+Marble';
var htmlTitle	  = 'Winchester+Granite+and+Marble++';
var metaKeywords  = 'Winchester%2CVA%2CGranite%2C+Marble%2C+Installation%2C+countertops+%2C+vanities%2C22601%2C22602%2Ccountertops%2Cstone%2CBerryville%2CFront+Royal%2CManassas+Countertops%2CWarrenton+VA+Countertops%2Cmonuments+Leesburg+VA.+Ashburn+Va.+Fredericksburg+Va.+All+of+Virginia.+Restoration';
var metaContents  = 'Winchester+Granite+and+Marble......We+offer+Granite%2C+Marble+and+other+fine+stones+for+your+home+or+business.+Restorations';
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();
};

