/* Copyright 2002-2009 */
/* Released: 2009-11-12 */

function nmtrack() {

   var accountId = 'politi';
   var srcBcSep = '>';
   function BuildCustomBreadcrumb() {
	var path = document.location.href.split('/');
	if(path.length>3 && path[3] != 'CMS.Politi.Web') {
		if(path.length>3 && path[3].length>2) { 
			take(path[4]); 
			take('Forside'); 
			take('Kreds'); 
			take(path[3]); 
		} else {
			take(path[3]); take('Forside');
		}
	} else {
		take('da'); 
		take('Forside');
	}
	takeFirst('leftMenuLabel');
	takeAllFirst('*Selected');
   }
   var destBcSep = '>';
   var bcId = null;
   var bcRemove = new RegExp('');
   var removeDuplicateLevels = true;
   var bc = []; var nm_title = (typeof (document.netminers) == 'object' && document.netminers.title) ? document.netminers.title : ''; var dbg = false;
   function buildBreadCrumb() { if (bcId != null && srcBcSep != null) { var obj = document.getElementById(bcId); if (obj != null) { bc = cb(trim(it(obj).replace(bcRemove, ''))).split(srcBcSep); return; } } BuildCustomBreadcrumb(); }
   function take(s, p) { if (s == null) return; if (s.innerHTML) s = trim(it(s)); var l = s.split(p || srcBcSep); for (var i = 0; i < l.length; i++) bc[bc.length] = l[i]; }
   function takeById(i) { take(document.getElementById(i)); }
   function takeFirst(q, r, t) { var e = getElementsByClass(q, r, t); if (e != null && e.length > 0) { if (arguments.length > 3) { var args = []; var o = 0; var j = 0; for (var i = 3; i < arguments.length; i++) { if (j == 1) { args[j++] = e[0]; } args[j++] = arguments[i]; } takeFirst.apply(this, args); } else take(e[0]); } }
   function takeFirstTag(t) { takeFirst(null, null, t); }
   function takeAllFirst(q, r, t, q1, t1) { var e = getElementsByClass(q, r, t); for (var i = 0; i < e.length; i++) takeFirst(q1, e[i], t1); }
   function getElementsByClass(c, n, t) { var r = []; if (n == null) n = document; if (c == null) c = '*'; if (t == null) t = '*'; var e = n.getElementsByTagName(t); var l = e.length; var t2 = new RegExp("(^|\\s)" + c + "(\\s|$)"); for (i = 0, j = 0; i < l; i++) if (t2.test(e[i].className)) { r[j] = e[i]; j++; } return r; }
   function trim(s) { return s.replace(/^[\s\xA0]+|[\s\xA0]+$/g, ''); }
   function it(e) { if (!e) return ''; var txt = ''; for (var i = 0; i < e.childNodes.length; i++) { switch (e.childNodes.item(i).nodeType) { case 1: txt += it(e.childNodes.item(i)); break; case 3: txt += e.childNodes.item(i).nodeValue; break; } } return txt; }
   function cb(s) { return s.replace(new RegExp('[\s]+' + srcBcSep + '[\s]+'), ' ' + srcBcSep + ' '); }
   function rdl() {var bc2 = []; var cur = null; for (var i = 0; i < bc.length; i++) { if (trim(bc[i]).length > 0) { if ((cur != null && cur.toLowerCase()) != trim(bc[i]).toLowerCase()) { cur = trim(bc[i]); bc2[bc2.length] = cur; }}}bc = bc2;}
   function te(a) { for (var i = 0; i < a.length; i++) a[i] = trim(a[i]); return a; }
   try {
      var loc = new String(window.document.location);
      if (typeof (document.netminers) != 'object') document.netminers = {};
      if ((typeof (document.netminers.trackPage) == 'boolean' && document.netminers.trackPage == false) || loc.toLowerCase().indexOf('nmtrackpage=false') != -1) return;
      buildBreadCrumb();
      if (document.netminers.additionalSuperContext) bc = te(cb(document.netminers.additionalSuperContext).split(srcBcSep)).concat(bc);
      if (document.netminers.additionalSubContext) bc = bc.concat(te(cb(document.netminers.additionalSubContext).split(srcBcSep)));
      if (nm_title != '') bc = cb(trim(nm_title.replace(bcRemove, ''))).split(srcBcSep);
      rdl(); nm_title = bc.join(' ' + destBcSep + ' ');
      var loc2 = loc; try { var toploc = new String(top.document.location); loc2 = toploc.indexOf('nm_extag') != -1 ? toploc : loc2; } catch (e) { } if (nm_title == '') nm_title = document.title;
      if (dbg) alert(nm_title);
      var ref = ''; var c = document.cookie;
      if (c.indexOf('nm_exref') != -1) { var ca = c.split(';'); for (i = 0; i < c.length; i++) { var item = new String(ca[i]); var idx = item.indexOf('nm_exref'); if (idx != -1) ref = new String(item.substr(idx + 9)); } document.cookie = 'nm_exref='; }
      if (ref == '') { ref = document.referrer; try { ref = top.document.referrer; } catch (e) { } }
      var begext = loc2.indexOf('nm_extag='); var ext = ''; if (begext != -1) { begext += 9; var endext = loc2.indexOf('&', begext); ext = endext == -1 ? loc2.substr(begext) : loc2.substr(begext, endext - begext); ext = encodeURIComponent(ext); }
      nm_title = encodeURIComponent(nm_title); loc = encodeURIComponent(loc); ref = encodeURIComponent(ref); ext = encodeURIComponent(ext);
      if (nm_title.length > 250) nm_title = nm_title.slice(0, 246) + '...'; if (loc.length > 800) loc = loc.slice(0, 796) + '...'; if (ref.length > 800) ref = ref.slice(0, 796) + '...';
      var script = document.createElement('SCRIPT');
      script.language = 'javascript';
      script.src = 'http' + (document.location.protocol == 'https:' ? 's' : '') + '://' + accountId + '.netminers.dk/tracker/dispatch.aspx?action=log' + '&n=' + Math.random() + '&nav=' + loc + '&cid=' + accountId + (ref.length > 0 ? ('&ref=' + ref) : '') + '&ti1=' + nm_title + '&ext=' + ext;
      document.getElementsByTagName('body')[0].appendChild(script);
	  return decodeURIComponent(nm_title);
   } catch (e) { if (dbg) throw e; }
}