/* [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','139',jdecode('Home'),jdecode(''),'/139.html','true',[],''],
	['PAGE','1399',jdecode('Hallprint%26%23x27%3Bs+Food+Safe+PIT+tags'),jdecode(''),'/1399/index.html','true',[ 
		['PAGE','2923',jdecode('Product+information'),jdecode(''),'/1399/2923.html','true',[],''],
		['PAGE','2932',jdecode('Supporting+technologies'),jdecode(''),'/1399/2932.html','true',[],''],
		['PAGE','2941',jdecode('Strategic+partners'),jdecode(''),'/1399/2941.html','true',[],'']
	],''],
	['PAGE','1327',jdecode('Hallprint%26%23x27%3Bs+External+Tags'),jdecode(''),'/1327/index.html','true',[ 
		['PAGE','1336',jdecode('Why+our+tags%3F'),jdecode(''),'/1327/1336.html','true',[],''],
		['PAGE','1345',jdecode('T-Bar+anchor+tags+'),jdecode(''),'/1327/1345.html','true',[],''],
		['PAGE','1354',jdecode('Plastic+tipped+dart+tags+'),jdecode(''),'/1327/1354.html','true',[],''],
		['PAGE','2185',jdecode('Gamefish+and+shark+tags'),jdecode(''),'/1327/2185.html','true',[],''],
		['PAGE','1363',jdecode('Body+cavity+tags'),jdecode(''),'/1327/1363.html','true',[],''],
		['PAGE','1372',jdecode('Self+locking+tags'),jdecode(''),'/1327/1372.html','true',[],''],
		['PAGE','1381',jdecode('Poly+streamer+tags'),jdecode(''),'/1327/1381.html','true',[],''],
		['PAGE','1390',jdecode('Glue-on+shellfish+tags'),jdecode(''),'/1327/1390.html','true',[],''],
		['PAGE','1408',jdecode('Our+colour+range'),jdecode(''),'/1327/1408.html','true',[],'']
	],''],
	['PAGE','2950',jdecode('Contact+us'),jdecode(''),'/2950.html','true',[],''],
	['PAGE','1426',jdecode('Prices+and+ordering'),jdecode(''),'/1426.html','true',[],''],
	['PAGE','6001',jdecode('Related+Sites'),jdecode(''),'/6001.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='5351C2';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10894';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Alpha',
				paletteFamily: 	'5351C2',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10894',
				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: 		'5351C2',
				e_color: 		'5351C2',
				f_color: 		'5351C2',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '139',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139',
internalId:  '',
customField: '20071208-112510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20090509-085145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1399',
internalId:  '',
customField: '20080506-135808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2923',
internalId:  '',
customField: '20070819-031937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2932',
internalId:  '',
customField: '20080506-135920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2941',
internalId:  '',
customField: '20080427-221547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1327',
internalId:  '',
customField: '20061119-120639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1336',
internalId:  '',
customField: '20080506-140244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1345',
internalId:  '',
customField: '20100225-062758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1354',
internalId:  '',
customField: '20100421-024540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2185',
internalId:  '',
customField: '20060604-015311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1363',
internalId:  '',
customField: '20060407-070117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1372',
internalId:  '',
customField: '20060407-070650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1381',
internalId:  '',
customField: '20070323-084145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1390',
internalId:  '',
customField: '20070819-033750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1408',
internalId:  '',
customField: '20060407-075820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2950',
internalId:  '',
customField: '20080427-215358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1426',
internalId:  '',
customField: '20080427-215157'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3GXC';
var companyName   = 'Hallprint+Fish+Tagging+Solutions';
var htmlTitle	  = 'Hallprint+Fish+Tags';
var metaKeywords  = 'fish+tags%2C+external+fish+tags%2C+PIT+tags%2C+fish+tagging%2C+RFID+tags';
var metaContents  = 'Hallprint+has+a+range+of+premium+quality+external+printed+fish+tags+and+food+safe+plastic+PIT+tags+that+represent+the+latest+innovations+in+this+field+and+allow+researchers+and+fish+organisations+worldwide+to+cost+effectively+monitor+and+assess+fish+populations+and+fish+behaviour.';
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();
};
