// ===================================================
// Copyright: 2004 - 2005 by ZCT Internet
// Source:    PokerXL.com
// Author:    Chris Healey
// Updated:   7/18/2005
// Purpose:   Display a random five card poker hand
// each time the web page is loaded or reloaded.
// ===================================================
// This program may not be distributed, modified or
// used on a website without prior written permission.
// v1.0 - Initial routine
// v1.1 - Random cards can no longer be duplicated
// v2.0 - Prebuffer routine removed for load speed
// v2.1 - Redirect added for ZCTi.net & frame breakout
// v2.2 - Redirect added for CollegeShopUSA.com
// v2.3 - Redirect added for ChampionHomesAmerica.com
// v3.0 - Added RandomBanner, display one of two random banners on main page.
// ===================================================
// There are only 10 types of people in this world:
// those that understand binary and those that do not
// ===================================================

var theCards = new Array()
var PokerHand = new Array()
var thePicked = new Array()

// Relocate visitors from other domain names, break out of frames
var where = new String(window.location.host)
if (where.indexOf("zcti.net") != -1) window.location = "http://www.PokerXL.com/ZCTi.html";
if (where.indexOf("collegeshopusa.com") != -1) window.location = "http://www.PokerXL.com/CollegeShopUSA.html";
if (where.indexOf("championhomesamerica.com") != -1) window.location = "http://www.PokerXL.com/ChampionHomesAmerica.html";
if (window != top) top.location.href = location.href;

theCards[00] = 'C/card1-02.gif'
theCards[01] = 'C/card1-03.gif'
theCards[02] = 'C/card1-04.gif'
theCards[03] = 'C/card1-05.gif'
theCards[04] = 'C/card1-06.gif'
theCards[05] = 'C/card1-07.gif'
theCards[06] = 'C/card1-08.gif'
theCards[07] = 'C/card1-09.gif'
theCards[08] = 'C/card1-10.gif'
theCards[09] = 'C/card1-11.gif'
theCards[10] = 'C/card1-12.gif'
theCards[11] = 'C/card1-13.gif'
theCards[12] = 'C/card1-14.gif'
theCards[13] = 'C/card2-02.gif'
theCards[14] = 'C/card2-03.gif'
theCards[15] = 'C/card2-04.gif'
theCards[16] = 'C/card2-05.gif'
theCards[17] = 'C/card2-06.gif'
theCards[18] = 'C/card2-07.gif'
theCards[19] = 'C/card2-08.gif'
theCards[20] = 'C/card2-09.gif'
theCards[21] = 'C/card2-10.gif'
theCards[22] = 'C/card2-11.gif'
theCards[23] = 'C/card2-12.gif'
theCards[24] = 'C/card2-13.gif'
theCards[25] = 'C/card2-14.gif'
theCards[26] = 'C/card3-02.gif'
theCards[27] = 'C/card3-03.gif'
theCards[28] = 'C/card3-04.gif'
theCards[29] = 'C/card3-05.gif'
theCards[30] = 'C/card3-06.gif'
theCards[31] = 'C/card3-07.gif'
theCards[32] = 'C/card3-08.gif'
theCards[33] = 'C/card3-09.gif'
theCards[34] = 'C/card3-10.gif'
theCards[35] = 'C/card3-11.gif'
theCards[36] = 'C/card3-12.gif'
theCards[37] = 'C/card3-13.gif'
theCards[38] = 'C/card3-14.gif'
theCards[39] = 'C/card4-02.gif'
theCards[40] = 'C/card4-03.gif'
theCards[41] = 'C/card4-04.gif'
theCards[42] = 'C/card4-05.gif'
theCards[43] = 'C/card4-06.gif'
theCards[44] = 'C/card4-07.gif'
theCards[45] = 'C/card4-08.gif'
theCards[46] = 'C/card4-09.gif'
theCards[47] = 'C/card4-10.gif'
theCards[48] = 'C/card4-11.gif'
theCards[49] = 'C/card4-12.gif'
theCards[50] = 'C/card4-13.gif'
theCards[51] = 'C/card4-14.gif'

var i = 0;
while (i<5){
	var whichCard = Math.round(Math.random()*(51));
	if (thePicked[whichCard]!="pokerXL"){
		PokerHand[i] = whichCard;
		thePicked[whichCard]="pokerXL";
		i++;
	}
}

function showPokerXL(){
	for (i = 0; i < 5; i++){
		document.write('<TD><img src="'+theCards[PokerHand[i]]+'" ALT="PokerXL - Online Poker Store"></TD>');
	}
}

function RandomBanner(){
	var bannerad = Math.round(Math.random());
	var bannername = "";
	if (bannerad) {bannername = "tp728x60_1.gif"} else {bannername = "tp728x60_2.gif"};
	document.write('<IMG src="../ad_images/'+bannername+'" alt="Play poker online now at Titan Poker" width="728" height="60" border="0">');
}
