// JavaScript Document // U-Pro tracking script v3.0 Please do not remove or alter in any way function setTestName() { var qName = QueryString("tn"); // Removed dynamic naming because it seems to be causing double views /* var testName = "vertster"; if (qName == null) return testName; else */ return qName; } function setCreativeID() { var qryID = QueryString("creativeID"); var varID = thisCreative_ID; // check and see if there is a queryid if null use explicit varID // otherwise use the query id if (qryID == null) return varID; else return qryID; } function setCookie(NameOfCookie, value, expiredays, thepath, thedomain) { var ExpireDate = new Date (); ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000)); document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()) + ((thepath == null) ? "" : "; path=" + thepath ) + ((thedomain == null) ? "" : "; domain=" + thedomain ); } function getCookie(NameOfCookie){ if (document.cookie.length > 0) { begin = document.cookie.indexOf(NameOfCookie+"="); if (begin != -1) { begin += NameOfCookie.length+1; end = document.cookie.indexOf(";", begin); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(begin, end)); } } return null; } // // QueryString // function QueryString(key) { var value = null; for (var i=0;i= 0) { var argname = pairs[i].substring(0,pos); var value = pairs[i].substring(pos+1); QueryString.keys[QueryString.keys.length] = argname; QueryString.values[QueryString.values.length] = value; } } } QueryString_Parse(); function trackit(cookie_Name, creative_ID, cookie_Days, cookie_Path, cookie_Domain){ // check for incoming vars, if not set to default value //if (creative_ID == null) { // cookie_Name = "vertster" //} // declare variable names var randomNum = Math.floor((Math.random() * 1000000000)); // If cookie_Name/testname is null it is indicative of a second or direct visit // so only process the view if it is not null if (cookie_Name != null) { var firsttime = getCookie(cookie_Name); // if its the first view, set the cookie, otherwise return if (firsttime == null) { setCookie(cookie_Name, randomNum, cookie_Days, cookie_Path, cookie_Domain); // serve invisible images to page if (document.referrer&&document.referrer!="") document.write(""); else document.write(''); } } return; } function doesitexist(cookie_Name) { var theCookie = getCookie(cookie_Name); if (theCookie == null) return false; else return true; } function convertit(cookie_Name) { var cookietoConvert = cookie_Name; if (doesitexist(cookie_Name) == false) cookietoConvert = "vertster" var cookieID = getCookie(cookietoConvert); document.write(""); } function convertit2(cookie_Name,conversion_Value) { var cookietoConvert = cookie_Name; if (doesitexist(cookie_Name) == false) cookietoConvert = "vertster" var cookieID = getCookie(cookietoConvert); document.write(""); }