function startPlayer(id, text, soundFile) {
	var so = new SWFObject("/Sites/Common/Flash/frogplayer.swf", id +"flash", "350", "21", "8", "#b0d366");
								so.addVariable("frogText", text);
								so.addVariable("url", soundFile);
								so.addParam("wmode", "transparent");
								so.write(id);

}

function startPlayer380(id, text, soundFile) {
	var so = new SWFObject("/Sites/Common/Flash/frog player-380w.swf", id +"flash", "380", "21", "8", "#b0d366");
								so.addVariable("frogText", text);
								so.addVariable("url", soundFile);
								so.addParam("wmode", "transparent");
								so.write(id);

}

function startPlayerW(id, text, soundFile) {
// on frog details pages must unhide js player and hide noscript also.
	jsPlayer=document.getElementById('scriptPlayer');
	nojs=document.getElementById('noJS');
	
	nojs.style.display='none';
	jsPlayer.style.display='block';
	
	p=jsPlayer.getElementsByTagName('P').item(0);
	p.innerHTML=text;

	var so = new SWFObject("/frogwatch/Sites/Common/Flash/frogplayerwhite.swf", id +"flash", "1", "1", "8", "#fff");
								so.addVariable("frogText", text);
								so.addVariable("url", soundFile);
								so.write(id);
}


function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
//  if (navigator.appName.indexOf ("Microsoft") !=-1) {
//    return window[movieName]
//  } else {
    return document[movieName]
//  }
}

function movieIsLoaded (theMovie) {
  // First make sure the movie's defined.
  if (typeof(theMovie) != "undefined") {
    // If it is, check how much of it is loaded.
    return theMovie.PercentLoaded() == 100;
  } else {
    // If the movie isn't defined, it's not loaded.
    return false;
  }
}

function playmovie(movieName) {

	movieName=movieName + "flash";
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).Play();
  }
}

function stopmovie(movieName) {
	movieName=movieName + "flash";
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).Stop();
  }
}
