/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','452',jdecode('Current+glass+works'),jdecode(''),'/452/index.html','true',[ 
		['PAGE','473',jdecode('Fish+Beads'),jdecode(''),'/452/473.html','true',[],''],
		['PAGE','494',jdecode('Miranda+Beads'),jdecode(''),'/452/494.html','true',[],''],
		['PAGE','515',jdecode('Sculptures+'),jdecode(''),'/452/515.html','true',[],'']
	],''],
	['PAGE','8701',jdecode('Fish%26%23x27%3B+Beads'),jdecode(''),'/8701.html','true',[],''],
	['PAGE','8801',jdecode('Miranda%26%23x27%3Bs+Beads'),jdecode(''),'/8801.html','true',[],''],
	['PAGE','19358',jdecode('Exhibitions'),jdecode(''),'/19358/index.html','true',[ 
		['PAGE','19367',jdecode('Background+information'),jdecode(''),'/19358/19367.html','true',[],''],
		['PAGE','19376',jdecode('Artist'),jdecode(''),'/19358/19376.html','true',[],'']
	],''],
	['PAGE','6501',jdecode('Beaded+jewelry'),jdecode(''),'/6501.html','true',[],''],
	['PAGE','5006',jdecode('Guestbook'),jdecode(''),'/5006/index.html','true',[ 
		['PAGE','5001',jdecode('Read+Guestbook'),jdecode(''),'/5006/5001.html','true',[],'']
	],''],
	['PAGE','6601',jdecode('Contact'),jdecode(''),'/6601/index.html','true',[ 
		['PAGE','6622',jdecode('Studio+Location'),jdecode(''),'/6601/6622.html','true',[],''],
		['PAGE','6643',jdecode('Gallery+Location'),jdecode(''),'/6601/6643.html','true',[],'']
	],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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['1002']=webappMappings['1002-5006AHW050INEB24']={
webappId:    '1002',
documentId:  '5006',
internalId:  '5006AHW050INEB24',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-7e8a1574ab622486dcc1ee533115c414']={
webappId:    '7060',
documentId:  '6501',
internalId:  '7e8a1574ab622486dcc1ee533115c414',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-220ede8850abade8b088f69971743e0a']={
webappId:    '7060',
documentId:  '8701',
internalId:  '220ede8850abade8b088f69971743e0a',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19358',
internalId:  '',
customField: '20090610-222753'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6622',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20070925-143843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20090610-215546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20070928-170414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20070924-174138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20070924-174138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20071012-212043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5006',
internalId:  '',
customField: '20070924-175631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20070924-175631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20070927-180001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6622',
internalId:  '',
customField: '20070927-180444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6643',
internalId:  '',
customField: '20070927-181106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20071011-143313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20071011-143702'
};
webappMappings['1003']=webappMappings['1003-ahw050ineb2411aebf1c606']={
webappId:    '1003',
documentId:  '8801',
internalId:  'ahw050ineb2411aebf1c606',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19367',
internalId:  '',
customField: '20090610-223148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19376',
internalId:  '',
customField: '20090610-223509'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INEB24';
var companyName   = 'Blowfishfamilyglass.com';
var htmlTitle	  = 'Blowfishfamilyglass.com';
var metaKeywords  = 'Dicro%2C+beads%2C+jewelry%2C+diamonds%2C+moldivite%2C+lamp+worked%2C+glass%2C+boro+glass%2C+silver%2C+Atocha+silver%2C+beaded+jewelry%2C+glass+art%2C+glass+jewelry%2C+sculpture%2C+Maui%2C+pipes%2C+Fish%2C+Miranda%2C+Glass+beads%2C+herkimer+diamond.+';
var metaContents  = 'Blowfish+glass+offers+a+wide+selection+of+fine+boro-glass+works+This+family+run+business+is+comprised+of+many+talented+members%2C+each+with+their+own+special+talents+from+beads+and+sculpture+to+functional+glass+pieces+for+home+and+personal+use+Visa+M%2FC+AMEX+and+Discover+accepted+and+shipping+available+same+day';
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();
};
