
function open_popup(gamename, count)
{
  var img_path = "preview/images";
  var img_game_path = "preview";

  game_window = window.open("", "gameinfo", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=500, height=350");
game_window.document.open("text/html","replace");
  game_window.document.write('<html><head>');
  game_window.document.write('<title>Vegas Casino Online</title>');
  game_window.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
  game_window.document.write('<link rel="stylesheet" href="styles.css" type="text/css">');

  game_window.document.write('<script language="JavaScript"> var previewIndex = ' + count + '; </script>');

//  game_window.document.write('<script src="preview.js"></script>');

  game_window.document.write('<script language="JavaScript">function initArray () { this.length = initArray.arguments.length; for (var i = 0; i < this.length; i++)   this[i+1] =  initArray.arguments[i]; } \n var casino_images = new initArray( "blackjack", \n"baccarat", \n"casinowar", \n"caribbean", \n"paigow", \n"reddog", \n"bjswitch", \n"craps", \n"roulette", \n"sicbo", \n"alchemist", \n"vegas", \n"cinerama", \n"crazy", \n"goldrally", \n"jungleboogie", \n"sultan", \n"monkey", \n"partyline", \n"wall", \n"safe", \n"amigos", \n"8ball", \n"magic", \n"tripleprofits", \n"tropicreels", \n"princess", \n"goblin", \n"fountain", \n"haunted", \n"bermuda", \n"neptun", \n"rock", \n"diamond", \n"fruitmania", \n"goldentour", \n"vegasstars", \n"highway", \n"silverbullet", \n"captain", \n"aces4", \n"deuces4", \n"jacks4", \n"tens", \n"aces", \n"deuces", \n"jacks", \n"joker", \n"megajacks", \n"keno" ); var names = new initArray( "Blackjack", \n"Baccarat", \n"Casino War", \n"Caribbean Poker", \n"Pai Gow Poker", \n"Red Dog  Poker", \n"Blackjack Switch", \n"Craps", \n"European Roulette", \n"Sic Bo", \n"Alchemist\'s Lab", \n"Vegas Slots", \n"Cinerama", \n"Crazy 7", \n"Gold Rally", \n"Jungle Boogie", \n"Sultan\'s Fortune", \n"Funky Monkey", \n"Party Line", \n"Wall st. Fever", \n"Safecracker", \n"Tres Amigos", \n"8-Ball Slots", \n"Magic Slots", \n"Triple Profits", \n"Tropic Reels", \n"Ocean Princess", \n"Goblin\'s Cave", \n"Fountain  of Youth", \n"Haunted House", \n"Bermuda Triangle", \n"Neptune\'s Kingdom", \n"Rock\'n\'Roller", \n"Diamond Valley", \n"Fruit Mania", \n"Golden Tour", \n"Vegas Stars", \n"Highway Kings", \n"Silver Bullet", \n"Captain\'s Treasure", \n"Aces & Faces 4-line videopoker", \n"Deuces Wild 4-line videopoker", \n"Jacks or Better 4-line videopoker", \n"Tens or Better videopoker", \n"Aces & Faces videopoker", \n"Deuces Wild videopoker", \n"Jacks or Better videopoker", \n"Joker Poker videopoker", \n"Megajacks videopoker", \n"Keno" ); var th_names = new initArray( "Blackjack", \n"European Roulette", \n"Vegas Slots", \n"Caribbean Poker", \n"Blackjack Switch", \n"Vegas Stars 5-reel", \n"Craps", \n"Alchemist\'s Lab", \n"Magic Slots", \n"Tropic Reels", \n"Ocean Princess", \n"Diamond valley", \n"Jacks or Better", \n"Aces & Faces 4-line videopoker", \n"Keno" ); \n var img_count = 50; \n function preview (direction) \n {   if (!document.images) return; \n if (direction == \'next\') previewIndex = previewIndex + 1; \n else previewIndex = previewIndex - 1; \n if (previewIndex == img_count + 1) previewIndex = 1; \n else if (previewIndex == 0) previewIndex = img_count; \n document["gamePreview"].src = "preview/" + casino_images[previewIndex] + ".jpg"; \n document.forms[0].game_name.value = names[previewIndex];\n }</script>');


  game_window.document.write('</head>');
  game_window.document.write('<body bgcolor="#1B1D87" text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
  game_window.document.write('<table width="500" border="0" cellspacing="0" cellpadding="0">');
  game_window.document.write('<tr><td><img src="' + img_path + '/spacer.gif" width="95" height="50"></td><td><img src="' + img_path + '/spacer.gif" width="5" height="50"></td><td align="left" valign="bottom">');
  game_window.document.write('<form><input type="text" name="game_name" size="40" class="preview_textbox"></form>');

game_window.document.write('<script language="JavaScript"> document.forms[0].game_name.value = names[' + count + '];</script>');

  game_window.document.write('</td><td><img src="' + img_path + '/images/spacer.gif" width="5" height="50"></td><td><img src="' + img_path + '/spacer.gif" width="95" height="50"></td></tr>');

  game_window.document.write('<tr><td align="right" valign="middle"><a href="javascript:preview(\'prev\')"><img src="' + img_path + '/left.gif" width="38" height="64" border="0"></a></td>');

  game_window.document.write('<td><img src="' + img_path + '/spacer.gif" width="5" height="50"></td>');

  game_window.document.write('<td align="center" valign="middle"><img src="' + img_game_path + '/' + gamename + '.jpg" width="300" height="225" border="0" name="gamePreview"></td>');

  game_window.document.write('<td><img src="' + img_path + '/spacer.gif" width="5" height="50"></td>');

  game_window.document.write('<td align="left" valign="middle"><a href="javascript:preview(\'next\')"><img src="' + img_path + '/right.gif" width="38" height="64" border="0"></a></td>');

  game_window.document.write('</tr><tr><td colspan="5"><img src="' + img_path + '/spacer.gif" width="500" height="25"></td></tr>');
  game_window.document.write('<tr align="center" valign="middle"><td background="' + img_path + '/bottom.gif"><img src="' + img_path + '/spacer.gif" width="8" height="50"></td><td background="' + img_path + '/bottom.gif"><img src="' + img_path + '/spacer.gif" width="8" height="50"></td>');
  game_window.document.write('<td background="' + img_path + '/bottom.gif"><input type="button" name="download" value="Download NOW!" onClick=javascript:window.location="http://www.vegascasinoonline.com/Remote/AidDownload.php?casinoID=234&gAid=10398&subGid=0&bannerID=0
">');
  game_window.document.write('<br><b><span class="body"> <img src="' + img_path + '/spacer.gif" width="1" height="14">Download and claim Your Bonus!</span></b></td>');
  game_window.document.write('<td background="' + img_path + '/bottom.gif"><img src="' + img_path + '/spacer.gif" width="8" height="50"></td><td background="' + img_path + '/bottom.gif"><img src="' + img_path + '/spacer.gif" width="8" height="50"></td></tr></table>');
  game_window.document.write('</body></html>');
game_window.document.close;

}
