Hi,

I want to add a cookie in this script to show the popunder once a day.
Can someone help me to change the following code to make it work ?

Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Popunder</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
</head>
<body>
<form id="popSubmit" action="http://www.google.com">
<input type="submit" />
</form>

<script type="text/javascript">
(function($) {

$.popunder = function(sUrl) {
var _parent = self;
var bPopunder = ($.browser.msie && parseInt($.browser.version, 10) < 9);

if (top != self) {
try {
if (top.document.location.toString()) {
_parent = top;
}
}
catch(err) { }
}


var sOptions = 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width=' + (screen.availWidth).toString();
sOptions += ',height=' + (screen.availHeight).toString() + ',screenX=0,screenY=0,left=0,top=0';


var popunder = _parent.window.open(sUrl, 'pu_' + Math.floor(89999999*Math.random()+10000000), sOptions);
if (popunder) {
popunder.blur();
if (bPopunder) {

window.focus();
try { opener.window.focus(); }
catch (err) { }
}
else {

popunder.init = function(e) {
with (e) {
(function() {
if (typeof window.mozPaintCount != 'undefined') {
var x = window.open('about:blank');
x.close();
}

try { opener.window.focus(); }
catch (err) { }
})();
}
};
popunder.params = {
url: sUrl
};
popunder.init(popunder);
}
}

return this;
}
})(jQuery);

$('#popSubmit').submit(function() {
jQuery.popunder('http://www.facebook.com');
});
</script>
</body>
</html>