
$vizzit={
	addEvent:function(el,l,h){
		if( el['on'+l] != null ){
		  if( el['on'+l].toString().indexOf( h ) > -1 ){
		    return;
		  }
		}
		if( el.addEventListener){
		  el.addEventListener( l, eval(h), true );
		} else if( el.attachEvent){
		  el.attachEvent( 'on'+l, eval(h) );
		}
	},
	link_click:function(e, w){
    if( ( typeof(e) == "string" ) && ( e.length >  0 ) ){
      var vt=document.createElement("img");
      vt.setAttribute("src","//www.vizzit.se/vizzittag/assets/click.gif?"+Math.random()+"&l="+escape(e)+"&r="+escape(document.location)+"&c="+escape($vizzit.c)+"&d=iva.se"+"&sx="+screen.width+"&sy="+screen.height+"&bl="+$vizzit.gl()+"&fe="+$vizzit.fe+"&fv="+$vizzit.fv+"&je="+navigator.javaEnabled()+"&u="+$vizzit.u+"&anonip="+$vizzit.anonymizeIP);
      vt.setAttribute("width","1");
      vt.setAttribute("height","1");
      document.body.appendChild(vt);
      setTimeout("",100 );
    }
    else {
      try{
  		  e = e || event;
        
  			//try{
  			//  if( e.preventDefault ) { e.preventDefault(); }
  			//	e.returnValue = false;
  			//} catch( e ){}
  		  if( ( typeof(w) == "string" ) && ( w.length != 0 ) ){
  				p = w;
  			} else if( this.pathname != undefined ){
  			  p = this.pathname;
  			} else if ( event.srcElement.pathname != undefined ){
  			  p = event.srcElement.pathname;
  			} else {
          if( typeof p  == 'undefined' ) {
            try{
              if( e.srcElement.tagName != 'A' ){
                elem = e.srcElement.parentNode;
                while( elem.tagName != 'A' && elem.parentNode != null ){
                  elem = elem.parentNode;
                }
                p = elem.href;
              } else {
                p = e.srcElement.href;
              }
              if( ( p.indexOf('http://' ) != -1 ) ||  ( p.indexOf('https://' ) ) ) {
                sp = p.indexOf('/', 8 );
                p = p.substr( sp );
              }
            }
            catch(ex){
              return true;
            }
          }
  				//document.location.href = p;
  			}
        
  			if( p.indexOf('/') != 0 ){
  			  p = '/'+p;
  			}
  			var vt=document.createElement("img");
  			
  			vt.setAttribute("src","//www.vizzit.se/vizzittag/assets/click.gif?"+Math.random()+"&l="+escape(p)+"&r="+escape(document.location)+"&c="+escape($vizzit.c)+"&d=iva.se"+"&sx="+screen.width+"&sy="+screen.height+"&bl="+$vizzit.gl()+"&fe="+$vizzit.fe+"&fv="+$vizzit.fv+"&je="+navigator.javaEnabled()+"&u="+$vizzit.u+"&anonip="+$vizzit.anonymizeIP);
  			vt.setAttribute("width","1");
  			vt.setAttribute("height","1");
  			document.body.appendChild(vt);
        setTimeout("",100 );
        //vt.onload = function(){ document.location.href = p };
  		}
  		catch(ex){
        return true;
      }
      
    }
	},
	gc:function(n){
		var s=document.cookie.indexOf(n+"=");
		var l=s+n.length+1;
		if((!s)&&(n!=document.cookie.substring(0,n.length))){
			return null;
		}
		if(s==-1){
			return null;
		}
		var e=document.cookie.indexOf(';',l);
		if(e==-1){
			e=document.cookie.length;
		}
		return unescape(document.cookie.substring(l,e));
	},
	sc:function(n,v){
    if( typeof( $vizzit_enableCookies ) !== 'undefined' ) {
      if( $vizzit_enableCookies == false ) {
        return;
      }
    }
	  var td=new Date();
	  var ed=new Date(td.getTime()+365*86400000);
	  document.cookie = n+'='+escape(v)+';expires='+ed.toGMTString()+';path=/';
	},
	gl:function(){
	  var l = (navigator["language"])?navigator["language"]:navigator["userLanguage"];
	  if( l == undefined ){
	    return;
	  } else {
	    return l;
	  }
	},
	cfe:function(){
	  if ((navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("Mac") == -1 && navigator.appVersion.indexOf("3.1") == -1) || (navigator.plugins && navigator.plugins["Shockwave Flash"]) || navigator.plugins["Shockwave Flash 2.0"]){
    return true;
	  } else {
	    return false;
	  }
	},
	cfv:function(){
	  try {
	    try {
	     var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
	      try { axo.AllowScriptAccess = 'always'; }
	      catch(e) { return '6,0,0'; }
	    } catch(e) {}
	    return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g , ',').match(/^,?(.+),?$/)[1];
	  } catch(e) {
	    try {
	      if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
	        return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
	      }
	    } catch(e) {}
	  }
	  return '0,0,0';
	}
};
if(!($vizzit.c=$vizzit.gc('___vizzit'))){
	$vizzit.c='dwLEYgaQ3v8XGUyxVrdMfw==:1327705525';
	$vizzit.sc('___vizzit',$vizzit.c);
};
$vizzit.fe=$vizzit.cfe();
if( $vizzit.fe == true ){
  $vizzit.fv = $vizzit.cfv().split(',').shift();;
} else {
  $vizzit.fv = '';
}
if( typeof($vizzit_user) === 'undefined' ){
  $vizzit.u = '';
} else {
   $vizzit.u = $vizzit_user;
}

