/* [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','19836',jdecode('HOME'),jdecode(''),'/19836.html','true',[],''],
	['PAGE','95912',jdecode('Catalogs'),jdecode(''),'/95912.html','true',[],''],
	['PAGE','19701',jdecode('Specials'),jdecode(''),'/19701/index.html','true',[ 
		['PAGE','98012',jdecode('2010+Polo+Shirts'),jdecode(''),'/19701/98012.html','true',[],''],
		['PAGE','98033',jdecode('2010+Logo+Golf+Balls'),jdecode(''),'/19701/98033.html','true',[],'']
	],''],
	['PAGE','19794',jdecode('Request+a+Quote'),jdecode(''),'/19794.html','true',[],''],
	['PAGE','46333',jdecode('Contact'),jdecode(''),'/46333.html','true',[],''],
	['PAGE','19752',jdecode('Browse+Catalogs'),jdecode(''),'/19752.html','false',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Contrast';
theSitetree.paletteFamily='363C95';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16627';
theSitetree.graphicsetId='12215';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Contrast',
				paletteFamily: 	'363C95',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16627',
				graphicsetId: 	'12215',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-3112']={
webappId:    '7008',
documentId:  '19794',
internalId:  '3112',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19701',
internalId:  '',
customField: '20100404-210200'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '19836',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19752',
internalId:  '',
customField: '20090513-073123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46333',
internalId:  '',
customField: '20090608-090143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19794',
internalId:  '',
customField: '20090513-134827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95912',
internalId:  '',
customField: '20100324-125140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19836',
internalId:  '',
customField: '20100324-124437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98012',
internalId:  '',
customField: '20100404-210131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98033',
internalId:  '',
customField: '20100404-203842'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INLNNG';
var companyName   = 'Custom+Embroidery+%26+Promotions';
var htmlTitle	  = 'Hoopla+Pros+for+Custom+Embroidery+and+Promotional+Items+in+Atlanta%2C+GA.+++Promotional+Products%2C+Custom+Apparel%2C+Corporate+Gift%2C+Embroider+Logo%2C+Trade+Show%2C+Custom+Polo+Shirt%2C+Custom+Hat%2C+Embroider+Logo%2C+Company+Logo%2C+Company+Shirt%2C+Custom+Pen+in+Atlanta%2C+';
var metaKeywords  = 'corporate+gift%2C+embroider%2C+custom+embroider%2C+monogram%2C+custom+shirt%2C+corporate+shirt%2C+company+shirt%2C+custom+apparel%2C+custom+imprint%2C+promotional+item%2C+promotional+product%2C+glassware%2C+drinkware%2C+tervis+tumblers%2C+custom+pen%2C+custom+writing%2C+custom+hat%2C+custom+item%2C+customer+appreciation%2C+employee+gift%2C+employee+recognition%2C+employee+reward%2C+company+gift%2C+employee+gift%2C+customer+gift%2C+trade+show%2C+tradeshow%2C+embroider+logo%2C+company+logo%2C+corporate+logo%2C+atlanta+ga%2C+dunwoody+ga%2C+buckhead+ga%2C+roswell+ga%2C+alpharetta+ga%2C+marietta+ga%2C+cobb+ga%2C+gwinnett+ga%2C+lawrenceville+ga%2C+norcross+ga%2C+georgia';
var metaContents  = 'HOOPLA+PROS+is+a+promotional+apparel%2C+product+and+item+distributor+based+in+Atlanta%2C+GA.++We+specialize+in+custom+embroidery%2C+screen+printing+or+imprinting+on+the+most+popular+apparel%2C+shirts%2C+jackets%2C+bags%2C+headwear%2C+hats%2C+writing+instuments%2C+corporate+gifts%2C+customer+appreciation+ideas%2C+employee+recognition+or+awards....and+just+about+anything+else.Promotional+Item+and+Product%2C+Custom+Apparel%2C+Corporate+Gift%2C+Corporate+Item%2C+Custom+Embroider%2C+Embroider+Logo%2C+Trade+Show%2C+Custom+Shirt%2C+Custom+Hat%2C+Embroider+Logo%2C+Company+Logo%2C+Company+Shirt%2C+Custom+Pen+in+Atlanta%2C+Buckhead%2C+Dunwoody%2C+Alpharetta%2C+Roswell%2C+Marietta%2C+Georgia%2C+GA.';
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();
};

