var currentTopStory = 0; var _tabs = {'top-stories':'drawTopStory(dataTopStory[' + currentTopStory + '])','recent-articles':'drawRecentStories(dataTopStory)', 'blog-updates':'drawBlogUpdates(dataBlogUpdates)','forum-updates':'drawForumUpdates(dataForumUpdates)'}; var dataTopStory = [ {'image':'images/story-image.jpg','title':'John Kunkuwap Tabatabai - Join the Team Live the Dream','url':'http://www.badbeat.com/Ease/DynamicPageBuild?siteID=1867&categoryID=1486','body':"We all dream about living the dream, travelling the world playing poker, sitting down with thousands of dollars a day at the tables, earning 6 figure sums, just for sitting at the computer and playing your trade at the online felt....",'votes':'1245','voteHref':'#'}, {'image':'images/story-image.jpg','title':'John Kunkuwap Tabatabai - Join the Team Live the Dream','url':'http://www.badbeat.com/Ease/DynamicPageBuild?siteID=1867&categoryID=1486','body':"We all dream about living the dream, travelling the world playing poker, sitting down with thousands of dollars a day at the tables, earning 6 figure sums, just for sitting at the computer and playing your trade at the online felt....",'votes':'1245','voteHref':'#'}, {'image':'images/story-image.jpg','title':'John Kunkuwap Tabatabai - Join the Team Live the Dream','url':'http://www.badbeat.com/Ease/DynamicPageBuild?siteID=1867&categoryID=1486','body':"We all dream about living the dream, travelling the world playing poker, sitting down with thousands of dollars a day at the tables, earning 6 figure sums, just for sitting at the computer and playing your trade at the online felt.",'votes':'1245','voteHref':'#'}, {'image':'images/story-image.jpg','title':'John Kunkuwap Tabatabai - Join the Team Live the Dream','url':'http://www.badbeat.com/Ease/DynamicPageBuild?siteID=1867&categoryID=1486','body':"We all dream about living the dream, travelling the world playing poker, sitting down with thousands of dollars a day at the tables, earning 6 figure sums, just for sitting at the computer and playing your trade at the online felt....",'votes':'1245','voteHref':'#'} ]; var dataBlogUpdates = [ {'image':'images/blog-image1.gif','title':'Breaking even','text':'Establishing a reliable relationship between play and profit','posted_by':'Strummer','posted_at':'Feb 6 2007','profile_link':'http://www.badbeat.com/Ease/ContentServer?siteID=1867&categoryID=1504','post_link':'#','top_blog_link':''}, {'image':'images/blog-image1.gif','title':'The good, the bad and the ugly','text':'Establishing a reliable relationship between play and profit','posted_by':'Manuel','posted_at':'Feb 6 2007','profile_link':'http://www.badbeat.com/Ease/ContentServer?siteID=1867&categoryID=1527','post_link':'#','top_blog_link':''}, {'image':'images/blog-image1.gif','title':'Breaking even','text':'Establishing a reliable relationship between play and profit','posted_by':'Flanks','posted_at':'Feb 6 2007','profile_link':'http://forum.badbeat.com/blogs/default.aspx?GroupID=45','post_link':'#','top_blog_link':''}, {'image':'images/blog-image1.gif','title':'Breaking even','text':'Establishing a reliable relationship between play and profit','posted_by':'OfficeSpace','posted_at':'Feb 6 2007','profile_link':'http://forum.badbeat.com/blogs/default.aspx?GroupID=36','post_link':'#','top_blog_link':''}, {'image':'images/blog-image1.gif','title':'Breaking even','text':'Establishing a reliable relationship between play and profit','posted_by':'Olly','posted_at':'Feb 6 2007','profile_link':'http://forum.badbeat.com/blogs/default.aspx?GroupID=42','post_link':'#','top_blog_link':''}, {'image':'images/blog-image1.gif','title':'Breaking even','text':'Establishing a reliable relationship between play and profit','posted_by':'ArmonVictor7','posted_at':'Feb 6 2007','profile_link':'http://www.badbeat.com/Ease/ContentServer?siteID=1867&categoryID=1762','post_link':'#','top_blog_link':''}, {'image':'images/blog-image1.gif','title':'Breaking even','text':'Establishing a reliable relationship between play and profit','posted_by':'CPoort1','posted_at':'Feb 6 2007','profile_link':'http://www.badbeat.com/Ease/ContentServer?siteID=1867&categoryID=1723','post_link':'#','top_blog_link':''} ]; var dataForumUpdates = [ {'image':'images/blog-image1.gif','title':'Forum Latest','text':'Retrieving Forum Latest.................','posted_by':'Badbeat','posted_at':'Apr 14 2008','profile_link':'#','post_link':'#','top_blog_link':'#'}, ]; var currentLink = -1; function drawTopStory(data) { var stories=dataTopStory.length - 1; //alert('current:' + currentTopStory + ' of ' + stories ); if (currentTopStory==stories) { //alert('at the end'); data=dataTopStory[0]; currentTopStory=0; } if (currentTopStory < 0 ) { currentTopStory=stories; data=dataTopStory[0]; currentTopStory=0; } var elem = document.getElementById('top-stories'); if(elem) { elem.innerHTML = ''; var _storyDiv = document.createElement("DIV"); _storyDiv.className = "cont story"; var storyDiv = elem.appendChild(_storyDiv); if(data.image) { var storyImage = document.createElement("IMG"); storyImage.src = data.image; storyImage.alt = (data.title)?data.title:""; storyImage.className = "image"; storyDiv.appendChild(storyImage); } var tableDiv = document.createElement("DIV"); tableDiv.className = "table"; var header = document.createElement("H3"); var headerA = document.createElement("A"); headerA.href = (data.url)?data.url:"#"; headerA.innerHTML = (data.title)?data.title:""; header.appendChild(headerA); tableDiv.appendChild(header); var textPar = document.createElement("P"); textPar.innerHTML = (data.body)?data.body:""; tableDiv.appendChild(textPar); /////var voteDiv = document.createElement("DIV"); /////voteDiv.className = "vote"; ////var strong = document.createElement("STRONG"); ////strong.innerHTML = (data.votes)?data.votes:""; ////var span = document.createElement("SPAN"); ////span.innerHTML = "votes"; ////var voteLink = document.createElement("A"); ////voteLink.href = (data.voteHref)?data.voteHref:"#"; ///var voteLinkImage = document.createElement("IMG"); ///voteLinkImage.src = "images/like-link.gif"; ///voteLinkImage.width = "35"; ///voteLinkImage.height = "13"; ///voteLinkImage.alt = ""; ///voteLink.appendChild(voteLinkImage); ///voteDiv.appendChild(strong); ///voteDiv.appendChild(span); ///voteDiv.appendChild(voteLink); ///tableDiv.appendChild(voteDiv); storyDiv.appendChild(tableDiv); } } function drawBlogUpdates(data) { //alert('Blog'); var elem = document.getElementById('blog-updates'); //alert('Blog 1' ); if(elem) { elem.innerHTML = ''; var _contDiv = document.createElement("DIV"); _contDiv.className = "cont"; var contDiv = elem.appendChild(_contDiv); var _scrollDiv = document.createElement("DIV"); _scrollDiv.id = "scroll"; var scrollDiv = contDiv.appendChild(_scrollDiv); var _ul = document.createElement("UL"); _ul.className = "blog"; var ul = scrollDiv.appendChild(_ul); for(var i=0; i < 7; i++) // IE and FF treat data.length differently { //alert('Blog ' + i + ' of ' + data.length); var _li = document.createElement("LI"); var _div = document.createElement("DIV"); _div.className = 'bg'; var _bottomDiv = document.createElement("DIV"); _bottomDiv.className = 'bottom-bg'; _bottomDiv.innerHTML = ' '; var _a = document.createElement("A"); _a.href = (data[i].href)?data[i].href:"#"; _a.className = "image"; // Neno and Kunku - launch in new window if ( i > 0 ) _a.target="_blank"; var _img = document.createElement("IMG"); _img.src = data[i].image; _img.width = "49"; _img.height = "49"; _img.alt = ""; _a.appendChild(_img); _div.appendChild(_a); var _a = document.createElement("A"); _a.href = (data[i].post_link)?data[i].post_link:"#"; // Neno and Kunku - launch in new window if ( i > 0 ) _a.target="_blank"; _a.className = "read"; var _img = document.createElement("IMG"); _img.src = 'images/blog-read-button.gif'; _img.width = "57"; _img.height = "16"; _img.alt = ""; _a.appendChild(_img); _div.appendChild(_a); var _tableDiv = document.createElement("DIV"); _tableDiv.className = "table"; var tableDiv = _div.appendChild(_tableDiv); var header = document.createElement("H3"); header.innerHTML = (data[i].title)?data[i].title:""; tableDiv.appendChild(header); //alert('Blog 3'); if(data[i].top_blog_link && data[i].top_blog_link.length > 0) { var _a = document.createElement("A"); _a.href = data[i].top_blog_link; _a.className = "top-blog"; var _img = document.createElement("IMG"); _img.src = 'images/top-blog-link.gif'; _img.width = "67"; _img.height = "16"; _img.alt = ""; _a.appendChild(_img); tableDiv.appendChild(_a); } //alert('Blog 4'); var _em = document.createElement("EM"); _em.innerHTML = (data[i].text)?data[i].text:""; tableDiv.appendChild(_em); var _ul = document.createElement("UL"); var __li = document.createElement("LI"); __li.innerHTML = 'Posted By: ' + (data[i].posted_by)?data[i].posted_by:""; //_ul.appendChild(__li); var __li = document.createElement("LI"); __li.innerHTML = 'Date: ' + (data[i].posted_at)?data[i].posted_at:""; _ul.appendChild(__li); var __li = document.createElement("LI"); var __a = document.createElement("A"); __a.innerHTML = "visit " + data[i].posted_by + "'s profile"; __a.href = (data[i].profile_link)?data[i].profile_link:""; __li.appendChild(__a); _ul.appendChild(__li); tableDiv.appendChild(_ul); _li.appendChild(_div); _li.appendChild(_bottomDiv); ul.appendChild(_li); } //alert('Blog 5'); initScrollbars(); } } function drawForumUpdates(data) { //alert('Forum'); var elem = document.getElementById('forum-updates'); if(elem) { elem.innerHTML = ''; var _contDiv = document.createElement("DIV"); _contDiv.className = "cont"; var contDiv = elem.appendChild(_contDiv); var _scrollDiv = document.createElement("DIV"); _scrollDiv.id = "scroll"; var scrollDiv = contDiv.appendChild(_scrollDiv); var _ul = document.createElement("UL"); _ul.className = "blog"; var ul = scrollDiv.appendChild(_ul); for(var i=0; i < data.length; i++) { var _li = document.createElement("LI"); var _div = document.createElement("DIV"); _div.className = 'bg'; var _bottomDiv = document.createElement("DIV"); _bottomDiv.className = 'bottom-bg'; _bottomDiv.innerHTML = ' '; var _a = document.createElement("A"); _a.href = (data[i].href)?data[i].href:"#"; _a.className = "image"; var _img = document.createElement("IMG"); _img.src = data[i].image; _img.width = "49"; _img.height = "49"; _img.alt = ""; _a.appendChild(_img); _div.appendChild(_a); var _a = document.createElement("A"); _a.href = (data[i].post_link)?data[i].post_link:"#"; _a.className = "read"; _a.target="_blank"; var _img = document.createElement("IMG"); _img.src = 'images/blog-read-button.gif'; _img.width = "57"; _img.height = "16"; _img.alt = ""; _a.appendChild(_img); _div.appendChild(_a); var _tableDiv = document.createElement("DIV"); _tableDiv.className = "table"; var tableDiv = _div.appendChild(_tableDiv); var header = document.createElement("H3"); header.innerHTML = (data[i].title)?data[i].title:""; tableDiv.appendChild(header); if(data[i].top_blog_link && data[i].top_blog_link.length > 0) { var _a = document.createElement("A"); _a.href = data[i].top_blog_link; _a.className = "top-blog"; var _img = document.createElement("IMG"); _img.src = 'images/top-blog-link.gif'; _img.width = "67"; _img.height = "16"; _img.alt = ""; _a.appendChild(_img); tableDiv.appendChild(_a); } var _em = document.createElement("EM"); _em.innerHTML = (data[i].text)?data[i].text:""; tableDiv.appendChild(_em); var _ul = document.createElement("UL"); var __li = document.createElement("LI"); __li.innerHTML = 'Posted By: ' + (data[i].posted_by)?data[i].posted_by:""; _ul.appendChild(__li); var __li = document.createElement("LI"); __li.innerHTML = 'Date: ' + (data[i].posted_at)?data[i].posted_at:""; _ul.appendChild(__li); //var __li = document.createElement("LI"); //var __a = document.createElement("A"); //__a.innerHTML = "visit " + data[i].posted_by + "'s profile"; //__a.href = (data[i].profile_link)?data[i].profile_link:""; //__li.appendChild(__a); //_ul.appendChild(__li); tableDiv.appendChild(_ul); _li.appendChild(_div); _li.appendChild(_bottomDiv); ul.appendChild(_li); } initScrollbars(); } } function drawRecentStories(data) { //alert('Recent Stories'); var elem = document.getElementById('recent-articles'); if(elem) { //alert('Got Element Recent Stories'); elem.innerHTML = ''; var _contDiv = document.createElement("DIV"); _contDiv.className = "cont"; var contDiv = elem.appendChild(_contDiv); var _scrollDiv = document.createElement("DIV"); _scrollDiv.id = "scroll"; var scrollDiv = contDiv.appendChild(_scrollDiv); var _ul = document.createElement("UL"); _ul.className = "blog"; var ul = scrollDiv.appendChild(_ul); ul.className = "tab_news"; for(var i=0; i < (data.length - 1); i++) { //alert('Looping thru Articles'); li = document.createElement("li"); //var j = i + 1; //alert(data[i].headline); //if ( i == 0 ) li.className="first"; //else // li.className="color" + j; li.innerHTML="

" + data[i].title + "

\"\""; //li.innerHTML="

" + data[i].title + "

\"\""; //news-read-button.png ul.appendChild(li); } //var ul2 = document.createElement("UL"); //ul2.className = "archive_link"; li = document.createElement("li"); li.className="archive_link"; li.innerHTML="CLICK HERE FOR THE FEATURED ARTICLES ARCHIVE"; ul.appendChild(li); initScrollbars(); } } function initTabs() { var _over = document.getElementById('over'); var _next = document.getElementById('next'); var _prev = document.getElementById('prev'); if(_next) { _next.href="javascript:;"; _next.onclick = function() { var _l = dataTopStory.length; currentTopStory++; currentTopStory = currentTopStory % _l; drawTopStory(dataTopStory[currentTopStory]); } } if(_prev) { _prev.href="javascript:;"; _prev.onclick = function() { var _l = dataTopStory.length; currentTopStory--; if(currentTopStory < 0) currentTopStory = _l - 1; drawTopStory(dataTopStory[currentTopStory]); } } var sets = document.getElementsByTagName("div"); for (var i = 0; i < sets.length; i++) { if (sets[i].className.indexOf("tabset") != -1) { var tabs = []; var links = sets[i].getElementsByTagName("a"); for (var j = 0; j < links.length; j++) { if (links[j].className.indexOf("tab") != -1) { tabs.push(links[j]); links[j].tabs = tabs; var c = document.getElementById(links[j].href.substr(links[j].href.indexOf("#") + 1)); //reset all tabs on start if (c) if (links[j].className.indexOf("active") != -1) { c.style.display = "block"; if(_tabs[c.id]) { eval(_tabs[c.id]); } } else { c.style.display = "none"; } links[j].onclick = function () { if(_over) _over.style.display = "none"; var c = document.getElementById(this.href.substr(this.href.indexOf("#") + 1)); if (c) { //reset all tabs before change for (var i = 0; i < this.tabs.length; i++) { var tab = document.getElementById(this.tabs[i].href.substr(this.tabs[i].href.indexOf("#") + 1)); if (tab) { tab.style.display = "none"; } this.tabs[i].className = this.tabs[i].className.replace("active", ""); } this.className += " active"; c.style.display = "block"; if(_tabs[c.id]) { eval(_tabs[c.id]); } if(c.id == 'top-stories') { if(_over) _over.style.display = "block"; } return false; } } } } } } linksP = document.getElementById('links'); if(linksP) { switchLinks(); } } function switchLinks() { var _over = document.getElementById('over'); var _l = dataTopStory.length - 1; currentLink = (currentLink+1) % _l; if(linksP) { if ( currentLink == _l ) currentLink=0; linksP.innerHTML = ''; var linkA = document.createElement("A"); linkA.href = dataTopStory[currentLink].url; linkA.innerHTML = dataTopStory[currentLink].title; linksP.appendChild(linkA); setTimeout('switchLinks()',4000); } } if (window.addEventListener) window.addEventListener("load", initTabs, false); else if (window.attachEvent && !window.opera) window.attachEvent("onload", initTabs);