var iwg_data = {'items':[ {'rollText':"Ring Toss", 'src':"ringtoss.jpg", 'swf':"ringtoss", 'desc':"Ring toss is a familiar carnival game to many. The object is simple - try to land a ring on the neck of one of the bottles, and you win a prize!", 'params':{'wmode':'transparent'}}, {'rollText':"Home Run Derby", 'src':"homerunderby.jpg", 'swf':"hrDerby", 'desc':"Take me out to the ball game, and hit it out of the park! Take a swing, and if the hit is a home run, you win a prize.", 'flashvars':{'sponsor_url':'http://www.idealsweepstakes.com/instant_win/www/images/homerunderby/your-logo-here.png'}, 'params':{'wmode':'transparent'}}, {'rollText':"Icon Swap", 'src':"iconswap.jpg", 'swf':"iconswap", 'desc':"How many rows of 3 can you make in 60 seconds? Use your mouse to swap adjacent pieces to make matches."}, {'rollText':"Catch", 'src':"catch.jpg", 'swf':"catch", 'desc':"How many apples can you catch in 30 seconds? Use the mouse to move the basket, and try to catch them all!"}, {'rollText':"Field Goal Kicker", 'src':"fieldgoal.jpg", 'swf':"fieldgoal", 'desc':"Can you put the ball between the posts? If the ball makes it through the goal posts, you have won a prize.", 'params':{'wmode':'transparent'}, 'flashvars':{"jumboURL":"http://www.idealsweepstakes.com/instant_win/www/images/jumbotron.jpg"}}, {'rollText':"Spin-to-Win", 'src':"spinner.jpg", 'swf':"wheel", 'desc':"The game is simple - click spin, then see where the arrow lands! If it lands on a prize, you win!", 'params':{'wmode':'transparent'}}, {'rollText':"Three Cup Monty", 'src':"threecupmonty.jpg", 'swf':"cups/cups", 'desc':"Look fast, because Three Cup Monty is a fast moving instant win game! Watch the cups as they fly back and forth across the box, but don't blink, or you'll miss it!", 'flashvars':{'cup_url':'http://www.idealsweepstakes.com/widgets/games/swf/cups/images/cup-down.png', 'pearl_url':'http://www.idealsweepstakes.com/widgets/games/swf/cups/images/pearl.png'}, 'params':{'wmode':'transparent'}}, {'rollText':"Scratch Off", 'src':"scratchoff.jpg", 'swf':"ScratchOff", 'desc':"Rub the quarter over the scratch off squares to reveal the prizes. If the three match, you are a winner!", 'params':{'wmode':'transparent'}}, {'rollText':"Slots", 'src':"slots.jpg", 'swf':"slots", 'desc':"Click to spin, then watch the slots turn! When it stops spinning, if all three icons match up, then you win a prize. Customize it with images of your own prizes!", 'params':{'wmode':'transparent'}}, {'rollText':"Carnival Hammer", 'src':"carnivalhammer.jpg", 'swf':"carnivalHammer", 'desc':"Carnival Hammer is a classic carnival game to test your strength. Simply click on the hammer to swing it down onto the target zone to launch the golden runner. If your strong enough, you will win a prize.", 'params':{'wmode':'transparent'}}, {'rollText':"Magic Ball", 'src':"magicball.jpg", 'swf':"magicball", 'desc':"Feeling Lucky? Ask your question to the classic Magic Ball and then click on the ball to shake it up to reveal your answer.", 'params':{'wmode':'transparent'}} ], 'info':'
The games presented on this page are demos only. If a game states that you have won a prize, it is for demonstrational purposes only, and no prize has actually been won.
Each game is fully customizable to include your company\'s branding and prizes.
Click a thumbnail at the left to open a game.
'}; var iwg_manager = {}; var noFlashRun = false; iwg_manager.widget = (function() { var thumbScroll; // holds the api for the jqtools scrollable object var activeImagesObj = {'overlay': [], 'arrow': []}; var widg = { init: function() { // establish a loaded callback for swfobject swfobject.addLoadEvent(widg.removeLoading); // create the arrays used to keep track of the overlay and arrow for each thumbnail container activeImagesObj.overlay = $('#iwg_container #thumb-container > .items > .item > .active-overlay'); activeImagesObj.arrow = $('#iwg_container #thumb-container > .items > .item > .active-arrow'); // initialize scrollable thumbScroll = $("#iwg_container div.scrollable").scrollable({ vertical: true, size: 3, api: true }); // functionality for up and down buttons $("#iwg_container #arrow-up").click(function() { widg.scrollThumbs(-1); return false; }); $("#iwg_container #arrow-down").click(function() { widg.scrollThumbs(1); return false; }); //functionality for clicking thumbnails $("#iwg_container .scrollable > .items > .item").click(function() { var i = $("#iwg_container .scrollable > .items > .item").index(this); widg.showActive(i); widg.loadswf(i); widg.loaddesc(i); widg.addLoading(); }); // functionality for rollover text $("#iwg_container .rolltext").hide(); $("#iwg_container .scrollable > .items > .item").mouseenter(function(e) { var theTarget = e.target; while($(theTarget).hasClass('item') == false) { theTarget = $(theTarget).parent(); } $(theTarget).children(".rolltext").stop(true, true).slideDown(150); }); $("#iwg_container .scrollable > .items > .item").mouseleave(function(e) { widg.hideRollText(e.target); }); if (iwg_data.info != 'undefined') { // add info text $("#iwg_container #info-container").append(iwg_data.info); // show info btn $("#iwg_container #info-btn").show(); // set up click actions for the info button and info-container $("#info-btn").click(function(){ widg.displayInfo(); }); $("#info-container .close-btn").click(function(){ widg.hideInfo(); }); } else { console.log("info undefined"); } }, // physically moves the thumbnail scroller when a button is clicked scrollThumbs: function(num) { try { thumbScroll.move(num); } catch(e) { alert("Please wait - thumbnails aren't quite ready..."); } }, // change the overlays and hide and show the proper arrows when a thumbnail is clicked showActive: function(id) { /*for(var i=0; i<$(".scrollable > .items > .item").length; i++) { widg.hideRollText($(".scrollable > .items > .item")[i]); }*/ $(activeImagesObj.overlay).fadeOut(650); $(activeImagesObj.overlay[id]).fadeIn(650); $(activeImagesObj.arrow).animate({ 'left':'207' }, 650); $(activeImagesObj.arrow[id]).stop(true, true).animate({ 'left':'219' }, 650); }, // hide the rollover text for all but the active thumbnail hideRollText: function(el) { // recursively find the item container (div conaining class "item") while($(el).hasClass('item') == false) { el = $(el).parent(); } if (!$(el).hasClass('active')) { $(el).children(".rolltext").stop(true, true).slideUp(500); } }, // load a swf into the swf container based on the id of an item in iwg_data using swfobject // attach flashvars, params and attributes if present for chosen thumb loadswf: function(id) { var i = iwg_data.items[id]; var flashvars = typeof(i.flashvars) != 'undefined' ? i.flashvars : {}; var params = typeof(i.params) != 'undefined' ? i.params : {}; var attributes = typeof(i.attributes) != 'undefined' ? i.attributes : {}; $("#swf").empty(); swfobject.embedSWF("http://www.idealsweepstakes.com/widgets/games/swf/"+i.swf+".swf", "swf", "436", "334", "9.0.0","expressInstall.swf", flashvars, params, attributes, noFlash); }, // loads the description (and does a little animation!) based on item id loaddesc: function(id) { var d = iwg_data.items[id].desc; $('#iwg_container #desc').slideUp(function(){ $('#iwg_container #desc').empty().append(''+d+'
').slideDown(); }); }, // show and hide the info-container div displayInfo: function() { $("#info-container").fadeIn(1000); }, hideInfo: function() { $("#info-container").fadeOut(1000); }, // adds and remove the loading graphic from the swf container addLoading:function() { $("#iwg_container #swf-container").addClass('loading'); }, removeLoading: function() { $("#iwg_container #swf-container").removeClass('loading'); } } return widg; })(); function noFlash(e) { if(!e.success) { if(!noFlashRun) { noFlashRun = true; // Only append the message once swfcontainer = document.getElementById('swf-container'); $(swfcontainer).append('