function CheckIfWon()
{
	var won = true;
	
	var reds = document.getElementsByClassName("redDropAreas");
	for (var i = 0; i < reds.length && won; i++)
	{
		//check to see if the div doesn't have an image
		if (/.*<img.*/.test(reds[i].innerHTML) === false)
		{
			//if not, user hasn't won the game
			won = false;
		}
	}
	
	var greens = document.getElementsByClassName("greenDropAreas");
	for (var i = 0; i < greens.length && won; i++)
	{
		//check to see if the div doesn't have an image
		if (/.*<img.*/.test(greens[i].innerHTML) === false)
		{
			//if not, user hasn't won the game
			won = false;
		}
	}
	
	var blues = document.getElementsByClassName("blueDropAreas");
	for (var i = 0; i < blues.length && won; i++)
	{
		//check to see if the div doesn't have an image
		if (/.*<img.*/.test(blues[i].innerHTML) === false)
		{
			//if not, user hasn't won the game
			won = false;
		}
	}
	
	var yellows = document.getElementsByClassName("yellowDropAreas");
	for (var i = 0; i < yellows.length && won; i++)
	{
		//check to see if the div doesn't have an image
		if (/.*<img.*/.test(yellows[i].innerHTML) === false)
		{
			//if not, user hasn't won the game
			won = false;
		}
	}
	
	var purples = document.getElementsByClassName("purpleDropAreas");
	for (var i = 0; i < purples.length && won; i++)
	{
		//check to see if the div doesn't have an image
		if (/.*<img.*/.test(purples[i].innerHTML) === false)
		{
			//if not, user hasn't won the game
			won = false;
		}
	}
	
	if (won === true)
	{
        //stop the game
	    StopGame();
	}
}
//checks to see if the user won the game
checks to see if the user won the game
checks to see if the user won the game
function CheckIfWon()
{
	var won = true;
	var reds = document.getElementsByClassName("redDropAreas");
	for (var i = 0; i < reds.length && won; i++)
	{
		if (/.*<img.*/.test(reds[i].innerHTML) === false)
		{
			won = false;
		}
	}
	var greens = document.getElementsByClassName("greenDropAreas");
	for (var i = 0; i < greens.length && won; i++)
	{
		if (/.*<img.*/.test(greens[i].innerHTML) === false)
		{
			won = false;
		}
	}
	var blues = document.getElementsByClassName("blueDropAreas");
	for (var i = 0; i < blues.length && won; i++)
	{
		if (/.*<img.*/.test(blues[i].innerHTML) === false)
		{
			won = false;
		}
	}
	var yellows = document.getElementsByClassName("yellowDropAreas");
	for (var i = 0; i < yellows.length && won; i++)
	{
		if (/.*<img.*/.test(yellows[i].innerHTML) === false)
		{
			won = false;
		}
	}
	var purples = document.getElementsByClassName("purpleDropAreas");
	for (var i = 0; i < purples.length && won; i++)
	{
		if (/.*<img.*/.test(purples[i].innerHTML) === false)
		{
			won = false;
		}
	}
	if (won === true)
	{
	    StopGame();
	}
}
function CheckIfWon ( ) { var won = true ; var reds = document . getElementsByClassName ( "redDropAreas" ) ; for ( var i = 0 ; i < reds . length && won ; i ++ ) { if ( / .*<img.* / . test ( reds [ i ] . innerHTML ) === false ) { won = false ; } } var greens = document . getElementsByClassName ( "greenDropAreas" ) ; for ( var i = 0 ; i < greens . length && won ; i ++ ) { if ( / .*<img.* / . test ( greens [ i ] . innerHTML ) === false ) { won = false ; } } var blues = document . getElementsByClassName ( "blueDropAreas" ) ; for ( var i = 0 ; i < blues . length && won ; i ++ ) { if ( / .*<img.* / . test ( blues [ i ] . innerHTML ) === false ) { won = false ; } } var yellows = document . getElementsByClassName ( "yellowDropAreas" ) ; for ( var i = 0 ; i < yellows . length && won ; i ++ ) { if ( / .*<img.* / . test ( yellows [ i ] . innerHTML ) === false ) { won = false ; } } var purples = document . getElementsByClassName ( "purpleDropAreas" ) ; for ( var i = 0 ; i < purples . length && won ; i ++ ) { if ( / .*<img.* / . test ( purples [ i ] . innerHTML ) === false ) { won = false ; } } if ( won === true ) { StopGame ( ) ; } }
checks to see if the user won the game
checks to see if the user won the game
//check to see if the div doesn't have an image //if not, user hasn't won the game //check to see if the div doesn't have an image //if not, user hasn't won the game //check to see if the div doesn't have an image //if not, user hasn't won the game //check to see if the div doesn't have an image //if not, user hasn't won the game //check to see if the div doesn't have an image //if not, user hasn't won the game //stop the game