function tag(){
  $vizzit.s = document.createElement('script');
	$vizzit.s.setAttribute("type","text/javascript");

	$vizzit.s.setAttribute("src", '//www.vizzit.se/vizzittag/assets/pixel.js?'+Math.random()+'&d=iva.se&r='+escape(document.referrer)+'&l='+escape(document.location)+'&c='+escape($vizzit.c)+'&sx='+screen.width+'&sy='+screen.height+'&bl='+$vizzit.gl()+'&fe='+$vizzit.fe+'&fv='+$vizzit.fv+'&je='+navigator.javaEnabled()+'&u='+$vizzit.u+'&anonip='+$vizzit.anonymizeIP );
	document.getElementsByTagName("head")[0].appendChild( $vizzit.s );

}


function tagDocs(){
  for(i=0;i<document.links.length;i++){
		l=document.links[i];
		if (!/^javascript/.test(l.href) &&
		((/\.(pdf|doc|xls|docx|ppt|pptx|xlsx|zip|rtf|wmv|exe)$/.test(l.pathname) && (l.host.toString().replace('www.','').replace(/:\d+/,'') == document.domain.toString().replace('www.',''))))){
			$vizzit.addEvent(l,"click","$vizzit.link_click");
		}
	}
}

function pollAlive( mSec ){
	if( mSec > (1000 * 30 * 60) ) return;
	mSec = mSec * 2;
	dUrl = unescape( document.location.toString());
	if( dUrl.indexOf( '?' ) > -1 ){
		dUrl = dUrl + '&vizzitAlive=true';
	} else {
	  dUrl = dUrl + '?vizzitAlive=true';
	}
	var vt=document.createElement("img");
	vt.setAttribute("src","//www.vizzit.se/vizzittag/assets/click.gif?"+Math.random()+"&l="+escape(dUrl)+"&r="+escape(document.referrer)+"&c="+escape($vizzit.c)+"&d=iva.se"+'&sx='+screen.width+'&sy='+screen.height+'&bl='+$vizzit.gl()+'&fe='+$vizzit.fe+'&fv='+$vizzit.fv+'&je='+navigator.javaEnabled()+'&u='+$vizzit.u+'&anonip='+$vizzit.anonymizeIP );
	vt.setAttribute("width","1");
	vt.setAttribute("height","1");
	vt.style.display = 'none';
	document.body.appendChild(vt);
  setTimeout( "pollAlive( " + mSec + " )", mSec );
}
if( typeof( $vizzit_anonymizeIP ) === 'undefined' ){
  $vizzit.anonymizeIP = 'false';
} else if( $vizzit_anonymizeIP === true ) {
  $vizzit.anonymizeIP = 'true';
} 
tag();
document.onload = tagDocs();
if(  typeof( $vizzit_keepAlive ) !== 'undefined' ) {
  if( $vizzit_keepAlive == true ){
    setTimeout( "pollAlive(5000)", 5000 );
  }
}
/*172.29.110.21*/

