var sliding=false;var flash="/html/flash/common/audioPlayerV2.swf";var isMacMobile=((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))||(navigator.userAgent.match(/iPad/i)));$(document).ready(function(){if(isMacMobile){window.location=mp3;}else{var player=$("#audiohoverdiv");if(!player.hasClass("playing")){setSlider(player,false);audioUnload(player);if(player.hasClass("playing")){$("#audioPlayer").stopSound();audioStopped();}else{if(player.hasClass("stopped")){$("#audioPlayer").playSound();player.addClass("playing");}else{$("#audioPlayer").sound({swf:flash,file:mp3});player.addClass("playing");player.removeClass("unloaded");}}}$(".audiocontrols .play").click(function(){if(player.hasClass("playing")){$("#audioPlayer").stopSound();player.removeClass("playing");player.addClass("stopped");}else{$("#audioPlayer").playSound();player.addClass("playing");player.removeClass("stopped");}});$(".audiocontrols .pause").click(function(){if(player.hasClass("playing")){$("#audioPlayer").pauseSound();player.removeClass("playing");player.addClass("stopped");}});$(".audiocontrols .mute").click(function(){if(player.hasClass("mute")){$("#audioPlayer").muteSound(false);player.removeClass("mute");}else{$("#audioPlayer").muteSound(true);player.addClass("mute");}});}});function setSlider(player,hover){$(".slider",player).css("width","200px");$(".volume",player).css("width","40px");$(".volume",player).slider({slide:function(evt,ui){$("#audioPlayer").volumeSound(ui.value);}});$(".volume .ui-slider-handle",player).css("left","35px");}function audioUpdate(time,seconds){if($(".playing").size()>0){$(".playing .time").html(time);if(!sliding){var pos=seconds*parseInt($(".playing .slider").css("width"))/$(".playing .slider").data("max.slider").x;$(".playing .slider .ui-slider-handle").css("left",pos+"px");}}}function audioParams(duration){$(".slider").slider({range:"min",min:0,max:duration,step:1,stop:function(evt,ui){$(".playing, .stopped").addClass("playing");$(".playing, .stopped").removeClass("stopped");$("#audioPlayer").slideSound(ui.value);sliding=false;},slide:function(evt,ui){sliding=true;}});}function audioUnload(obj){active=$(".playing, .stopped");if(active.html()!=obj.html()){hideAudioHover();active.removeClass("playing");active.removeClass("stopped");active.addClass("unloaded");}}function audioUnloadLoadVideo(){active=$(".playing, .stopped");if(active.size()>0){active.removeClass("playing");active.removeClass("stopped");active.addClass("unloaded");$("#audioPlayer").stopSound();}}function audioStopped(){$(".playing").addClass("stopped");$(".playing").removeClass("playing");}function audioCompleted(){hideAudioHover();$(".playing").addClass("unloaded");$(".playing").removeClass("playing");}function hideAudioHover(){$("#audiohoverdiv").removeClass("playing");}
