MTVN.Utils = {} MTVN.Utils.Cookies = new function(){ this.create = function(name,value,days){ if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else { var expires = ""; } document.cookie = name+"="+value+expires+"; path=/"; } this.read = function(name){ var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } this.erase = function(name){ MTVN.Utils.Cookies.create(name,"",-1); } } MTVN.Utils.addSponsoredOverlay = function(imgPath, imgId, width, height, divSelector, trackingCode, leaveH1) { var imgSrc = imgPath; if (leaveH1 != true) $j("#page-header h1").attr("style", "height: 30px;").empty(); $j("").attr({"id":imgId, "src":imgSrc, "border": 0, "width":width, "height":height}).prependTo(divSelector); if (trackingCode != null) $j("").attr({"src":trackingCode, "border": 0, "width": 1, "height": 1}).appendTo("#page-header"); }