function init() {
  prepareForm("recentposts","divRecentPosts","/ajax/saRecentPosts.asp");  
}

var recentPostsInterval;

if (fGetCookie('RecentPostsRefresh') == 1) {recentPostsInterval = setInterval('sendData(null,"/ajax/saRecentPosts.asp","divRecentPosts")', 30000);}


function fRecentPostsPodCookie(sender, vTitle) {
    var currentRPcookie = fGetCookie('RecentPostsRefresh');
    
    if (currentRPcookie == '1') {
        clearInterval(recentPostsInterval);
        sender.title = 'The Latest posts list will be refreshed every 30s if you click on.';
        currentRPcookie = '0';
        getRefToObject('aRecentPostsRefresh').style.display = 'inline';
        getRefToObject('spanOnInfo').style.display = 'none';
    }
    else { 
        recentPostsInterval = setInterval('sendData(null,"/ajax/saRecentPosts.asp","divRecentPosts")', 30000);
        sender.title = 'Stop auto refreshing the Latest posts list. You will be able to refresh it manually anyway.';
        currentRPcookie = '1';
        getRefToObject('aRecentPostsRefresh').style.display = 'none';
        getRefToObject('spanOnInfo').style.display = 'inline';
    }

    document.cookie = escape('RecentPostsRefresh') + '=' + escape(currentRPcookie) + '; path=/';
}
