function OpenDown()
{
    document.location.href = "../en/download_short.htm";
    window.open("http://www.pacificpoker.com/PokerInstaller?" + sCut + "&dl=1038","popDown","width=1,height=1,top=0,left=0");
}
function OpenDownCasino()
{
    document.location.href = "http://www.888.com/default.htm?page=download_short&" + sCut+ "&dl=1038";
    window.open("http://www.888.com/CasinoInstaller?" + sCut +"&dl=1038","popDown","width=1,height=1,top=0,left=0");
}
function ContactUs()
{
    var w = 793;
    var h = 517;
    var LocationString = "../en/contactusform/contactus.htm";
    var l = 1; //(window.screen.width-w)/2;
    var t = 1; //(window.screen.height-h)/2;
    window.open(LocationString,"contactUsWnd","status=no,toolbar=no,menubar=no,location=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h)
}
function OpenPoker()
{
    var w = 820;
    var h = 565;
    var l = (window.screen.width-w)/2;
    var t = (window.screen.height-h)/2;
    var filename = "http://ndl.888.com/poker/?Real=1&" + sCut + "&dl=1038";

    window.open(filename ,null, "height=" + h + ",width=" + w + ",status=no,toolbar=no,menubar=no,location=no,resize=no,left="+l+",top="+t);
}
	
function showConfirm()
{
    if(FlagAr[0]!="1")
    {
        setTimeout("nowShowIt()",2000);
    }
}

function nowShowIt()
{
    if(confirm('Click OK to download our software while browsing the site'))
    {
        OpenDown();
    }
}				

function parseTableInfo(tree)
{      
     var TYPE_HOLDEM = "100";
    var TYPE_OMAHA = "102";
    var TYPE_OMAHAHL = "104";
    var TYPE_7STUD = "106";
    var TYPE_7STUDHL = "108";
    var game = null;
    var objectElement = null;
    var totalData = null;
    var totalPlayers = "";
    var totalTables  = "";
    var isValidData = true;
    
    objectElement = tree.getElementsByTagName("PI")[0];
    if(objectElement!=null)
    {
        game = objectElement.getElementsByTagName("g");
        totalData = objectElement.getElementsByTagName("a")[0];
    }
    var nTexas = "";
    var nOmaha = "";
    var nOmahaHL = "";
    var n7Cards = "";
    var n7CardsHL = "";
    if(game!=null)
    {
        for(i=0;i<game.length;i++)
        {

            if(game[i].getAttribute("n")==TYPE_HOLDEM)
                nTexas = game[i].getAttribute("p");
            if(game[i].getAttribute("n")==TYPE_OMAHA)
                nOmaha = game[i].getAttribute("p");
            if(game[i].getAttribute("n")==TYPE_OMAHAHL)
                nOmahaHL = game[i].getAttribute("p");
            if(game[i].getAttribute("n") == TYPE_7STUD)
                n7Cards = game[i].getAttribute("p");
            if(game[i].getAttribute("n") == TYPE_7STUDHL)
                n7CardsHL = game[i].getAttribute("p");
        }
        
        totalPlayers = totalData.getAttribute("p");
        totalTables = totalData.getAttribute("t");

    }
    else
    {
        isValidData=false;
    }
    
    if(isValidData)
    {               
        document.getElementById("total").innerHTML =  "Currently <a class='activeTables'>" + totalPlayers + "</a> players on <a class='activeTables'>" + totalTables +"</a> tables";   
    }
 }

  function getJacks(tree)
{
   
    var game = null;
    var objectElement = null;

    objectElement = tree.getElementsByTagName("jackpots")[0];
    
    if(objectElement!=null)
        var game = objectElement.getElementsByTagName("jackpot");

    var jackpotString = " ";
    var i=0;

    for(i=0;i<game.length;i++)
    {
        //remove the '!' from the end of the name
      if(game[i].getAttribute("name")!=null)
      {
        var name="";
        jacky_name = game[i].getAttribute("name");
        ind = jacky_name.indexOf('!');
        if(ind==jacky_name.length-1)
            jacky_name = jacky_name.substr(0,jacky_name.length-1)
        
        jacky_name += " jackpot"

        jackpotString += jacky_name + ": ";
        
      }     
      if(game[i].getAttribute("sum")!=null)
         jackpotString += game[i].getAttribute("sum") + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        
    }
    //if we have less than 4 jackpots we want to duplicate them
    if(i>0 && i<4)
    {
        jackpotString += " " + jackpotString;
    }
    document.getElementById("jackpotText").innerHTML = "<a style='text-decoration:none;font-family:verdana;font-size:11px;font-weight:bold;color:ffffff;'>" + jackpotString + "</a>";
}