
// VARIABLES /////////////////////////////////////////////////////////////////////////////////////////

function game(dispName, category, description, url, smallIcon, bigIcon, keywords, viewStatus, bgColor, instructions)
{
	this.dispName = dispName;
	this.category = category;
	this.description = description;
	this.url = url;
	this.smallIcon = smallIcon;
	this.bigIcon = bigIcon;
	this.keywords = keywords;
	this.viewStatus = viewStatus;	// 0:not active 1:active 2:new
	this.bgColor = (bgColor=="" || !bgColor)? "#ffffff" : bgColor;
	this.instructions = (!instructions)? "" : instructions;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////

var categoriesArr = new Array("Sporty","Brainz","TableTop","Speed-O","Classical","Arcadia","Strategy");
var allGamesArr = new Array(categoriesArr.length);

// temp array of search results
var someGamesArr = new Array();

//////////////////////////////////////////////////////////////////////////////////////////////////////

// New games - out of girlsense
var come2play_game = new game("Come2Play", "", "Fun two-player games that earn you G-cents!", "http://www.girlsense.com/premium/Games/come2play/index.pl", "", "come2play.swf", "", 1, "", "");
var hookedMedia_game = new game("Hooked Media", "", "Get hooked on these fun games!", "http://www.girlsense.com/premium/Games/hookedMedia/index.pl", "", "hookedMedia.swf", "", 1, "", "");


// 73 Games are working well

// Sporty: 10 games (url="/premium/Games/Sporty" icon="/premium/Games/icons/small/ or /big/")
allGamesArr[0] = new Array
(
	new game("Wakeboarding XS", "Sporty", "Online wakeboard simulation game.", "/wakeboardingXS/index.htm", "wakeboardingxs.gif", "wakeboardingxs.gif" , "wakeboarding xs wakeboardingxs motorboat wakeboard water surfing jump ride waves", 1, "", "")
	,new game("Crazy Ball", "Sporty", "Wacky basketball fun with weird creatures.", "/crazyball/index.htm", "crazyball.gif", "crazyball.gif" , "crazy ball crazyball ball basket basketball weird wacky", 1, "", "")
	,new game("Crazy Pool", "Sporty", "Crazy way to play pool in this online game.", "/crazyPool2/index.htm", "crazypool.gif", "crazypool.gif" , "crazy pool balls colors pool clear hit table", 1, "", "")
	,new game("Pixy Stix Space Slalom", "Sporty", "Rocket slalom game with a candy twist.", "/psslalom/index.htm", "psslalom.gif", "psslalom.swf" , "pixy stix space slalom", 1, "", "")
	,new game("Kore Putt", "Sporty", "Online golf game for some hole in one fun.", "/koreputt/index.htm", "koreputt.gif", "koreputt.gif" , "kore putt koreputt golf miniature ball", 1, "", "")
	,new game("10-Pin Bowling", "Sporty", "Fun online bowling game - trade strikes for points.", "/pinbowling/index.htm", "pinbowling.gif", "pinbowling.gif" , "balls bowling pin", 1, "", "")
	//,new game("Winning Kick Soccer", "Sporty", "Practice soccer kicks in this fun online simulation game.", "/wssoccer/index.htm", "wssoccer.gif", "wssoccer.gif" , "winning kick soccer", 1, "", "")
	,new game("Tennis Ace", "Sporty", "Practice your tennis shots and beat the challengers.", "/tennisAce/tennis_ace.htm", "tennisAce.gif", "tennisAce.gif" , "tennisace tennis ace racket ball hit stroke", 1, "", "")
	,new game("Hotshots", "Sporty", "Take practice shots in this fun online basketball game.", "/hotshots/hotshots.htm", "hotshots.gif", "hotshots.gif" , "hotshots shots shot basket baskets ball", 1, "", "")
	,new game("Snow Boarder XS", "Sporty", "Realistic, snowboarding simulation game for online fun.", "/snowBoarderXs/snowboarderxs.htm", "snowboarderxs.gif", "SnowBoarderXS.swf" , "snow board snowboard simulate skate ski jump slalom move navigate sport athlete athletic", 1, "", "")
	,new game("Snowboard Challenge", "Sporty", "Silly snowboarding online fun.", "/snowboardChallenge/snowboard_challenge.htm", "snowboardChallenge.gif", "snowboardChallenge.swf" , "snow board snowboard crash skate ski jump slalom move navigate", 1, "", "")
);

// Brainz: 13 games (url="/premium/Games/Brainz" icon="/premium/Games/icons/small/ or /big/")
allGamesArr[1] = new Array
(
	new game("Neave Hexxagon", "Brainz", "Use your head to take over the board in this cool game.", "/hexxagon/index.htm", "hexxagon.gif", "hexxagon.gif" , "othello reversi pieces move control board red white neave hexxagon", 1, "", "")
	,new game("Stackup", "Brainz", "Match groups to clear the board in this fun game.", "/stackup/index.htm", "stackup.gif", "stackup.gif" , "tetris stackup", 1, "", "")
	,new game("Color Lines", "Brainz", "Classic puzzle game - match the colored balls to clear the board.", "/colorlines/index.htm", "colorlines.gif", "colorlines.gif" , "color lines colorlines logic", 1, "", "")
	,new game("Penguin Push", "Brainz", "Push ice and win points in this game.", "/pinguinPush/pinguin_push.htm", "pinguinPush.gif", "pinguinPush.gif" , "pinguinpush pinguin push puzzle match space", 1, "", "")
	,new game("Bugs on a Wire", "Brainz", "Use your head to guide the bug.", "/bugOnWire/bug_on_wire.htm", "bugOnWire.gif", "bugOnWire.swf" , "bugs wire jump avoid move", 1, "", "")
	,new game("Bunch", "Brainz", "Bunch the balls and collect the points.", "/bunch/bunch.htm", "bunch.gif", "bunch.gif" , "bunch group match color puzzle board clear", 1, "", "")
	,new game("Topsy Turvy", "Brainz", "Clear the board of as many balls as possible.", "/topsyTurvy/topsy_turvy.htm", "topsyTurvy.gif", "topsyTurvy.gif" , "topsy turvy ball drop collect group color", 1, "", "")
	,new game("TwiddleStix", "Brainz", "Strategy and luck will keep you in the game.", "/twiddleStix/twiddle_stix.htm", "twiddleStix.gif", "twiddleStix.gif" , "twiddle twiddlestix stick water drain move float navigate hit sides", 1, "", "")
	,new game("BLOX", "Brainz", "Online mind-bending puzzle fun.", "/blox/blox.htm", "blox.gif", "blox.gif" , "blox elevators bombs lasers magnets water clear board match move", 1, "", "")
	,new game("BLOX Forever", "Brainz", "Even more boggling mind-teasing puzzles.", "/bloxforever/bloxforever.htm", "bloxforever.gif", "bloxforever.gif" , "blox fotever bloxforever elevators bombs lasers magnets water clear board match move", 1, "", "")
	,new game("Labyrinth", "Brainz", "Escape the labyrinth to score in this game.", "/labyrinth/labyrinth.htm", "labyrinth.gif", "labyrinth.gif" , "labyrinth maze move navigate collect jewels puzzle spaceship fly gems", 1, "", "")
	,new game("Perfect Pizza", "Brainz", "Use your head to copy the perfect pizza.", "/perfectPizza/perfect_pizza.htm", "perfectPizza.gif", "perfectPizza.gif" , "perfect pizza memory match memory matching", 1, "", "")
	,new game("Arcade Lines", "Brainz", "Make lines of five to clear the board.", "/arcadeLinesOnline/arcade_lines_online.htm", "arcadeLinesOnline.gif", "arcadeLinesOnline.gif" , "arcade lines online color balls match", 1, "", "")
);

// TableTop: 7 games
allGamesArr[2] = new Array
(
	new game("Flash Pinball", "TableTop", "Flashy online version of the popular pinball game.", "/flashPinball/index.htm", "flashPinball.gif", "flashPinball.gif" , "flash pinball paddle ball score hit", 1, "", "")
	,new game("Naval Fight", "TableTop", "Online version of the classic \'Battleship\' game.", "/navalFight/index.htm", "navalFight.gif", "navalFight.gif" , "naval fight ships battle fleet battleship ships enemy shoot field", 1, "", "")
	,new game("Flash Chess", "TableTop", "Online version of this classic strategy board game.", "/flashChess3D/index.htm", "flashChess.gif", "flashChess.gif" , "pawn board check checkmate check-mate king queen bishop knight rook", 1, "", "")
	,new game("Bubble Blaster", "TableTop", "Pop bubbles of matching colors to clear the board.", "/bubbleblaster/index.htm", "bubbleblaster.gif", "bubbleblaster.gif" , "bubble blaster bubbles shoot colors match clear board groups pop", 1, "", "")
	//,new game("Mahjongg Solitaire", "TableTop", "A cool version of the mahjongg game - match pieces to clear the board.", "/mahjonggSoliter/index.htm", "mahjonggSoliter.gif", "mahjonggSoliter.gif" , "mahjongg solitaire tiles match pictures chinese free", 1, "", "")
	//,new game("Flippit", "TableTop", "Online version of the famous Othello game - flip the pieces to win.", "/flippit/index.htm", "flippit.gif", "flippit.gif" , "flippit red blue tiles flip surrounding turn", 1, "", "")
	,new game("Neave Simon", "TableTop", "Cool online version of this famous \'Simon says\' game.", "/simon/index.htm", "simon.gif", "simon.gif" , "simon says copy commands colors lights patterns follow", 1, "", "")
	,new game("Dots and Boxes", "TableTop", "Fun online version of this paper and pencil game.", "/dotsAndBoxes/index.htm", "dotsAndBoxes.gif", "dotsAndBoxes.gif" , "dots boxes dot box board fill line area connect", 1, "", "")
	,new game("Fishrace", "TableTop", "Play this fun online game based on backgammon.", "/fishrace/index.htm", "fishrace.gif", "fishrace.gif" , "fishrace backgammon back gammon logic board game dice fish races", 1, "", "")
);

// Speed-O: 9 games
allGamesArr[3] = new Array
(
	new game("Ice Slide", "Speed-O", "Catapult your favorite polar animal as far as you can.", "/iceSlide/index.htm", "iceSlide.gif", "iceSlide.swf" , "ice slide iceslide ice-slide catapult polar animal far", 1, "", "")
	,new game("Beaver Trouble", "Speed-O", "Watch out for the falling garbage in this funny game.", "/beavertrouble/index.htm", "beavertrouble.gif", "beavertrouble.gif" , "beaver trouble sandbags bricks falling", 1, "", "")
	,new game("Kore Karts", "Speed-O", "Fun online race car game - get your car around the track.", "/korekarts/index.htm", "korekarts.gif", "korekarts.swf" , "race car cart korekart", 1, "", "")
	,new game("Wash Basin Ride", "Speed-O", "Fun online slalom game that will give you a watery ride.", "/washbasinRide/index.htm", "washbasinRide.gif", "washbasinRide.swf" , "ride wash basin water move obstacles hit puddle splash laps", 1, "", "")
	//,new game("Crashdown", "Speed-O", "Make color clusters to clear the board and earn big points.", "/crashdown/index.htm", "crashdown.gif", "crashdown.gif" , "remove clusters colors matching groups clear board crashdown", 1, "", "")
	//,new game("Detonator", "Speed-O", "Beware the bombs in this need for speed strategy game.", "/detonator/index.htm", "detonator.gif", "detonator.gif" , "bombs detonate detonater", 1, "", "")
	,new game("SnakeMania", "Speed-O", "Online version of the classic snake game. Fun in any size.", "/snakemania/index.htm", "snakemania.gif", "snakemania.gif" , "arcade snakes snakemania", 1, "", "")
	,new game("Jump and Catch", "Speed-O", "Bounce the boys and get them jumping to catch stars.", "/jumpcatch/index.htm", "jumpcatch.gif", "jumpcatch.gif" , "arcade jumps seesaw stars jump&catch", 1, "", "")
	,new game("Smack n Bash", "Speed-O", "Online anger management - a \'smashing game\'.", "/smacknBash/index.htm", "smacknBash.gif", "smacknBash.gif" , "smacknBash smack bash", 1, "", "")
	,new game("PengaPop", "Speed-O", "Blast through colorful ball walls to win prizes.", "/pengapop/pengapop.htm", "pengapop.gif", "pengapop.swf" , "pengapop pop balls collect points shoot time timer beat score", 1, "", "")
	,new game("Jungle Jiggy", "Speed-O", "Keep the monkey dancing in this fun musical game.", "/jungleJiggy/index.htm", "jungleJiggy.gif", "jungleJiggy.gif" , "jungle jiggy monkey dancing musical", 2, "", "")
);

// Classical: 7 games
allGamesArr[4] = new Array
(
	new game("Future Impact", "Classical", "Use the paddle to hit the ball and break the bricks!", "/futureImpact/index.htm", "futureImpact.gif", "futureImpact.swf" , "future impact break out breakout ball bricks blocks paddle board clear", 1, "", "")
	//,new game("Flash Tetris", "Classical", "Earn high scores in this classic falling blocks game.", "/fltetris/index.htm", "fltetris.gif", "fltetris.gif" , "tetris blocks match flashtetris", 1, "", "")
	,new game("Sun Blocks", "Classical", "Sun-inspired fun falling block game.", "/sunblocks/index.htm", "sunblocks.gif", "sunblocks.gif" , "sunblock tetris", 1, "", "")
	//,new game("Podman", "Classical", "Flash-y online version of the classic Pac man game.", "/podman/index.htm", "podman.gif", "podman.gif" , "podman pacman eggs eat energizer power bugs pods transmitter maze", 1, "", "")
	,new game("Smashing", "Classical", "Break out with this brick-smashing fun game!", "/smashing/smashing.htm", "smashing.gif", "smashing.gif" , "smashing bust break wall brick bust out break breakout bustout smash", 1, "", "")
	,new game("Tomato Bounce", "Classical", "Improve your tomato bouncing skills and earn points.", "/tomatoBounce/tomatobounce.htm", "tomatoBounce.gif", "tomatoBounce.gif" , "tomato bounce bounce save", 1, "", "")
	,new game("Swap a Smiley", "Classical", "Another fun 3 in a row matching game.", "/swapSmiley/SwapSmiley.htm", "swapSmiley.gif", "swapSmiley.swf" , "swap smiley match group color smile smileys row", 1, "", "")
	,new game("Cherry Bomb", "Classical", "Arrange the falling blocks in this dynamite new game.", "/cherryBomb/cherrybomb.htm", "cherryBomb.gif", "cherryBomb.gif" , "cherry bomb match boxes group line lines explode points bombs clear", 1, "", "")
	,new game("Space Out", "Classical", "Hit the comets to break out of this world!", "/spaceOut/spaceout.htm", "spaceOut.gif", "spaceOut.gif" , "space out spaceout brick breakout brick wall wall clear bust bust out bustout space paddle ball", 1, "", "")
);

// Arcadia: 24 games
allGamesArr[5] = new Array
(
	new game("More Bloons", "Arcadia", "Pop the balloons that appear on each level.", "/morebloons/index.htm", "morebloons.gif", "morebloons.swf" , "Pop as many balloons as possible", 1, "", "")
	,new game("BUBBLE RUMBLE", "Arcadia", "Are you fast enought to burst al the bubbles? Play this fun game on KOL!", "http://kids.aol.com/KOL/2/Games/FlashHolder/KOL-Bubble-Rumble", "bubbleRumble.gif", "bubbleRumble.gif" , "Are you fast enought to burst al the bubbles? Play this fun game on KOL!", 1, "", "")
	,new game("ARIEL AND KIKI SHUFFLEBOARD", "Arcadia", "How high can you score in this fun game on KOL?", "http://kids.aol.com/KOL/2/Games/FlashHolder/Ariel-and-Kiki-Shuffleboard", "shuffleBoard.gif", "shuffleBoard.gif" , "sHow high can you score in this fun game on KOL?", 1, "", "")
	,new game("Reel Gold", "Arcadia", "Collect the gold before time runs out.", "/reelGold/index.htm", "reelGold.gif", "reelGold.swf" , "Collect clear reel gold time levels", 1, "", "")
	,new game("Zed", "Arcadia", "Help Zed collect the gold.", "/zed/index.htm", "zed.gif", "zed.gif" , "zed collect gold space guide levels suit", 1, "", "")
	,new game("Beaver Brothers", "Arcadia", "Collect the bricks to complete each level in this fun game.", "/beaverbrothers/index.htm", "beaverbrothers.gif", "beaverbrothers.swf" , "beaver brothers collect bricks level falling", 1, "", "")
	,new game("Bad Hair Day", "Arcadia", "Pop bubbles, win points, earn G-cents!", "/badHairDay/index.pl?playForFun=1", "bad_hair_day.gif", "bad_hair_day.swf" , "bad hair day dry", 1, "", "")
	,new game("Muppy", "Arcadia", "Classic arcade game with objects to collect and bad guys to avoid.", "/muppy/muppy.htm", "muppy.gif", "muppy.gif" , "muppy mouse mice cats jump catch collect", 1, "", "")
	,new game("SuperKid", "Arcadia", "SuperKid is classic fun - just shoot, duck, jump and collect.", "/superkid/index.htm", "superkid.gif", "superkid.swf" , "super kid shoots fires arcade super kids", 1, "", "")
	,new game("Gulpy", "Arcadia", "Gulp your way through the mazes and collect points and cool stuff.", "/gulpy/index.htm", "gulpy.gif", "gulpy.gif" , "gulpy collects alien arcade", 1, "", "")
	,new game("Nobby", "Arcadia", "Online arcade fun - collect nuts, flowers and points!", "/nobby/index.htm", "nobby.gif", "nobby.gif" , "nobby collects nuts arcade", 1, "", "")
	,new game("Iceblox", "Arcadia", "Get that pushy penguin going and collect coins for online fun.", "/iceblox/index.htm", "iceblox.gif", "iceblox.gif" , "iceblox arcade penguins ice blocks collects", 1, "", "")
	,new game("Color Fall", "Arcadia", "Colorful puzzle - group colors and shapes to clear the board.", "/colorfall/index.htm", "colorfall.gif", "colorfall.gif" , "colorfall color fall", 1, "", "")
	,new game("Frutal Panic", "Arcadia", "Falling fruit can hurt - protect the player in this fun game.", "/fpanic/index.htm", "fpanic.gif", "fpanic.gif" , "frutal panic frutalpanic arcade races chase", 1, "", "")
	,new game("Leaf Collectin", "Arcadia", "Collect the leaves but watch out for the acorns - classic online fun.", "/leafCollectin/index.htm", "leafCollectin.gif", "leafCollectin.swf" , "leaf collectin collectin\'", 1, "", "")
	,new game("A Day of Slacking", "Arcadia", "Play this game and learn to slack.", "/dayOfSlacking/day_of_slacking.htm", "dayOfSlacking.gif", "dayOfSlacking.gif" , "dayofslacking day of slacking fall catch move avoid", 1, "", "")
	,new game("Magic Balls", "Arcadia", "Remove colored balls and score big.", "/magicBalls/magic_balls.htm", "magicBalls.gif", "magicBalls.gif" , "magicballs magic balls points clear board", 1, "", "")
	,new game("Monkey Lander", "Arcadia", "Improve your flying skills.", "/monkeyLander/monkey_lander.htm", "monkeyLander.gif", "MonkeyLander.swf" , "monkeylander monkey lander simulation flying land fly crash points", 1, "", "")
	,new game("Temple of Jewels", "Arcadia", "A jewel game to match and collect.", "/templeOfJewels/templeofjewels.htm", "templeOfJewels.gif", "templeOfJewels.gif" , "temple of jewels swap switch row three in a row", 1, "", "")
	,new game("Squirrel Escape", "Arcadia", "Help the squirrel escape to win this game.", "/squirrelEscape/squirrelescape.htm", "squirrelEscape.gif", "squirrelEscape.gif" , "squirrel escape rooms maze labyrinth jump duck beware floating collect key coin", 1, "", "")
	,new game("Bubble Bugs", "Arcadia", "Blow bubbles, catch bugs, earn points!", "/bubbleBugs/index.htm", "bubbleBugs.gif", "bubbleBugs.gif" , "bubble bugs collect score click drag capture wand bubble time", 1, "", "")
	,new game("Snowball Warrior", "Arcadia", "Aim and shoot for snowball fighting fun.", "/snowBallWarrior/snowballwarrior.htm", "snowballwarrior.gif", "snowballwarrior.gif" , "snowball warrior snow fight throw aim shoot", 1, "", "")
	,new game("Pearl Hunt", "Arcadia", "Move against time to get the pearls through the maze.", "/pearlHunt/pearl_hunt.htm", "pearlHunt.gif", "pearlHunt.gif" , "pearl hunt labyrinth points clock timer", 1, "", "")
	//,new game("Mayan Mask Mayhem", "Arcadia", "Clear the board of towering masks.", "/mayan/mayan.htm", "mayan.gif", "mayan.gif" , "mayan mask mayhem Click blocks blow blow up match color connecting time", 1, "", "")
	,new game("Freaky Fun", "Arcadia", "Move through the levels and beware the freaks!", "/freakyFun/freaky_fun.htm", "freakyFun.gif", "freakyFun.gif" , "freaky collect score jump duck", 1, "", "")
	,new game("Polar Jump", "Arcadia", "Jump from iceberg to iceberg.", "/polarJump/polar_jump.htm", "polarJump.gif", "polarJump.gif" , "polar jump jumping strategy think plan", 1, "", "")
	,new game("Puppy Fetch", "Arcadia", "Fetch the stick in this fun jump and duck arcade game.", "/puppyFetch/puppy_fetch.htm", "puppyFetch.gif", "puppyFetch.gif" , "puppy fetch collect points bones levels score time run", 1, "", "")
	,new game("Squirrel Harvest", "Arcadia", "Collect acorns and trade them for points!", "/squirrelHarvest/squirrel_harvest.htm", "squirrelHarvest.gif", "squirrelHarvest.gif" , "squirrel harvest arcade climb time", 1, "", "")
	,new game("Bug Battle Combat", "Arcadia", "A keen eye and a quick hand are needed in this fun fast-paced arcade game.", "/bugbattlecombat/index.htm", "bug_battle.gif", "bug_battle.gif" , "bug buttle combat keen quick fast paced", 1, "", "")
	//,new game("Camp Rock", "Arcadia", "DOWNLOAD this rockin' game presented by Disney's &#169; Camp Rock!", "http://xio.tnimarketing.com/wdshe_soundcheck/final/soundcheck_setup.exe", "campRock.gif", "CampRock.swf" , "", 2, "", "")
);

// Strategy: 5 games
allGamesArr[6] = new Array
(
	new game("PlantWorld", "Strategy", "Help the water-shooting pumpkin save the veggies!", "/plantWorld/index.htm", "plantWorld.gif", "plantWorld.gif" , "chase race shoot key plant world ", 1, "", "")
	,new game("Alien Abduction", "Strategy", "Fly a UFO to collect people and points.", "/alienAbduction/alien_abduction.htm", "alienAbduction.gif", "alienAbduction.swf" , "alien abduction catch fly collect", 1, "", "")
	//,new game("Aqua Energizer", "Strategy", "Move around the maze in this underwater  puzzle game.", "/aquaEnergizer/aqua_energizer.htm", "aquaEnergizer.gif", "aquaEnergizer.gif" , "aqua energizer solve puzzle move balls level brick wall explosion gate key", 1, "", "")
	,new game("Shove It", "Strategy", "Push the blocks to their spots to win.", "/shoveIt/shove_it.htm", "shoveIt.gif", "shoveIt.gif" , "shove move think plot plan place strategy", 1, "", "")
	,new game("Coffee Tycoon", "Strategy", "Building a coffee empire can be fun.", "/coffeeTycoon/coffee_tycoon.htm", "coffeeTycoon.gif", "coffeeTycoon.gif" , "coffee tycoon business customize empire simulate earn money customers business game startup coffee shop simulation simulation game", 1, "", "")
	,new game("Match a Smiley", "Strategy", "Silly matching game for online fun.", "/matchSmiley/concentration.htm", "matchSmiley.gif", "matchSmiley.gif" , "match smiley smile puzzle concentration guess", 1, "", "")
	,new game("Stoneage Sam", "Strategy", "Help Sam survive in the Stone Age in this fun adventure game.", "/stoneageSam/index.htm", "stoneageSam.gif", "stoneageSam.gif" , "stoneage sam stone age adventure", 2, "", "")
);


// SORT FUNCTIONS /////////////////////////////////////////////////////////////////////////////////////////

function getCurrentGameInfo(curGameName) // Get a specific game array by name
{
	curGameName = curGameName || '';
	if (curGameName == "come2play")
	{
		return come2play_game;
	}
	else if (curGameName == "hooked media")
	{
		return hookedMedia_game;
	}
	else
	{
		var i, j;
		for(i=0; i<allGamesArr.length; i++)
		{
			for(j=0; j<allGamesArr[i].length; j++)
			{
				if(allGamesArr[i][j].dispName.toLowerCase() == curGameName)
				{
					return(allGamesArr[i][j]);
				}
			}
		}
	}	
}


function FillTempArrayByCategory(cat) // Fill someGamesArr by a specific category
{
	// init the temp array
	someGamesArr = new Array();
	
	var i, category_index=0;
	for(i=0; i<categoriesArr.length; i++)
	{
		if(categoriesArr[i]==cat)
		{
			category_index = i;
			break
		}
	}
	
	for(i=0; i<allGamesArr[category_index].length; i++)
	{
		someGamesArr[i] = allGamesArr[category_index][i]
	}
	
	// reverse the items
	someGamesArr.reverse();
}


function FillTempArrayByKeywords(searchStr)
{
	// init the temp array
	someGamesArr = new Array();
	
	var i, j, k, counter=0, tempSearchArr;
	for(i=0; i<allGamesArr.length; i++)
	{
		for(j=0; j<allGamesArr[i].length; j++)
		{
			tempSearchArr = allGamesArr[i][j].keywords.split(" ");
			for(k=0; k<tempSearchArr.length; k++)
			{
				if(tempSearchArr[k] == searchStr)
				{
					someGamesArr[counter] = allGamesArr[i][j];
					counter++;
				}
			}
		}
	}
	
	return (counter);
}


function PlayGame(curUrl) // open popup
{
	//var curUrl = (someGamesArr[index_game].url.indexOf("premium")== -1)? "/premium/Games/"+someGamesArr[index_game].category+someGamesArr[index_game].url : someGamesArr[index_game].url;
	alert(curUrl)
	
	window.open(curUrl, "gameWinHandler", "resizable=yes,status=no,scrollbars=no,width=792,height=590");
}


// GENERAL FUNCTIONS /////////////////////////////////////////////////////////////////////////////////////////


function ResizeToInner(innerWidth, innerHeight)
{
	var frameWidth,frameHeight;
	if (self.innerHeight) // all except Explorer
	{
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
	{
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}

	var innerWidth = ( innerWidth!=null ? innerWidth : frameWidth );
	var innerHeight = ( innerHeight!=null ? innerHeight : frameHeight );

	difWidth = 0 + innerWidth - frameWidth;
	difHeight = 0 + innerHeight - frameHeight;

	/*
	alert("frameWidth = " + frameWidth + "\n" + "frameHeight = " + frameHeight);
	alert("difWidth = " + difWidth + "\n" + "difHeight = " + difHeight);
	*/

	if (difWidth != 0 )
	{
		window.resizeBy(difWidth,0);
	}
	if (difHeight != 0)
	{
		window.resizeBy(0,difHeight);
	}

	// scroll down
	window.scrollBy(0,120);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

