<!-- (c) Netminers 2002-2008
function BindNetminersToForm(form) {
   if(typeof(document.netminers) == 'object' && typeof(document.netminers.bindings) == 'object') {

      var i1 = document.createElement('input');
      i1.setAttribute('type', 'hidden');
      i1.setAttribute('name', '_NM_UserId');
      i1.setAttribute('value', document.netminers.bindings.userId);
      form.appendChild(i1);

      var i2 = document.createElement('input');
      i2.setAttribute('type', 'hidden');
      i2.setAttribute('name', '_NM_SessionId');
      i2.setAttribute('value', document.netminers.bindings.sessionId);
      form.appendChild(i2);
   }
}
function nmtrack() {
   function upperCaseFirstLetters(sentence){ var words = sentence.split(' '); sentence = ''; for( var i = 0; i < words.length; i++ ) { if( i > 0 ) sentence += ' '; sentence += words[i].charAt(0).toUpperCase() + words[i].substr(1);  } return sentence; }
   function trim(str){ return str.replace(/^[\s\xA0]+|[\s\xA0]+$/g, '');}
   function getInnerText(el) { if (!el) return ""; var txt = ""; for (var i=0; i<el.childNodes.length; i++) { switch (el.childNodes.item(i).nodeType) { case 1: txt += getInnerText(el.childNodes.item(i)); break; case 3: txt += el.childNodes.item(i).nodeValue; break; } } return txt; }
   function getElementsByClassAndTag(cls,tag) { var elements = []; cls = cls.toLowerCase(); var e = document.getElementsByTagName(tag); for(var i=0; i < e.length; i++ ) if( e[i].className.toLowerCase() == cls ) elements[elements.length] = e[i]; return elements;}

   function addHierarchyFromUrl(bc, url, remove, convertToSpace) {
      var querystring = url.indexOf('?');
      if(querystring != -1) url = url.substr(0, querystring);
      var urlparts = new String(url).split('/');
      for(var i = 3; i < urlparts.length; i++) {
         var text = upperCaseFirstLetters(urlparts[i].replace(remove, '').replace(convertToSpace, ' '));
         if(trim(text).length > 0) bc[bc.length] = text;
      }
   }
   function addOptionalCaseId(bc, url, searchIdList) {
      for(var i = 0; i < searchIdList.length; i++) {
         if(url.indexOf(searchIdList[i]) != -1) {
            var m = document.getElementsByTagName('h1');
            if(m.length) { m = getInnerText(m[0]); bc[bc.length] = m; }
         }
      }
   }
   function addOptionalBuyIframe(bc, searchIdList, remove, convertToSpace) { 
      for(var i = 0; i < searchIdList.length; i++) {
         var e = getElementsByClassAndTag(searchIdList[i][0], searchIdList[i][1]);
         for(var j = 0; j < e.length; j++) {
            var text = trim(getInnerText(e[j]))
            if(remove != null) text = text.replace(remove, '');
            if(convertToSpace != null) text = text.replace(convertToSpace, ' ');
            bc[bc.length] = text;
            return;
         }
      }
   }
   
   try{
   var cid = 'sologstrand';
   var nm_title = ''; 
   var requestBindInfo = true;
   if(nm_title == '') {

      var bc = [];
      var url = new String(document.location).toLowerCase();
      addHierarchyFromUrl(bc, url, /\.aspx|.asp|.html|.htm/g, /-|_/g);

      // Hent "vishus" sagsid: romo-holidays, sydsol, blaavand
      addOptionalCaseId(bc, url, ['vis_sommerhus', 'ferienhaus', 'vishus', 'haus-zeigen', 'vis_hus']);

      // Iframe købs process, hent trin
      addOptionalBuyIframe(bc, [['sectionintroblack', 'td'], ['pageheader', 'td'], ['sectionintro', 'td'], ['tablehead', 'td'], ['soeghead', 'td']], /:/g);

      nm_title = bc.join(' > ');
   }
   var loc=new String(window.document.location);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;
   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':'')+'://'+cid+'.netminers.dk/tracker/dispatch.aspx?action=log'+'&n='+Math.random()+'&nav='+loc+'&cid='+cid+(ref.length>0?('&ref='+ref):'') +'&ti1='+nm_title+'&ext='+ext+(requestBindInfo ? '&bind=true' : '');
   document.getElementsByTagName('body')[0].appendChild( script );
   }catch(e){}
}
if( window.attachEvent ){window.attachEvent( 'onload', nmtrack );}else if( window.addEventListener ){window.addEventListener( 'load', nmtrack, true );}
else {var oldonload = window.onload;if (typeof oldonload != 'function'){window.onload = nmtrack;}else{window.onload=function(){nmtrack();oldonload();}}}
-->
