function OpeneCogra()
{
	var w = 496;
	var h = 506;	
	var l = (window.screen.width-w)/2;
	var t = (window.screen.height-h)/2;       
        window.open("/new888/lang/en/texts/ecogra.htm","eCogra","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
}

 function OpenDownPoker(loc)
{        
        document.location.href = "/rileys/download_poker.htm?" + sCut;        
        url= "http://" + pokerInstallerUrl + "/PokerInstaller?" +sCut + "&dl="+loc + "&brand=rileys";
        window.open(url,"popDown","width=1,height=1,top=0,left=0");
}
 
function OpenDownCasino(location)
{
    if (isBlockedCountry == "false")
    {
        document.location.href="/rileys/download_casino.htm?" + sCut;
        var sURLreg = "/CasinoInstaller?lang=en&" +sCutLang + "&dl=" + location;
        window.open(sURLreg,"popDown","width=1,height=1,top=0,left=0");
    }
    else
    {
        if (sLang == "en")
            document.location.href = "/new888/home.htm?page=us_message&" + sCutLang + "lang=en";
        else
            document.location.href = "/new888/home.htm?page=tr_message&" + sCutLang + "lang=en";
    }
}

 function changeTab(id)
 {
    
     for (var i = 1; i<=4; i++) 
    {
            if (document.getElementById('text_div'+i)) {document.getElementById('text_div'+i).style.display='none';}
            if (document.getElementById('tabImg'+i)) {document.getElementById('tabImg'+i).className='onetab_off';}
            if (document.getElementById('tab'+i)) {document.getElementById('tab'+i).className='tabtext_off';}
    }
     var txt = document.getElementById('text_div'+id);
     txt.style.display='inline';
     
     var tabImg = document.getElementById('tabImg'+id);
     tabImg.className='onetab_on';
     
      var tabText = document.getElementById('tab'+id);
      tabText.className='tabtext_on';
 }
 
 function nextMonth(id)
 {

    var next_id = Number(id) + 1;
    if(next_id==13) next_id=1;       
    var current = document.getElementById('month'+id);
    current.style.display='none';
    var next = document.getElementById('month'+next_id);
    next.style.display='block';
     getCorrectImg(next_id);
    //lightEvents(next_id ); 
 }
 function getCorrectImg(id)
 {
    var legend = document.getElementById('legendPic');
    var link7 = document.getElementById('link7');
    var link8 = document.getElementById('link8');
    if (id == '1')
    {
       legend.src =sImgPath +"/new888/images/rileysminisite/legend_jan.gif";  
        link7.href="events.htm?" + sCut + "#Competion";
       link8.href="events.htm?" + sCut + "#Guaranteed";
    }
    else  if (id =='2' || id == '3')
    {
       legend.src =sImgPath +"/new888/images/rileysminisite/legend_1.gif";
       link7.href="#";
       link8.href="#";
    }
    else if(id == '4' || id =='5' || id == '6')
    {    
         legend.src =sImgPath +"/new888/images/rileysminisite/legend_2.gif";
         link7.href="#";
          link8.href="#";
    }    
    else if(id == '7' || id =='8')
    {    
         legend.src = sImgPath +"/new888/images/rileysminisite/legend_3.gif";
         link7.href="#";
          link8.href="#";
    }
    else if(id == '9')
    {    
        legend.src = sImgPath +"/new888/images/rileysminisite/legend_09.v1.gif";
        link7.href="#";
         link8.href="#";
    }
     else if(id == '10')
     {    
         legend.src = sImgPath +"/new888/images/rileysminisite/legend_4.v3.gif";
         link7.href="events.htm?" + sCut + "#Competion";
          link8.href="events.htm?" + sCut + "#grandPrix";
     }
     else if(id =='11' || id =='12')
     {    
         legend.src = sImgPath +"/new888/images/rileysminisite/legend_4.v2.gif";
         link7.href="events.htm?" + sCut + "#Competion";
         link8.href="#";

     }
    //alert( link7.href);
 }

  function peviousMonth(id)
 {
    var prev_id = Number(id) - 1;
    var current = document.getElementById('month'+id);
    current.style.display='none';
    var prev = document.getElementById('month'+prev_id);
    prev.style.display='block';
    getCorrectImg(prev_id);
    //lightEvents(prev_id);            
 }
 function displayMonth(id) 
 {
     getCorrectImg(id);
    var current = document.getElementById('month'+id);
    current.style.display='block';    
    lightEvents(id);    
 }
 
 function lightEvents(month)
 {            
    for (var i=0 ;i<weeklyEvents.length; i++)
    {                     
            var dayEvent = document.getElementById(weeklyEvents[i]);    
            dayEvent.className='dayWeekly';
            dayEvent.title="Rileys $5 tournament";         
    } 
     for (var i=0 ;i<MonthlyEvents.length; i++)
    {                     
            var dayEvent = document.getElementById(MonthlyEvents[i]);    
            dayEvent.className='dayMonthly';
            dayEvent.title="Rileys Monthly Freeroll";         
    } 
     for (var i=0 ;i<happyHour.length; i++)
    {                     
            var dayEvent = document.getElementById(happyHour[i]);    
            //alert(dayEvent);
            dayEvent.className='happyHour';
            dayEvent.title="Rileys Happy Hour";         
    } 
    for (var i=0 ;i<showdownSurvivor.length; i++)
    {                     
            var dayEvent = document.getElementById(showdownSurvivor[i]);    
            //alert(dayEvent);
            dayEvent.className='showdownSurvivor';
            dayEvent.title="Monthly Showdown Survivor";         
    } 
    for (var i=0 ;i<weekly80K.length; i++)
    {                     
            var dayEvent = document.getElementById(weekly80K[i]);    
            //alert(dayEvent);
            dayEvent.className='weekly80K';
            dayEvent.title="Weekly 80K tournament";         
    } 
    for (var i=0 ;i<millionQualifiers.length; i++)
    {                     
            var dayEvent = document.getElementById(millionQualifiers[i]);    
            //alert(dayEvent);
            dayEvent.className='millionQualifiers';
            dayEvent.title="3 Million qualifiers";         
    } 
    for (var i=0 ;i<KingofClubsQualifiers.length; i++)
    {                     
            var dayEvent = document.getElementById(KingofClubsQualifiers[i]);    
            //alert(dayEvent);
            dayEvent.className='KingofClubsQualifiers';
            dayEvent.title="King of Clubs 2 online qualifiers";         
    } 
    for (var i=0 ;i<KingofClubsFinal.length; i++)
    {                     
            var dayEvent = document.getElementById(KingofClubsFinal[i]);    
            //alert(dayEvent);
            dayEvent.className='KingofClubsFinal';
            dayEvent.title="King of Clubs 2 online final";         
    } 
    for (var i=0 ;i<IrishOpenTournament.length; i++)
    {                     
            var dayEvent = document.getElementById(IrishOpenTournament[i]);    
            //alert(dayEvent);
            dayEvent.className='IrishOpenTournament';
            dayEvent.title="Irish Open Seat Tournament";         
    } 
     for (var i=0 ;i<IrishOpen.length; i++)
    {                     
            var dayEvent = document.getElementById(IrishOpen[i]);    
            //alert(dayEvent);
            dayEvent.className='IrishOpen';
            dayEvent.title="Irish Open";         
    } 
   for (var i=0 ;i<competition.length; i++)
    {                     
            var dayEvent = document.getElementById(competition[i]);    
            //alert(dayEvent);
            dayEvent.className='competition';
            dayEvent.title="competition";         
    } 
    for (var i=0 ;i<VivaLasVegas.length; i++)
    {                     
            var dayEvent = document.getElementById(VivaLasVegas[i]);    
            //alert(dayEvent);
            dayEvent.className='VivaLasVegas';
            dayEvent.title="VivaLasVegas";         
    } 
    for (var i=0 ;i<Grand.length; i++)
    {                     
            var dayEvent = document.getElementById(Grand[i]);    
            //alert(dayEvent);
            dayEvent.className='Grand';
            dayEvent.title="Grand";         
    } 
    for (var i=0 ;i<Guaranteed.length; i++)
    {                     
            var dayEvent = document.getElementById(Guaranteed[i]);    
            //alert(dayEvent);
            dayEvent.className='Guaranteed';
            dayEvent.title="Guaranteed";         
    } 
 }
 
 function ContactUs()
{
        var w = 793;
        var h = 517;
        var l = 1;
        var t = 1; 
        var LocationString = "/rileys/contactusform/contactus.htm?" + sCut;
        var x = window.open(LocationString,"contactUsWnd","status=no,toolbar=no,menubar=no,location=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h)   
}

function openDetails() {
        var w = 300;
        var h = 200;
        var l = (window.screen.width-w)/2;
        var t = (window.screen.height-h)/2;
        window.open("/rileys/details.htm?"+sCut+"&dl=980","details","resizable=yes,status=no,scrollbars=no,toolbar=no,menubar=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h);
    }

function highlightMenu(class_name, element)
{
    element.className=class_name;
}

 function OpenPop(address)
{
    var w = 480; 
    var h = 350;
    var l = (window.screen.width-w)/2;
    var t = (window.screen.height-h)/2;
    var windowprops = "location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
    window.open(address,"Flash",windowprops);
}
 
   function CheckKey()
    {

            if(event.keyCode == 13)
            {
                    SubmitForm();
                    event.returnValue = false;
            }
    }

    function SubmitForm()
    {
            if((window.document.bbc.bonuscode.value != '') && (window.document.bbc.bonuscode.value != null))
            {
                    window.document.bbc.submit();
            }
    }
    
    function openPrintVersion()
 {
        var w = 795;
        var h = 590;
        var LocationString;
        var l = (window.screen.width-w)/2;
        var t = (window.screen.height-h)/2;

        var filename = "";
        LocationString = "money-transfers-Internal-Table-ForPrint.htm";

        if (window.screen.availWidth==800)
        {
                l = 0;
                t = 0;
                w = window.screen.availWidth;
                h = window.screen.availHeight;
        }

        var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no,left=" + l + ",top=" + t + ",width=" + w + ",height=" + h;
        var popup = window.open(LocationString,"PokerGame",windowprops);
    
    
    }

  function changePromoTab(id)
 {
    
     for (var i = 0; i<=4; i++) 
    {
            //if (document.getElementById('text_div'+i)) {document.getElementById('text_div'+i).style.display='none';}
            if (document.getElementById('tabImg'+i)) 
            {
                if (i == 0)
                    document.getElementById('tabImg'+i).className='promotab_off';
                else    
                    document.getElementById('tabImg'+i).className='onetab_off';
            }
            if (document.getElementById('tab'+i)) 
            {
                if (i == 0)
                    document.getElementById('tab'+i).className='tabtext_promo_off';
                else if (i == 4)
                    document.getElementById('tab'+i).className='tabtext_sm_off';
                else
                    document.getElementById('tab'+i).className='tabtext_off';
            }
    }
     //debugger;
     var myFrame = document.getElementById('if_promo');
     if (id == 0)
        myFrame.src='http://promo.rileyspoker.com/rileys_promo/default.asp?pagename=' + myPageName + '&tab=' + id + '&sr=' + sSerial + '&anid=' + sANID + '&lang=' + sLang;
     else
         myFrame.src='http://promo.rileyspoker.com/rileys_promo/default.asp?tab=' + id + '&sr=' + sSerial + '&anid=' + sANID + '&lang=' + sLang;;
     
     
     var tabImg = document.getElementById('tabImg'+id);
     if (id == 0)
         tabImg.className='promotab_on';
     else
        tabImg.className='onetab_on';
     
      var tabText = document.getElementById('tab'+id);
      if (id == 0)
          tabText.className='tabtext_promo_on';     
      else if (id == 4)
          tabText.className='tabtext_sm_on';
      else
          tabText.className='tabtext_on';
 }