diff --git js/webtrends.js js/webtrends.js
index 64ffb6d..d69ee91 100644
--- js/webtrends.js
+++ js/webtrends.js
@@ -20,7 +20,10 @@ function WebTrends(){
 }
 WebTrends.prototype.dcsGetId=function(){
 	if (this.enabled&&(document.cookie.indexOf(this.fpc+"=")==-1)&&(document.cookie.indexOf("WTLOPTOUT=")==-1)){
-		document.write("<scr"+"ipt type='text/javascript' src='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+this.domain+"/"+this.dcsid+"/wtid.js"+"'><\/scr"+"ipt>");
+    var insert = document.createElement('script');
+    insert.type = 'text/javascript';
+    insert.src = 'http'+(window.location.protocol.indexOf('https:')==0?'s':'')+'://'+this.domain+'/'+this.dcsid+'/wtid.js';
+    document.body.appendChild(insert);
 	}
 }
 WebTrends.prototype.dcsGetCookie=function(name){
@@ -416,7 +419,14 @@ WebTrends.prototype.dcsCreateImage=function(dcsSrc){
 		this.index++;
 	}
 	else{
-		document.write('<IMG ALT="" BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+dcsSrc+'">');
+    var img = document.createElement('img');
+    img.alt = '';
+    img.boder = '0';
+    img.name = 'DCSIMG';
+    img.width = '1';
+    img.height = '1';
+    img.src = dcsSrc;
+    document.body.appendChild(img);
 	}
 }
 WebTrends.prototype.dcsMeta=function(){
@@ -538,4 +548,4 @@ Function.prototype.wtbind = function(obj){
 		return method.apply(obj,arguments);
 	};
 	return temp;
-}
\ No newline at end of file
+}
