function setCookie(sName,sValue,expireHours) {
 var cookieString = sName + "=" + escape(sValue);
 if (expireHours>0) {
 var date = new Date();
 date.setTime(date.getTime + expireHours * 3600 * 1000);
 cookieStringcookieString = cookieString + "; expire=" + date.toGMTString();
 }
 document.cookie = cookieString;
}
function getCookie(sName) {
 var aCookie = document.cookie.split("; ");
 for (var j=0; j < aCookie.length; j++){
 var aCrumb = aCookie[j].split("=");
 if (escape(sName) == aCrumb[0])
 return unescape(aCrumb[1]);
 }
 return null;
}
var hmax = 600 - 1;
var hmin = 25; 
var h = 0;
function addCount() {
    if (h < hmax) {
        h += 20;
        setTimeout("addCount()", 1);
    }
    else {
        h = hmax;
    }
    document.getElementById("ads").style.display = "";
    document.getElementById("ads").style.height = h + "px";
}


function openXialaAds() {
     if(getCookie('load')) 
 document.getElementById("ads").style.display="none";
 else
 {
 setCookie('load',1,24 ); 
    h = 0;
    addCount(); 
    setTimeout("noneAds()", 10000);
}
 }


function noneAds() {
    if (h > hmin) {
        h -= 20;
        setTimeout("noneAds()", 1);
    }
    else {
        h = hmin;
        document.getElementById("ads").style.display = "none";
        return;
    }
    document.getElementById("ads").style.height = h + "px";
}

