/* [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','1012',jdecode('Home'),jdecode(''), jdecode('%2F1012.html'), 'true',[],'',''],
	['PAGE','82115',jdecode('wholesale+info'),jdecode(''), jdecode('%2F82115.html'), 'true',[],'',''],
	['PAGE','18154',jdecode('Fairies%2F+Angels'),jdecode(''), jdecode('%2F18154.html'), 'true',[],'',''],
	['PAGE','92912',jdecode('Original+Paintings'),jdecode(''), jdecode('%2F92912.html'), 'false',[],'',''],
	['PAGE','92933',jdecode('Greeting+Cards'),jdecode(''), jdecode('%2F92933.html'), 'false',[],'',''],
	['PAGE','92954',jdecode('Mouse+Pads'),jdecode(''), jdecode('%2F92954.html'), 'false',[],'',''],
	['PAGE','92975',jdecode('Coffee+Mugs'),jdecode(''), jdecode('%2F92975.html'), 'false',[],'',''],
	['PAGE','92996',jdecode('Prints'),jdecode(''), jdecode('%2F92996.html'), 'false',[],'',''],
	['PAGE','1210',jdecode('Dragon+Art'),jdecode(''), jdecode('%2F1210.html'), 'true',[],'',''],
	['PAGE','1126',jdecode('Goddess%2FWitches'),jdecode(''), jdecode('%2F1126.html'), 'true',[],'',''],
	['PAGE','78971',jdecode('Mermaids'),jdecode(''), jdecode('%2F78971.html'), 'true',[],'',''],
	['PAGE','18133',jdecode('Unicorn%2FMythical+'),jdecode(''), jdecode('%2F18133.html'), 'true',[],'',''],
	['PAGE','18175',jdecode('OOAK+Crafts'),jdecode(''), jdecode('%2F18175.html'), 'false',[],'',''],
	['PAGE','18196',jdecode('Magnets+Stickers+etc'),jdecode(''), jdecode('%2F18196.html'), 'false',[],'',''],
	['PAGE','18112',jdecode('Ebay+Auctions'),jdecode(''), jdecode('%2F18112.html'), 'false',[],'',''],
	['PAGE','1252',jdecode('Fabric+Blocks'),jdecode(''), jdecode('%2F1252.html'), 'false',[],'',''],
	['PAGE','1231',jdecode('Cross-Stitch+Patterns'),jdecode(''), jdecode('%2F1231.html'), 'false',[],'',''],
	['PAGE','81408',jdecode('Staffs+wands+tarot'),jdecode(''), jdecode('%2F81408.html'), 'true',[],'',''],
	['PAGE','81437',jdecode('Meet+the+Artist'),jdecode(''), jdecode('%2F81437.html'), 'true',[],'',''],
	['PAGE','93112',jdecode('TART+My+art+tubes'),jdecode(''), jdecode('%2F93112.html'), 'false',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='4A587F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10344';
theSitetree.graphicsetId='10449';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='4A587F';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLY0XNM4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Akropolis',
				paletteFamily: 	'4A587F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10344',
				graphicsetId: 	'10449',
				contentColor: 	'FFFFFF',
				contentBGColor: '4A587F',
				a_color: 		'4A587F',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1012',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1012',
internalId:  '',
customField: '20111218-020758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18133',
internalId:  '',
customField: '20111218-021711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92933',
internalId:  '',
customField: '20110408-150136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1210',
internalId:  '',
customField: '20111218-021151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1231',
internalId:  '',
customField: '20100109-115732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1252',
internalId:  '',
customField: '20100728-194645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18112',
internalId:  '',
customField: '20080623-132039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1126',
internalId:  '',
customField: '20111217-233354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18154',
internalId:  '',
customField: '20111217-232202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18175',
internalId:  '',
customField: '20101008-123507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18196',
internalId:  '',
customField: '20100625-023921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78971',
internalId:  '',
customField: '20111217-233626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81408',
internalId:  '',
customField: '20111217-234022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81437',
internalId:  '',
customField: '20111218-020922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82115',
internalId:  '',
customField: '20111217-231949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92912',
internalId:  '',
customField: '20110408-150136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92954',
internalId:  '',
customField: '20110408-150136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92975',
internalId:  '',
customField: '20110408-150136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92996',
internalId:  '',
customField: '20110408-150136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93112',
internalId:  '',
customField: '20110408-151530'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INXXCS';
var companyName   = 'Fantasy+Artist+Lori+Karels';
var htmlTitle	  = 'Lorikarels.com';
var metaKeywords  = 'Lori+Karels+art+work+by+self+representing+artist+Fairies%2C+Dragons%2C+Unicorns%2C+Goddesses%2C+Wildlife%2C+Mythical+Cratures+';
var metaContents  = 'Lori+Karels+art+work+by+self+representing+artist+Fairies%2C+Dragons%2C+Unicorns%2C+Goddesses%2C+Wildlife%2C+Mythical+Cratures+';
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();
};

