var brontoUrl = new String;brontoUrl = window.location.href.toUpperCase();if (brontoUrl.indexOf("&") > 0) {brontoUrl = brontoUrl.substring(brontoUrl.indexOf("&"),brontoUrl.length);}//alert(brontoUrl);// Create a global array that will hold the value of each variable, // keyed by the name of the variable. var GETDATA = new Array(); // Get the string that follows the "?" in the window's location. var sGet = brontoUrl; if (sGet) // if has a value... { // Drop the leading "?" sGet = sGet.substr(1); // Generate a string array of the name value pairs. // Each array element will have the form "foo=bar" var sNVPairs = sGet.split("&"); // Now, for each name-value pair, we need to extract // the name and value. for (var i = 0; i < sNVPairs.length; i++) { // So, sNVPairs[i] contains the current element... // Split it at the equals sign. var sNV = sNVPairs[i].split("="); // Assign the pair to the GETDATA array. var sName = sNV[0]; var sValue = sNV[1]; GETDATA[sName] = sValue; } } // create an instance of the Date objectvar now = new Date();// fix the bug in Navigator 2.0, Macintosh//fixDate(now);// cookie expires in one year (actually, 365 days)// 365 days in a year// 24 hours in a day// 60 minutes in an hour// 60 seconds in a minute// 1000 milliseconds in a second// You will probably want to make the cookie expire in about 1 hournow.setTime(now.getTime() + 14 * 24 * 60 * 60 * 1000);value = GETDATA["BMIDS"]; // the value for the new cookievalue = 'testvalue';// set the new cookieif (brontoUrl.indexOf("BMIDS") > 0) {//alert('bronto set');setCookie("track", value, now, '/')};
