//
// just for initalizing our image array
//
function initArray () {
  this.length = initArray.arguments.length
  for (var i = 0; i < this.length; i++)
  this[i+1] = initArray.arguments[i]
}

//
// array elements are the names of casinoimages. we presume, that all images are of type JPG
// and thumbnails fave suffix '_th' before file extension.
// EXAMPLE: bacarrat_th.gif, bacarrat.gif
//
var casino_images = new initArray(
	"blackjack",
	"roulette",
	"bjswitch",
	"diamonddeal",
	"baccarat",
	"keno",
	"craps",
	"alchemist",
	"diamond",
	"highway",
	"jacks4",
	"magic",
	"silverbullet",
	"megajacks"
);

//
// index to hold current value of picure name in array casino_images
//
var previewIndex = 1;

//
// the preview function. needs to adjusted when there will be change in images number
//
function preview (direction) {
  if (!document.images)
    return;

  if (direction == 'next')
    previewIndex = previewIndex + 1;
  else
    previewIndex = previewIndex - 1;
	
  if (previewIndex == 15) // adjust: max_number_of_images+1
    previewIndex = 1;
  else if (previewIndex == 0)
    previewIndex = 14; // adjust: max_number_of_images
			
  document["gamePreview"].src = "preview/" + casino_images[previewIndex] + "_th.jpg";
}

//
// popupwindow with stuff in it. default the corresponding image for thumbnail
//

function show_bigpic()
{
  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=340");
game_window.document.open("text/html","replace");
  game_window.document.write('<html><head>');
  game_window.document.write('<title>Play Poker Online Casino Game Previews</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 = ' + previewIndex + '; </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"diamonddeal", \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"magicgems", \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"Diamond Deal 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"Magic Gems", \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"Blackjack Switch", \n"Diamond Deal slots", \n"Baccarat", \n"Keno", \n"Craps", \n"Alchemist\'s Lab", \n"Diamond Valley", \n"Highway Kings", \n"Jacks or Better 4-line videopoker", \n"Magic Slots", \n"Silver Bullet", \n"Megajacks progressive videopoker"); \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><body bgcolor="#FFCC00" 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><form><td colspan="7" valign=center align=center><img src="' + img_path + '/spacer.gif" width="1" height="40" align="absmiddle">');

  game_window.document.write('<input type="text" name="game_name" size="40" class="preview_textbox">');
  game_window.document.write('</td></form><tr valign="bottom">');

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

	game_window.document.write('<td><img src="' + img_path + '/spacer.gif" width="60" height="31"></td>');
	game_window.document.write('<td><a href="javascript:preview(\'prev\')"><img src="' + img_path + '/left.gif"  border="0"></a></td>');
	game_window.document.write('<td><img src="' + img_path + '/spacer.gif" width="10" height="31"></td>');
	game_window.document.write('<td><img src="' + img_game_path + '/'+ casino_images[previewIndex] + '.jpg" width="300" height="225" border="2" name="gamePreview"></td>');
	game_window.document.write('<td><img src="' + img_path + '/spacer.gif" width="10" height="31"></td>');
	game_window.document.write('<td><a href="javascript:preview(\'next\')"><img src="' + img_path + '/right.gif"  border="0"></a></td>');
	game_window.document.write('<td><img src="' + img_path + '/spacer.gif" width="60" height="31"></td>');
  game_window.document.write('</tr>');
  game_window.document.write('<tr><td colspan="7"><img src="' + img_path + '/spacer.gif" width="30" height="2"></td></tr>');
  game_window.document.write('<tr>');
	game_window.document.write('<td colspan="7" valign="middle" align="center">');
	game_window.document.write('<p><span class="header"><img src="' + img_path + '/spacer.gif" width="1" height="34" align="absmiddle"></span>');
	game_window.document.write('<a href="http://www.vegascasinoonline.com/Remote/AidDownload.php?casinoID=234&gAid=10398&subGid=0&bannerID=0
"><img src="' + img_path + '/download-bot.gif" border=0 vspace="6"></a><br>');
	game_window.document.write('<span class="header"> <font color="#CC0000"><img src="' + img_path + '/spacer.gif" width="1" height="13" align="absmiddle"></font><b><font face="tahoma" size="2">');
  game_window.document.write('Download and Claim Your Bonus!');
	game_window.document.write('</font></b></span></p></td></tr></table>');
  game_window.document.write('</body></html>');
game_window.document.close;
}