//<![CDATA[

function ReadCookie(cookiename) {
  var numOfCookies = document.cookie.length;
  var nameOfCookie = cookiename + "=";
  var cookieLen = nameOfCookie.length;
  var x = 0;
  while (x <= numOfCookies) {
        var y = (x + cookieLen);
        if (document.cookie.substring(x, y) == nameOfCookie)
           return (extractCookieValue(y));
           x = document.cookie.indexOf(" ", x) + 1;
           if (x == 0){
              break;
           }
  }
  return (null);
}

function Popup()
{

// Modal Box Drops Down Here....


Modalbox.show('<div width="551" align="center"><a href="specials.php"><img src="modal/images/ValentinesDay_2011.jpeg" alt="" width="551" height="420" border="0"/><\/a></div>'); 
// Set Cookie to Expire in 30 days
document.cookie = "popup=1; expires=" + new Date( new
//BELOW IS CODE TO MAKE THE POPUP not come back for 30 more days. right now its *0 
//Date().getTime()+86400000*30 ).toGMTString();
Date().getTime()+86400000*0 ).toGMTString();
return false;
} 

function Wait20()
{
   // Wait 20 seconds...
   // Then, if popup cookie doesn't exist, then do Popup Function
        userCookie = ReadCookie("_visitSite");
        if (userCookie == null)
     {
         //alert ("Cookie not found do popup");
     setTimeout("Popup()", 2000);
     return true;
     }
   else
    {
    return false;
    }
 }




//]]>


