/* [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','901',jdecode('Home'),jdecode(''),'/901.html','true',[],'',''],
	['PAGE','952',jdecode('About+us'),jdecode(''),'/952.html','true',[],'',''],
	['PAGE','994',jdecode('VENDOR+LIST'),jdecode(''),'/994/index.html','true',[ 
		['PAGE','5701',jdecode('Anichini'),jdecode(''),'/994/5701.html','true',[],'',''],
		['PAGE','5722',jdecode('Daniadown'),jdecode(''),'/994/5722.html','true',[],'',''],
		['PAGE','1036',jdecode('Home+Source'),jdecode(''),'/994/1036.html','true',[],'',''],
		['PAGE','1015',jdecode('Home+Treasures'),jdecode(''),'/994/1015.html','true',[],'',''],
		['PAGE','5764',jdecode('Le+Blanc'),jdecode(''),'/994/5764.html','true',[],'',''],
		['PAGE','99212',jdecode('Lulu+DK'),jdecode(''),'/994/99212.html','true',[],'',''],
		['PAGE','66422',jdecode('Matouk'),jdecode(''),'/994/66422.html','true',[],'',''],
		['PAGE','77148',jdecode('Ogallala+Comfort+Company'),jdecode(''),'/994/77148.html','true',[],'',''],
		['PAGE','1057',jdecode('Peacock+Alley+Fine+Linens'),jdecode(''),'/994/1057.html','true',[],'',''],
		['PAGE','42601',jdecode('Peter+Reed+Linens'),jdecode(''),'/994/42601.html','true',[],'',''],
		['PAGE','77348',jdecode('Pillow+Talk'),jdecode(''),'/994/77348.html','true',[],'',''],
		['PAGE','77248',jdecode('RB+Casa'),jdecode(''),'/994/77248.html','true',[],'',''],
		['PAGE','99333',jdecode('Reed+Family+Linens'),jdecode(''),'/994/99333.html','true',[],'',''],
		['PAGE','46801',jdecode('SDH'),jdecode(''),'/994/46801.html','true',[],'',''],
		['PAGE','99354',jdecode('Upholstered+Headboards'),jdecode(''),'/994/99354.html','true',[],'',''],
		['PAGE','5848',jdecode('White+Loft+Silk'),jdecode(''),'/994/5848.html','true',[],'','']
	],'',''],
	['PAGE','1183',jdecode('Linen+Care'),jdecode(''),'/1183.html','true',[],'',''],
	['PAGE','5911',jdecode('Linen+Language'),jdecode(''),'/5911.html','true',[],'',''],
	['PAGE','69264',jdecode('Thread+Count'),jdecode(''),'/69264.html','true',[],'',''],
	['PAGE','53722',jdecode('To+The+Trade'),jdecode(''),'/53722.html','true',[],'',''],
	['PAGE','66922',jdecode('Contact'),jdecode(''),'/66922.html','true',[],'',''],
	['PAGE','77269',jdecode('Email+Us'),jdecode(''),'/77269.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Basic';
theSitetree.paletteFamily='695A2C';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10828';
theSitetree.graphicsetId='11285';
theSitetree.contentColor='695A2C';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Basic',
				paletteFamily: 	'695A2C',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10828',
				graphicsetId: 	'11285',
				contentColor: 	'695A2C',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20090414-203525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5722',
internalId:  '',
customField: '20100327-195637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20100214-215036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5764',
internalId:  '',
customField: '20090403-202739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1057',
internalId:  '',
customField: '20100314-142902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42601',
internalId:  '',
customField: '20100302-091720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69264',
internalId:  '',
customField: '20100316-195202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20100505-201847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20100411-163340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46801',
internalId:  '',
customField: '20100214-210229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20100505-202443'
};
webappMappings['7008']=webappMappings['7008-7500']={
webappId:    '7008',
documentId:  '77269',
internalId:  '7500',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20100314-142521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1183',
internalId:  '',
customField: '20090418-200809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66422',
internalId:  '',
customField: '20100314-142636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5911',
internalId:  '',
customField: '20100223-213350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5848',
internalId:  '',
customField: '20090418-200425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77148',
internalId:  '',
customField: '20100410-211957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77269',
internalId:  '',
customField: '20100412-103809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66922',
internalId:  '',
customField: '20100505-204010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53722',
internalId:  '',
customField: '20100528-194428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77248',
internalId:  '',
customField: '20100410-212543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77348',
internalId:  '',
customField: '20100528-195522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99333',
internalId:  '',
customField: '20100505-204727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99212',
internalId:  '',
customField: '20100505-204532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99354',
internalId:  '',
customField: '20100506-122052'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INVA43';
var companyName   = 'Ruggeri+Gallery+Home+-+Fine+Bed+%26+Bath+Linens';
var htmlTitle	  = 'Ruggeri+Gallery';
var metaKeywords  = 'Fine+Bed+and+bath+Linens++Anichini++Peacock+Alley++Home+Source++Home+Treasures++SDH++Matouk+Bed+Linens++Bath+Linens++RB+Casa++Ogallala+Comfort+Company++Linen+Wash';
var metaContents  = 'Fine+Bed+and+bath+Linens++Anichini++Peacock+Alley++Home+Source++Home+Treasures++SDH++Matouk+Bed+Linens++Bath+Linens++RB+Casa++Ogallala+Comfort+Company++Linen+Wash';
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();
};

