/* [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','42',jdecode('Sign+Up+NEWS+LETTER'),jdecode(''),'/42.html','true',[],''],
	['PAGE','90',jdecode('Privacy+Policy'),jdecode(''),'/90.html','true',[],''],
	['PAGE','81',jdecode('Contact+us'),jdecode(''),'/81/index.html','true',[ 
		['PAGE','1750',jdecode('Contact+us+%28follow+up+page%29'),jdecode(''),'/81/1750.html','false',[],'']
	],''],
	['PAGE','63',jdecode('Press'),jdecode(''),'/63.html','true',[],''],
	['PAGE','72',jdecode('Link'),jdecode(''),'/72.html','true',[],'']];
var siteelementCount=6;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='CC3333';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='439';
theSitetree.graphicsetId='495';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='e47272';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Round',
				paletteFamily: 	'CC3333',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'439',
				graphicsetId: 	'495',
				contentColor: 	'FFFFFF',
				contentBGColor: 'e47272',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'e47272',
				b_color: 		'CC3333',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1001']=webappMappings['1001-awh010in2cc810cbc83eb3a']={
webappId:    '1001',
documentId:  '42',
internalId:  'awh010in2cc810cbc83eb3a',
customField: ''
};
webappMappings['1001']=webappMappings['1001-awh010in2cc810cb3a0b83d']={
webappId:    '1001',
documentId:  '81',
internalId:  'awh010in2cc810cb3a0b83d',
customField: ''
};
webappMappings['1001']=webappMappings['1001-awh010in2cc810cb3a0b83d']={
webappId:    '1001',
documentId:  '1750',
internalId:  'awh010in2cc810cb3a0b83d',
customField: 'followUp'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42',
internalId:  '',
customField: '20090205-124808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63',
internalId:  '',
customField: '20090204-002509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72',
internalId:  '',
customField: '20100215-230245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81',
internalId:  '',
customField: '20060727-234031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1750',
internalId:  '',
customField: '20060727-233450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90',
internalId:  '',
customField: '20060729-152218'
};
webappMappings['1501']=webappMappings['1501-947872']={
webappId:    '1501',
documentId:  '42',
internalId:  '947872',
customField: '1501'
};
var canonHostname = 'cm4all01.west-datacenter.net';
var accountId     = 'AWH010IN2CC8';
var companyName   = 'Music%2C+Retro%2C+Graphic+and+more..';
var htmlTitle	  = 'Rock%2C+Retro%2C+Vintage%2C+Artist%2C+Animal+T+shirts';
var metaKeywords  = 'Wood+Stock+Concert%2C+Omni+Peace%2C+Party+Animal%2C+Happy+Face%2C+Dogeared%2C+Make+A+Wish+Necklace%2C+%E3%83%89%E3%82%AE%E3%83%A3%E3%83%BC%E3%83%89%E3%80%81%E3%82%B8%E3%83%A3%E3%83%B3%E3%82%AF%E3%83%95%E3%83%BC%E3%83%89%E3%80%81Tote+Bag%2C+Eco+Bag%2C+Ed+Hardy%2C+Love+Kills+Slowly%2C+Geisha%2C+Tiger%2C+Edie+Sedgwick%2C+Made+U+Look%2C+Junk+Food%2C+womens+t+shirt%2C+Vintage%2C+Rock%2C+retro%2C+emo%2C+indie%2C+John++Yoko+War+is+Over%2C+Disney+Couture%2C+Bambi%2C+Fritz+the+cat%2C+Rhinestones%2C+Doors%2C+Beatles%2C+CBGB%2C+Rolling+stones+%2C+ACDC+%2C+chihuahua%2C+graphic+%2C+NY+Dolls%2C+Ramones%2C+Artist%2C+David+Bowie%2C+Clarendon%2C+Andy+Warhol%2C+Sex+Pistols%2C+Basquiat+%2C+Yoshitomo+Nara%2C+Jean+Michel+Basquiat%2C+Rocket%2C+Cherry+Bomb%2C+Guns+n+Roses%2C+Banana%2C+Velvet+Underground%2C+Clarendon%2C+Edie+Sedgwick%2C+Piccaso%2C+Skull%2C+Corset+Beater%2C+Harmless+Kitty%2C+RUDI%2C+Peggy+Moffit%2C+Black+Sabbath%2C+Pink+Floyd%2C+Lynyrd+Skynyrd%2C+NIRVANA%2C+Grateful+Dead%2C+Black+Sabbath%2C+Motley+Crue+%2C+Bon+Jovi%2C+Motorhead%2C+Misfits%2C+The+Allman+Brothers+Band%2C+Beastie+Boys%2C+Butterfly%2C+Pan+Am+Bag%2C+French%2C+Richard+Prince%2C+Yusaku+Hanakuma%2C+Hippie%2C+Eagles%2C+The+Who%2C+Marilyn+Monroe%2C+Andy+Warhol%2C+Mens+Basquiat+T+shirt%2C+Youth+Rock+T+shirts%2C+Bob+Marley+Dog+T-shirt%2C+Banana+Tote+Bag%2C+Bob+Marley+Tote+Bag%2C+Red+Hot+Chili+Peppers%2C+DEVO%2C+Marilyn+Manson%2C+Ozzy+Osbourne%2C+Smurf%2C+I+Love+Nerds%2C+Obama+T+shirt%2C+%E3%82%AA%E3%83%90%E3%83%9E%E3%80%80T%E3%82%B7%E3%83%A3%E3%83%84%2C+Local+Celebrity';
var metaContents  = 'Fashion+T+shirt+Select+shop+for+Women%2C+Men+and+Kids.+Find+Rock+star%2C+Concert%2C+Vintage%2C+Retro+and+artists++t+shirts.+Ed+Hardy%2C+MADE+U+LOOK%2C+JUNK+FOOD%2C+Smashing+Grandpa%2C+Disney+Couture%2C+Basquiat%2C+Yoshitomo+Nara%2C+Barack+Obama+and+more.+';
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();
};
