Storing Object as Variable

I would like to store “fireballPrefab” as a variable like this: var preFab = fireballPrefab; So that I can just change the prefab like so: preFab = iceballPrefab; and it will launch a different prefab. but its a game object and unity will not let you.

fbInstance = Instantiate(preFab, p1ss.position, p1ss.rotation);

The preFab variable above will not work.

Anyway to do this? *Note: Nonrelevant code is missing.

   function CastFireball() 
  {
  	var spellLvl = 1;

  	
  	
  	combatIndex.isCasting = true;
  	combatIndex.spellLoaded = false;
	yield WaitForSeconds (0.25+(spellLvl*.25));
	if(combatIndex.isCasting == true && p1Spellsent == false)
	{
	var preFab = fireballPrefab;
   	combatIndex.spellLoaded = true;
   	combatIndex.CastRecovery();

   	}


 function P1lastSpell() 
  {
  	combatIndex.spellLoaded = false;
  	p1Spellsent = true;
    yield WaitForSeconds(spellwait);
  	var fbInstance : Rigidbody;
        fbInstance = Instantiate(preFab, p1ss.position, p1ss.rotation);
        fbInstance.AddForce(p1ss.forward * 100);
 	p1Spellsent = false;
 	
  	}

Now for your preFab variable used to store your fireballPrefab, you set variable type as GameObject like:

var preFab : GameObject = fireballPrefab;

And you instantiate like:

var fbInstance : GameObject;
fbInstance = Instantiate(preFab, p1ss.position, p1ss.rotation) as GameObject;
fbInstance.AddComponent<Rigidbody>();
fbInstance.rigidbody.AddForce(p1ss.forward * 100);