function shownote() {
   $("div#box").fadeIn("slow");
//  $("div#box").slideDown("slow");      
//	$("div#box").fadeIn("slow");
//	$("div#box").show();
}
  
$(document).ready(function(){

    var uservalue = 7;
    var popoverdelay = 20 * 1000;
    if(getcookie('popover') < uservalue){
        setcookie('popover', uservalue, 364);
        setTimeout('shownote();',  popoverdelay);
    } 

		$("button#refuse").click(function(event){
			$("div#box").hide();
		});

		$("input#email").click(function(event){
				$("input#email").val("");
		});

});

function getexpirydate( nodays){
var UTCstring;
Today = new Date();
nomilli=Date.parse(Today);
Today.setTime(nomilli+nodays*24*60*60*1000);
UTCstring = Today.toUTCString();
return UTCstring;
}
function getcookie(cookiename) {
 var cookiestring=""+document.cookie;
 var index1=cookiestring.indexOf(cookiename);
 if (index1==-1 || cookiename=="") return ""; 
 var index2=cookiestring.indexOf(';',index1);
 if (index2==-1) index2=cookiestring.length; 
 return unescape(cookiestring.substring(index1+cookiename.length+1,index2));
}
function setcookie(name,value,duration){
cookiestring=name+"="+escape(value)+";EXPIRES="+getexpirydate(duration);
document.cookie=cookiestring;
//document.write("Saved");
if(!getcookie(name)){
return false;
}
else{
return true;
}
}
function date1(){
now = new Date();
then = new Date(" Jan 01 1970 00:00:00");
seconds=now-then/1000;
month=1+now.getMonth();
day=now.getDate();
year=now.getFullYear();
document.write( day+"-"+month+"-"+year+"");
}
