/* [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','139',jdecode('Home'),jdecode(''), jdecode('%2F139.html'), 'true',[],'',''],
	['PAGE','1327',jdecode('Hallprint%26%23x27%3Bs+External+Tags'),jdecode(''), jdecode('%2F1327%2Findex.html'), 'true',[ 
		['PAGE','1336',jdecode('Why+our+tags%3F'),jdecode(''), jdecode('%2F1327%2F1336.html'), 'true',[],'',''],
		['PAGE','1345',jdecode('T-Bar+anchor+tags+'),jdecode(''), jdecode('%2F1327%2F1345.html'), 'true',[],'',''],
		['PAGE','1354',jdecode('Plastic+tipped+dart+tags+'),jdecode(''), jdecode('%2F1327%2F1354.html'), 'true',[],'',''],
		['PAGE','2185',jdecode('Gamefish+and+shark+tags'),jdecode(''), jdecode('%2F1327%2F2185.html'), 'true',[],'',''],
		['PAGE','1363',jdecode('Body+cavity+tags'),jdecode(''), jdecode('%2F1327%2F1363.html'), 'true',[],'',''],
		['PAGE','1372',jdecode('Self+locking+tags'),jdecode(''), jdecode('%2F1327%2F1372.html'), 'true',[],'',''],
		['PAGE','1381',jdecode('Poly+streamer+tags'),jdecode(''), jdecode('%2F1327%2F1381.html'), 'true',[],'',''],
		['PAGE','1390',jdecode('Glue-on+shellfish+tags'),jdecode(''), jdecode('%2F1327%2F1390.html'), 'true',[],'',''],
		['PAGE','1408',jdecode('Our+colour+range'),jdecode(''), jdecode('%2F1327%2F1408.html'), 'true',[],'','']
	],'',''],
	['PAGE','1399',jdecode('PIT+Tags+'),jdecode(''), jdecode('%2F1399.html'), 'true',[],'',''],
	['PAGE','13201',jdecode('Satellite%2FArchival+Tags'),jdecode(''), jdecode('%2F13201.html'), 'true',[],'',''],
	['PAGE','11501',jdecode('Electronic+Boards'),jdecode(''), jdecode('%2F11501.html'), 'true',[],'',''],
	['PAGE','2950',jdecode('Contact+us'),jdecode(''), jdecode('%2F2950.html'), 'true',[],'',''],
	['PAGE','1426',jdecode('Prices+and+ordering'),jdecode(''), jdecode('%2F1426.html'), 'true',[],'',''],
	['PAGE','6001',jdecode('Related+Sites'),jdecode(''), jdecode('%2F6001.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Stars';
theSitetree.paletteFamily='3C5284';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10466';
theSitetree.graphicsetId='10913';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3C5284';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'netnation',
  product: 'WSCSYSSSSLYTC24G'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stars',
				paletteFamily: 	'3C5284',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10466',
				graphicsetId: 	'10913',
				contentColor: 	'FFFFFF',
				contentBGColor: '3C5284',
				a_color: 		'3C5284',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
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: '20111123-034627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20111123-033950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1399',
internalId:  '',
customField: '20111123-035645'
};
webappMappings['1002']=webappMappings['1002-2950ahw050in3gxc']={
webappId:    '1002',
documentId:  '2950',
internalId:  '2950ahw050in3gxc',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-9861523']={
webappId:    '1501',
documentId:  '139',
internalId:  '9861523',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1327',
internalId:  '',
customField: '20111123-034126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1336',
internalId:  '',
customField: '20111106-013549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1345',
internalId:  '',
customField: '20100421-225643'
};
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: '20100826-235251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1408',
internalId:  '',
customField: '20060407-075820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2950',
internalId:  '',
customField: '20101022-071235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1426',
internalId:  '',
customField: '20111106-013745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20111123-033621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20111123-035803'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.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();
};

