var gapi = new GameAPI();

function gapi_play(sGameKey, sMyId, sOppId, sName, sPublicAddress, sAddress, bHost,bIsProPlay, nGameType, nGameStyle, nSkillLevel, nPointsToWin, nPossessionRule, nCourt, nCameraView, nGameSpeed, nCBFoulFrequency, nShootingFoulFrequency, nReachInFoulFrequency, bOutOfBounds, bTravelling, bGoaltending, nQuarterLength, nInjuryFrequency, nFatigueEffect, bBackcourtViolation, bDef3Seconds, b3InTheKey, b5SecondInbounding, b8SecondHalfCourt, nFoulOut, easoGameType)
{
	bl_SendPresence("passive","easo2004");
	unloadRootMovie();
	gapi.setGameKey(sGameKey);
	gapi.setMyPlayerId(sMyId);
	gapi.setOpponentPlayerId(sOppId);
	gapi.setOpponentName(sName);
	gapi.setPeerIP(sPublicAddress);
	gapi.setIsGameHost(isTrue(bHost));
	gapi.setGameType(parseInt(nGameType));
	gapi.setEASOGameType(parseInt(easoGameType));
	gapi.setIsProPlay(isTrue(bIsProPlay));

	gapi.setGameStyle(parseInt(nGameStyle));
	gapi.setSkillLevel(parseInt(nSkillLevel));
	gapi.setPointsToWin(parseInt(nPointsToWin));
	gapi.setPossessionRule(parseInt(nPossessionRule));
	gapi.setCourt(parseInt(nCourt));
	gapi.setCameraView(parseInt(nCameraView));
	
	gapi.setGameSpeed(parseInt(nGameSpeed));
	gapi.setCBFoulFrequency(parseInt(nCBFoulFrequency));
	gapi.setShootingFoulFrequency(parseInt(nShootingFoulFrequency));
	gapi.setReachInFoulFrequency(parseInt(nReachInFoulFrequency));

	gapi.setOutOfBounds(nbaNumberToBoolean(bOutOfBounds));
	gapi.setTravelling(nbaNumberToBoolean(bTravelling));
	gapi.setGoaltending(nbaNumberToBoolean(bGoaltending));

	gapi.setQuarterLength(parseInt(nQuarterLength));
	gapi.setInjuryFrequency(parseInt(nInjuryFrequency));
	gapi.setFatigueEffect(parseInt(nFatigueEffect));
	gapi.setBackcourtViolation(nbaNumberToBoolean(bBackcourtViolation));
	gapi.setDef3Seconds(nbaNumberToBoolean(bDef3Seconds));
	gapi.set3InTheKey(nbaNumberToBoolean(b3InTheKey));
	gapi.set5SecondInbounding(nbaNumberToBoolean(b5SecondInbounding));
	gapi.set8SecondHalfCourt(nbaNumberToBoolean(b8SecondHalfCourt));
	gapi.setFoulOut(parseInt(nFoulOut));
	
	gapi.play();
}

function nbaNumberToBoolean(n) {
	if (n==0) {
		return true ;
	} else {
		return false ;
	}
}



