// JavaScript Document
function stopAllVoice()
{
	$("div[id ^= 'AudioBytes_'] img").attr("src","/images/play.png");
}
function setFlashVar(org1,org2)
{
	//
	try{
	if(window.voicePlayer) window.document["voicePlayer"].SetVariable(org1, org2);
	//alert(org2);
	}
	catch(e){
		alert(e);
	}
	try{
	if(document.voicePlayer) document.voicePlayer.SetVariable(org1, org2);
	//alert(org2+"2");
	}
	catch(e){
		alert(e);
	}
	
}
$(function(){
  $("div.audio").live("click",function () {
		//alert(this.id);
      //alert($("#"+this.id).find("img").attr("src"));
	 temp = $("#"+this.id).find("img").attr("src");
     $("div[id ^= 'AudioBytes_'] img").attr("src","/images/play.png");
	 //$("#"+this.name+" img").attr("src","Blue_collapse.gif");
	 //$("#"+this.id).find("img").attr("src","plus-img.gif");
	 if( temp == "/images/play.png"){
		$("#"+this.id).find("img").attr("src","/images/stop.png");
		setFlashVar("fileName",$("#"+this.id).attr("fname"))
	  }
	  else{
		$("#"+this.id).find("img").attr("src","/images/play.png");
		setFlashVar("fileName","stop")
	  }
  });	
});

