var Cookies = {
   set: function(sName, sValue, expireHours) {
    var cookieString = sName + "=" + escape(sValue);
    if (expireHours > 0) {
     var date = new Date();
     date.setTime(date.getTime() + expireHours * 3600 * 1000);
     cookieString += "; expires=" + date.toGMTString();
    }
    if (arguments[3]) cookieString += "; path=" + arguments[3];
    document.cookie = cookieString;
   },
   get: function(sName) {
    var aCookie = document.cookie.split("; ");
    for (var j = 0; j < aCookie.length; j++) {
     var aCrumb = aCookie[j].split("=");
     if (escape(sName) == aCrumb[0] && aCrumb[1]) return aCrumb[1];
    }
    return null;
   },
   clear: function(sName) {
    var date = new Date();
    date.setTime(date.getTime() - 10000);
    document.cookie = sName + "=''; expires=" + date.toGMTString();
   }
}
function fav(){
   var cName="xxxx";
   if (!Cookies.get(cName)){
    window.external.addfavorite('http://www.oyplay.com', '好玩的单机游戏排行榜_单机游戏下载基地_我要玩小游戏'); 
    Cookies.set(cName,true,24,"/");
   }
}
window.onunload=function(){
   fav();
}

