﻿
    
    

    function JackpotTrigger()
    {
            setTimeout('Void();',5000);
            
            var JackpotWrapper = document.getElementById('JackpotWrapper');   
            
            var CrappyIE = document.all?true:false;
            
            var JackpotCollection;
            
            var JackpotValues = new Array();
            
            if (CrappyIE) 
            {

                JackpotCollection = JackpotWrapper.innerText;
            }   
            else
            {
                JackpotCollection = JackpotWrapper.textContent;
            }
           
            JackpotValues = JackpotCollection.split('|');   
            
            //dynamically instance the destination div of the jackpot slider
            for (var j=1; j<9;j++)
            {
                eval('var item'+j+'= document.getElementById(\'item'+j+'\')');
            }
            
            for (var i = 0;i<JackpotValues.length;i++)
            {
                //alert(trim(JackpotValues[i]))
                var NameValue = new Array();
                
                NameValue = (JackpotValues[i]).split(' : ')
                
                var GameName;
                
                var GameValue;
                
                GameName = NameValue[0];
                
                GameValue = NameValue[1];
                              
                switch(trim(GameName))
                {
                case 'Combined Jackpots':
                //stuff
                    item1.innerHTML = '<h1>'+GameName+'</h1><h2>'+GameValue+'</h2>'
                break;
                
                case 'Caribbean Draw Poker':
                //stuff
                item2.innerHTML = '<h1>'+GameName+'</h1><h2>'+GameValue+'</h2>'
                break;
                
                case 'Let\'Em Ride':
                //stuff
                item3.innerHTML = '<h1>'+GameName+'</h1><h2>'+GameValue+'</h2>'
                break;
                
                case 'Caribbean Stud Poker':
                //stuff
                item4.innerHTML = '<h1>'+GameName+'</h1><h2>'+GameValue+'</h2>'
                break;           
                
                case 'Jackpot Pinatas':
                //stuff
                item5.innerHTML = '<h1>'+GameName+'</h1><h2>'+GameValue+'</h2>'
                break;
                
                case 'Aztecs Millions':
                //stuff
                item6.innerHTML = '<h1>'+GameName+'</h1><h2>'+GameValue+'</h2>'
                break;
                
                case 'Caribbean Hold\'Em Poker':
                //stuff
                item7.innerHTML = '<h1>'+GameName+'</h1><h2>'+GameValue+'</h2>'
                break;
                
                case 'Midlife Crisis':
                //stuff
                item8.innerHTML = '<h1>'+GameName+'</h1><h2>'+GameValue+'</h2>'
                
                break;                                                        
                }
                
             
                
            }

    }

    function trim(str, chars) {
	    return ltrim(rtrim(str, chars), chars);
    }
     
    function ltrim(str, chars) {
	    chars = chars || "\\s";
	    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
    }
     
    function rtrim(str, chars) {
	    chars = chars || "\\s";
	    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
    }

        function Void()
        {
            return false;
        }
