﻿// WebTrends SmartSource Data Collector
// Copyright (c) 1996-2006 WebTrends Inc. All rights reserved.
// $DateTime: 2006/03/01 12:51:54 $

// Code section for Track clicks to links leading offsite.
function dcsOffsite(evt){
	evt=evt||(window.event||"");
	if (evt){
		var e=dcsEvt(evt,"A");
		if (e.hostname&&!dcsIsOnsite(e.hostname)){
			var qry=e.search?e.search.substring(e.search.indexOf("?")+1,e.search.length):"";
			if (qry.toUpperCase().indexOf("WT.SVL=")==-1){
				WT.svl=dcsParseSvl(e.name?e.name.toString():(e.onclick?e.onclick.toString():""));
			}
			var path=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
			var trim=true;
			dcsSaveHref(evt);
			dcsMultiTrack("DCS.dcssip",e.hostname,"DCS.dcsuri",path,"DCS.dcsqry",trim?"":qry,"WT.ti","Offsite:"+e.hostname+path+qry,"WT.os","1");
			DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.svl=WT.os="";
		}
	}
}

// 
// Custom js codes to wt
//

function remove_spec_chars(param)
{
   var s = param;
 s = s.replace( new RegExp( "ö", "gi" ), "o" );
  s = s.replace( new RegExp( "ü", "gi" ), "u" );
  s = s.replace( new RegExp( "ó", "gi" ), "o" );
  s = s.replace( new RegExp( "ő", "gi" ), "o" );
  s = s.replace( new RegExp( "ú", "gi" ), "u" );
  s = s.replace( new RegExp( "é", "gi" ), "e" );
  s = s.replace( new RegExp( "á", "gi" ), "a" );
  s = s.replace( new RegExp( "ű", "gi" ), "u" );
  s = s.replace( new RegExp( "í", "gi" ), "i" );

 
  s = s.replace( new RegExp( "&otilde;", "gi" ), "o" );
  
  s = s.replace( new RegExp( " ", "gi" ), "_" );
  
  s = s.replace( new RegExp( "[^\\w]", "gi" ), "" );
  return (s.toLowerCase());
}

function hits_count(dcs_unique,tag,local_unique)
{
 var c = remove_spec_chars(tag);
 
 if (dcs_unique ==undefined || c == undefined)
  return;
 
 var l='';
 if (local_unique!=undefined)
  l=local_unique;

 var u  = 'DCSext.'+dcs_unique;
 var c2 = l+c;
 
 dcsMultiTrack(u,c2);
}

function hits_countM(dcs_h,dcs_b,dcs_sz,tag,local_unique)
{
 var c = remove_spec_chars(tag);
 
 var dcs_unique = '';
 var s = document.location.href;
  
 s = s.toLowerCase();
 
 if(s.indexOf('haon.hu')>-1) dcs_unique = dcs_h;
 else if(s.indexOf('boon.hu')>-1) dcs_unique = dcs_b;
 else if(s.indexOf('szon.hu')>-1) dcs_unique = dcs_sz;
  
 if (dcs_unique == '' || c == undefined)
  return;
 
 var l='';
 if (local_unique!=undefined)
  l=local_unique;

 var u  = 'DCSext.'+dcs_unique;
 var c2 = l+c;

 dcsMultiTrack(u,c2);

}