var PopupManager = function () { return { init: function () { var pops = []; String.prototype.format = function () { var str = this; for (var i = 0; i < arguments.length; i++) { var reg = new RegExp("\\{" + i + "\\}", "gm"); str = str.replace(reg, arguments[i]); } return str; } $j.each(pops, function (idx) { var p = pops[idx]; if (!p.open) return true; var d = new Date(); var n = d.getDay(); if ($j.cookie('xpop' + p.id) != n) { var html = ''; html = '
X
'.format(p.top, p.left); if (p.image) { html += '
'.format(p.id, p.width, p.height, p.image); } if (p.html) { html += '
{0}
'.format(p.subject); html += '
{0}
'.format(p.html, p.width, p.height); } html += ''.format(p.id); html + '
'; p.left += p.width + 100; $j('body').append(html); } }); } } }(); function closepop(obj, id) { $j(obj).closest('.popup2').remove(); //$.cookie('pop' + id, 1, { expires: 1 }); var d = new Date();var n = d.getDay(); $j.cookie('xpop' + id, n, { expires: 1 }); } function removepop(obj, id) { $j(obj).closest('.popup2').remove(); } var ticBlink = setInterval(function() { $j('span.ticBlinkPop').fadeOut('slow').fadeIn('slow'); },1500);