29
MODUL PRAKTIKUM PEMROGRAMAN GAME Bahasa Pemrograman HTML5 dan Javascript Software Notepad++, Xampp dan Google Chrome PROGRAM STUDI TEKNIK INFORMATIKA FAKULTAS TEKNIK UNIVERSITAS MUHAMMADIYAH MALUKU UTARA 2017

MODUL PRAKTIKUM PEMROGRAMAN GAME - if.ummu.ac.idif.ummu.ac.id/images/download/090907-MODUL PRAKTIKUM PMEROGRAMAN...MODUL PRAKTIKUM PEMROGRAMAN GAME Bahasa Pemrograman HTML5 dan Javascript

Embed Size (px)

Citation preview

MODUL PRAKTIKUM

PEMROGRAMAN GAME

Bahasa Pemrograman HTML5 dan Javascript

Software Notepad++, Xampp dan Google Chrome

PROGRAM STUDI TEKNIK INFORMATIKA

FAKULTAS TEKNIK

UNIVERSITAS MUHAMMADIYAH MALUKU UTARA

2017

DAFTAR ISI

SAMPUL

DAFTAR ISI

MODUL 1 PENGANTAR HTML DAN JAVASCRIPT

1.1 Pengertian HTML ............................................................................ 1

1.2 Sintax HTML ................................................................................... 2

1.3 Atribut Gambar Pada HTML .......................................................... 2

1.4 Atribut Link Pada HTML ............................................................... 3

1.5 Format Teks .................................................................................... 3

1.6 Pengertian JavaScript ...................................................................... 3

MODUL 2 SCRIPT DASAR MEMBUAT GAME

2.1 Mengetahui Masalah Pada Game .................................................... 5

2.2 Membuat Antrian ............................................................................ 5

2.3 Membuat Script Download ............................................................. 6

2.4 Melacak Kesuksesan dan Kegagalan .............................................. 6\

2.5 Membuat Sinyal Saat Selesai .......................................................... 7

MODUL 3 MEMBUAT GAME ALIEN

3.1 Membuat File Utama ...................................................................... 8

3.2 Membuat Gambar ........................................................................... 8

3.3 Membuat Script HTML5 ................................................................ 9

MODUL 1

PENGANTAR HTML DAN JAVASCRIPT

1.1 Pengetian HTML

HTML adalah bahasa markup untuk menggambarkan dokumen web

(halaman web) . HTML merupakan singkatan dari Hyper Text Markup

Language Sebuah bahasa markup terdiri dari seperangkat tag markup

Dokumen HTML dijelaskan oleh tag HTML Setiap tag HTML menjelaskan

isi dokumen yang berbeda Adapun versi dari HTML sekarang sudah

mencapai versi ke -5 . Dari gambar 1.1 dapat kita lihat berbagai versi dari

HTML dari pertama kali keluar hingga versi sekarang.

Versi Tahun

HTML 1991

HTML+ 1993

HTML 2.0 1995

HTML 3.2 1997

HTML 4.01 1999

XHTML 2000

HTML5 2012

1.2 Sintax HTML

gambar 1.1 Sintax HTML

Penjelasan dari gambar 1.1:

- Deklarasi diantara <!DOCTYPE html> mendefinisikan tipe dokumen

yakni HTML 5

- Teks diantara <Head> dan </head> menjelaskan judul dari program

- Teks di antara <html> dan </html> menjelaskan dokumen web

- Teks di antara <body> dan </body> menggambarkan isi halaman yang

terlihat

- Teks di antara <h1> dan </h1> menggambarkan heading yang bertipe 1

- Teks di antara <p> dan </p> menjelaskan paragraf

1.3 Atribut Gambar Pada HTML

Cara penulisan script html untuk menyisipkan gambar yaitu

Gambar 1.2 contoh Menyisipkan Gambar

1.4 Atribut Link Pada HTML

Contoh memasang link pada web

Gambar 1.3 Contoh Membuat Link

1.5 Format Teks

Element untuk format teks pada html adalah sebagai berikut :

Elemen Fungsi

<b>....</b> Untuk membuat tulisan tebal

<i>....</i> Untuk membuat tulisan miring

<u>...</u> Untuk membuat tulisan bergaris

bawah

<s>....</s> Untuk membuat coretan teks

<blink>....</blink> Untuk membuat tulisan berkedip

<big>...</big> Untuk membesarkan teks

<small>...</small> Untuk memperkecil teks

1.6 Pengetian JavaScript

Javascript adalah bahasa script yang populer di internet dan dapat

bekerja di sebagian besar penjelajah web browser seperti Internet Explorer

(IE), Mozilla Firefox, Netscape, opera dan web browser lainnya. Kode

javascript biasa dituliskan dalam bentuk fungsi (Function) yang ditaruh di

bagian dalam tag yang dibuka dengan tag <script languange=”javascript”>

Berikut adalah cara memanggil file javascript pada web

MODUL 2

SCRIPT DASAR MEMBUAT GAME

2.1 Mengetahui Masalah Pada Game

Game HTML5 tidak dapat mengasumsikan aset mereka seperti

gambar atau audio yang ada di mesin lokal pemain, karena game HTML5

menyiratkan dimainkan di browser web dengan aset yang diunduh melalui

HTTP. Karena jaringan yang terlibat, browser tidak yakin kapan aset untuk

game akan dijalankan.

Cara dasar untuk memrogram memuat gambar di browser web adalah

kode berikut

var image = new Image();

image.addEventListener(“success”, function(e) {

// do stuff with the image

});

image.src = "/some/image.png";

2.2 Membuat Antrian

Persyaratan pertama adalah mengantri download. Desain ini

memungkinkan Anda mendeklarasikan aset yang Anda butuhkan tanpa

benar-benar mendownloadnya. Ini bisa berguna jika, misalnya, Anda ingin

mendeklarasikan semua aset untuk tingkat permainan dalam file

konfigurasi. Kode untuk konstruktor dan antrian terlihat seperti:

function AssetManager() {

this.downloadQueue = []; }

AssetManager.prototype.queueDownload = function(path) {

this.downloadQueue.push(path);

}

2.3 Membuat Script Download

Script ini untuk menjadikan awal startnya game ketika dijalankan.

Berikut script yang ditampilkan :

AssetManager.prototype.downloadAll = function() {

for (var i = 0; i < this.downloadQueue.length; i++) {

var path = this.downloadQueue[i];

var img = new Image();

var that = this;

img.addEventListener("load", function() {

// coming soon

}, false);

img.src = path;

}

}

2.4 Melacak Kesuksesan dan Kegagalan

Syarat lainnya adalah melacak kesuksesan dan kegagalan, karena

sayangnya tidak semuanya selalu berjalan sempurna. Kode sejauh ini hanya

melacak aset yang berhasil diunduh. Dengan menambahkan pendengar

acara untuk acara kesalahan, Anda akan dapat menangkap skenario

keberhasilan dan kegagalan. Berikut cara membuat script tersebut :

AssetManager.prototype.downloadAll = function(downloadCallback) {

for (var i = 0; i < this.downloadQueue.length; i++) {

var path = this.downloadQueue[i];

var img = new Image();

var that = this;

img.addEventListener("load", function() {

// coming soon

}, false);

img.addEventListener("error", function() {

// coming soon

}, false);

img.src = path;

}

}

2.5 Membuat Sinyal Saat Selesai

Setelah permainan menelan asetnya untuk diunduh, dan meminta

pengelola aset untuk mendownload semua aset, permainan harus diberi tahu

saat semua aset diunduh. Alih-alih permainan bertanya berulang-ulang jika

asetnya diunduh, manajer aset dapat memberi sinyal kembali ke permainan.

Manajer aset perlu terlebih dahulu mengetahui kapan setiap aset selesai.

Berikut script dan metode isDone:

AssetManager.prototype.isDone = function() {

return (this.downloadQueue.length == this.successCount +

this.errorCount);

}

MODUL 3

MEMBUAT GAME ALIEN

3.1 Membuat File Utama

File utama dijadikan sebagai halaman awal yang nantinya akan

menampilkan game aliens. Berikut scriptnya :

Gambar 3.1 Index.html

3.2 Membuat Gambar

Resolusi layar (screen resolution) adalah banyaknya pixel-pixel

horizontal (misalnya 1366) dan vertikal (misalnya 768) yang ditampilkan di

layar monitor. Semakin tinggi resolusi, tentu saja semakin banyak pixel

yang tampil di layar, yang berarti gambar semakin mendetail. Semakin

tinggi resolusi layar semakin memakan performa. Resolusi di konsol hanya

menyebutkan pixel vertikal (misalnya 720p atau 1080p) karena layar

TV widescreen umumnya hanya menampilkan satu aspect ratio tertentu.

3.3 Membuat Script HTML5

Membuat statistik yang nantinya diberi nama stats.js. Berikut

scriptnya :

var Stats=function(){

function w(d,K,n){

var u,f,c;

for(f=0;f<30;f++)

for(u=0;u<73;u++){

c=(u+f*74)*4;

d[c]=d[c+4];

d[c+1]=d[c+5];

d[c+2]=d[c+6]}

for(f=0;f<30;f++){

c=(73+f*74)*4;

if(f<K){

d[c]=b[n].bg.r;

d[c+1]=b[n].bg.g;

d[c+2]=b[n].bg.b

}else{

d[c]=b[n].fg.r;

d[c+1]=b[n].fg.g;

d[c+2]=b[n].fg.b}}}

var v=0,x=2,e,y=0,l=(new Date).getTime(),

J=l,z=l,o=0,A=1E3,B=0,m,g,a,p,C,q=0,D=1E3,E=0,h,i,r,F,s=0,

G=1E3,H=0,j,k,t,I,b={fps:{bg:{r:16,g:16,b:48},fg:{r:0,g:255,b:255}},

ms:{bg:{r:16,g:48,b:16},fg:{r:0,g:255,b:0}},mem:{bg:{r:48,g:16,b:26

},fg:{r:255,g:0,b:128}}};

e=document.createElement("div");

e.style.cursor="pointer";

e.style.width="80px";

e.style.opacity="0.9";

e.style.zIndex="10001";

e.addEventListener("click",function(){v++;v==x&&(v=0);

m.style.display="none";

h.style.display="none";

j.style.display="none";

switch(v){case 0:m.style.display="block";

break;

case 1:h.style.display="block";

break;

case 2:j.style.display="block"}},false);

m=document.createElement("div");

m.style.backgroundColor="rgb("+Math.floor(b.fps.bg.r/2)+","+

Math.floor(b.fps.bg.g/2)+","+Math.floor(b.fps.bg.b/2)+")";

m.style.padding="2px 0px 3px 0px";

e.appendChild(m);

g=document.createElement("div");

g.style.fontFamily="Helvetica, Arial, sans-serif";

g.style.textAlign="left";g.style.fontSize="9px";

g.style.color="rgb("+b.fps.fg.r+","+b.fps.fg.g+","+b.fps.fg.b+")

";

g.style.margin="0px 0px 1px 3px";

g.innerHTML='<span style="font-

weight:bold">FPS</span>';

m.appendChild(g);

a=document.createElement("canvas");

a.width=74;

a.height=30;

a.style.display="block";

a.style.marginLeft="3px";

m.appendChild(a);

p=a.getContext("2d");

p.fillStyle="rgb("+b.fps.bg.r+","+b.fps.bg.g+","+b.fps.bg.b+")"

;

p.fillRect(0,0,a.width,a.height);

C=p.getImageData(0,0,a.width,a.height);

h=document.createElement("div");

h.style.backgroundColor="rgb("+Math.floor(b.ms.bg.r/2)+","+

Math.floor(b.ms.bg.g/2)+","+Math.floor(b.ms.bg.b/2)+")";

h.style.padding="2px 0px 3px

0px";h.style.display="none";

e.appendChild(h);

i=document.createElement("div");

i.style.fontFamily="Helvetica, Arial, sans-serif";

i.style.textAlign="left";

i.style.fontSize="9px";

i.style.color="rgb("+b.ms.fg.r+","+b.ms.fg.g+","+b.ms.fg.b+")"

;

i.style.margin="0px 0px 1px 3px";

i.innerHTML='<span style="font-

weight:bold">MS</span>';

h.appendChild(i);

a=document.createElement("canvas");

a.width=74;

a.height=30;

a.style.display="block";

a.style.marginLeft="3px";

h.appendChild(a);

r=a.getContext("2d");

r.fillStyle="rgb("+b.ms.bg.r+","+b.ms.bg.g+","+b.ms.bg.b+")";

r.fillRect(0,0,a.width,a.height);

F=r.getImageData(0,0,a.width,a.height);

try{if(webkitPerformance&&webkitPerformance.memory.total

JSHeapSize)x=3}catch(L){}j=document.createElement("div");

j.style.backgroundColor="rgb("+Math.floor(b.mem.bg.r/2)+","

+Math.floor(b.mem.bg.g/2)+","+Math.floor(b.mem.bg.b/2)+")";

j.style.padding="2px 0px 3px 0px";

j.style.display="none";

e.appendChild(j);

k=document.createElement("div");

k.style.fontFamily="Helvetica, Arial, sans-serif";

k.style.textAlign="left";

k.style.fontSize="9px";

k.style.color="rgb("+b.mem.fg.r+","+b.mem.fg.g+","+b.mem.f

g.b+")";

k.style.margin="0px 0px 1px 3px";

k.innerHTML='<span style="font-

weight:bold">MEM</span>';

j.appendChild(k);

a=document.createElement("canvas");

a.width=74;

a.height=30;

a.style.display="block";

a.style.marginLeft="3px";

j.appendChild(a);

t=a.getContext("2d");

t.fillStyle="#301010";

t.fillRect(0,0,a.width,a.height);

I=t.getImageData(0,0,a.width,a.height);

return{domElement:e,update:function(){y++;

l=(new Date).getTime();

q=l-J;D=Math.min(D,q);

E=Math.max(E,q);

w(F.data,Math.min(30,30-q/200*30),"ms");

i.innerHTML='<span style="font-

weight:bold">'+q+" MS</span> ("+D+"-"+E+")";

r.putImageData(F,0,0);

J=l;

if(l>z+1E3){

o=Math.round(y*1E3/(l-z));

A=Math.min(A,o);B=Math.max(B,o);

w(C.data,Math.min(30,30-

o/100*30),"fps");

g.innerHTML='<span

style="font-weight:bold">'+o+" FPS</span> ("+A+"-"+B+")";

p.putImageData(C,0,0);

if(x==3){s=webkitPerformance.memory.usedJSHeapSize*9.54

E-7;

G=Math.min(G,s);

H=Math.max(H,s);

w(I.data,Math.min(30,30-

s/2),"mem");

k.innerHTML='<span

style="font-weight:bold">'+Math.round(s)+" MEM</span>

("+Math.round(G)+"-"+Math.round(H)+")";

t.putImageData(I,0,0)}z=l;y=0}}}};

Selanjutnya membuat file app.js

soundManager.url = 'swf/';

soundManager.flashVersion = 9;

soundManager.debugFlash = false;

soundManager.debugMode = false;

window.requestAnimFrame = (function(){

return window.requestAnimationFrame ||

window.webkitRequestAnimationFrame ||

window.mozRequestAnimationFrame ||

window.oRequestAnimationFrame ||

window.msRequestAnimationFrame ||

function(/* function */ callback, /* DOMElement */

element){

window.setTimeout(callback, 1000 / 60);

};

})();

function AssetManager() {

this.successCount = 0;

this.errorCount = 0;

this.cache = {};

this.downloadQueue = [];

this.soundsQueue = [];

}

AssetManager.prototype.queueDownload = function(path) {

this.downloadQueue.push(path);

}

AssetManager.prototype.queueSound = function(id, path) {

this.soundsQueue.push({id: id, path: path});

}

AssetManager.prototype.downloadAll = function(downloadCallback)

{

if (this.downloadQueue.length === 0 && this.soundsQueue.length

=== 0) {

downloadCallback();

}

this.downloadSounds(downloadCallback);

for (var i = 0; i < this.downloadQueue.length; i++) {

var path = this.downloadQueue[i];

var img = new Image();

var that = this;

img.addEventListener("load", function() {

console.log(this.src + ' is loaded');

that.successCount += 1;

if (that.isDone()) {

downloadCallback();

}

}, false);

img.addEventListener("error", function() {

that.errorCount += 1;

if (that.isDone()) {

downloadCallback();

}

}, false);

img.src = path;

this.cache[path] = img;

}

}

Setelah membuat file app.js, membuat file soundmanager2-nodebug-jsmin.js

untuk memanggil audio. Berikut file nya :

(function($){function qa(Ga,Ha){function o(c){return

function(a){return!this._t||!this._t._a?null:c.call(this,a)}}function

ra(){if(b.debugURLParam.test(R))b.debugMode=true}this.flashVersio

n=8;this.debugFlash=this.debugMode=false;this.useConsole=true;this.

waitForWindowLoad=this.consoleOnly=false;this.nullURL="about:bl

ank";this.allowPolling=true;this.useFastPolling=false;this.useMovieSta

r=true;this.bgColor="#ffffff";this.useHighPerformance=false;this.flash

PollingInterval=null;this.flashLoadTimeout=

1E3;this.wmode=null;this.allowScriptAccess="always";this.useHTML

5Audio=this.useFlashBlock=false;this.html5Test=/^probably$/i;this.us

eGlobalHTML5Audio=true;this.requireFlash=false;this.audioFormats

={mp3:{type:['audio/mpeg;

codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-

robust"],required:true},mp4:{related:["aac","m4a"],type:['audio/mp4;

codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-

LATM","audio/mpeg4-generic"],required:true},ogg:{type:["audio/ogg;

codecs=vorbis"],required:false},

wav:{type:['audio/wav;

codecs="1"',"audio/wav","audio/wave","audio/x-

wav"],required:false}};this.defaultOptions={autoLoad:false,stream:tru

e,autoPlay:false,loops:1,onid3:null,onload:null,whileloading:null,onpla

y:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfail

ure:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5E3,onbe

forefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:

200,multiShot:true,multiShotEvents:false,position:null,pan:0,type:null,

usePolicyFile:false,

volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,

useWaveformData:false,useEQData:false,onbufferchange:null,ondatae

rror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onco

nnect:null,duration:null};this.version=null;this.versionNumber="V2.97

a.20110306";this.movieURL=null;this.url=Ga||null;this.altURL=null;t

his.enabled=this.swfLoaded=false;this.o=null;this.movieID="sm2-

container";this.id=Ha||"sm2movie";this.swfCSS={swfBox:"sm2-

object-box",swfDefault:"movieContainer",swfError:"swf_error",

swfTimedout:"swf_timedout",swfLoaded:"swf_loaded",swfUnblocked

:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performan

ce",flashDebug:"flash_debug"};this.oMC=null;this.sounds={};this.sou

ndIDs=[];this.muted=false;this.debugID="soundmanager-

debug";this.debugURLParam=/([#?&])debug=1/i;this.didFlashBlock=t

his.specialWmodeCase=false;this.filePattern=null;this.filePatterns={fl

ash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.baseMimeTypes=/^\s

*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamMimeTypes=

/^\s*audio\/(?:x-

)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamTypes=["aac","flv","mov","m

p4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=R

egExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.mime

Pattern=this.baseMimeTypes;this.features={buffering:false,peakData:f

alse,waveformData:false,eqData:false,movieStar:false};this.sandbox={

};this.hasHTML5=null;this.html5={usingFlash:null};this.ignoreFlash=

false;var

aa,b=this,D,t=navigator.userAgent,k=$,R=k.location.href.toString(),

l=this.flashVersion,j=document,ba,S,w=[],J=false,K=false,r=false,y=fa

lse,sa=false,L,s,ca,z,E,da,T,ta,ea,A,ua,M,F,fa,ga,U,ha,va,wa,V,xa,N=n

ull,ia=null,B,ja,G,W,X,ka,p,Y=false,la=false,ya,za,C=null,Aa,Z,u=fals

e,O,x,ma,Ba,q,Ia=Array.prototype.slice,P=false,na,H,Ca,Da=t.match(/

pre\//i),Ja=t.match(/(ipad|iphone|ipod)/i);t.match(/mobile/i);var

v=t.match(/msie/i),Ka=t.match(/webkit/i),Q=t.match(/safari/i)&&!t.ma

tch(/chrome/i),oa=!R.match(/usehtml5audio/i)&&!R.match(/sm2\-

ignorebadua/i)&&Q&&t.match(/OS X 10_6_(3|4|5|6)/i),

pa=typeof j.hasFocus!=="undefined"?j.hasFocus():null,I=typeof

j.hasFocus==="undefined"&&Q,Ea=!I;this._use_maybe=R.match(/sm

2\-

useHTML5Maybe\=1/i);this._overHTTP=j.location?j.location.protocol

.match(/http/i):null;this.useAltURL=!this._overHTTP;this._global_a=n

ull;if(Ja||Da){b.useHTML5Audio=true;b.ignoreFlash=true;if(b.useGlo

balHTML5Audio)P=true}if(Da||this._use_maybe)b.html5Test=/^(prob

ably|maybe)$/i;this.supported=this.ok=function(){return

C?r&&!y:b.useHTML5Audio&&b.hasHTML5};this.getMovie=functi

on(c){return v?

k[c]:Q?D(c)||j[c]:D(c)};this.createSound=function(c){function

a(){g=W(g);b.sounds[e.id]=new aa(e);b.soundIDs.push(e.id);return

b.sounds[e.id]}var

g=null,h=null,e=null;if(!r||!b.ok()){ka("soundManager.createSound():

"+B(!r?"notReady":"notOK"));return

false}if(arguments.length===2)c={id:arguments[0],url:arguments[1]};

e=g=s(c);if(p(e.id,true))return

b.sounds[e.id];if(Z(e)){h=a();h._setup_html5(e)}else{if(l>8&&b.useM

ovieStar){if(e.isMovieStar===null)e.isMovieStar=e.serverURL||(e.typ

e?e.type.match(b.netStreamPattern):

false)||e.url.match(b.netStreamPattern)?true:false;if(e.isMovieStar)if(e.

usePeakData)e.usePeakData=false}e=X(e,"soundManager.createSoun

d():

");h=a();if(l===8)b.o._createSound(e.id,e.onjustbeforefinishtime,e.loo

ps||1,e.usePolicyFile);else{b.o._createSound(e.id,e.url,e.onjustbeforefi

nishtime,e.usePeakData,e.useWaveformData,e.useEQData,e.isMovieSt

ar,e.isMovieStar?e.bufferTime:false,e.loops||1,e.serverURL,e.duration||

null,e.autoPlay,true,e.autoLoad,e.usePolicyFile);if(!e.serverURL){h.co

nnected=true;e.onconnect&&

e.onconnect.apply(h)}}if((e.autoLoad||e.autoPlay)&&!e.serverURL)h.l

oad(e)}e.autoPlay&&!e.serverURL&&h.play();return

h};this.destroySound=function(c,a){if(!p(c))return false;var

g=b.sounds[c],h;g._iO={};g.stop();g.unload();for(h=0;h<b.soundIDs.le

ngth;h++)if(b.soundIDs[h]===c){b.soundIDs.splice(h,1);break}a||g.de

struct(true);delete b.sounds[c];return

true};this.load=function(c,a){if(!p(c))return false;return

b.sounds[c].load(a)};this.unload=function(c){if(!p(c))return

false;return b.sounds[c].unload()};

this.start=this.play=function(c,a){if(!r||!b.ok()){ka("soundManager.pla

y(): "+B(!r?"notReady":"notOK"));return false}if(!p(c)){a instanceof

Object||(a={url:a});if(a&&a.url){a.id=c;return

b.createSound(a).play()}else return false}return

b.sounds[c].play(a)};this.setPosition=function(c,a){if(!p(c))return

false;return

b.sounds[c].setPosition(a)};this.stop=function(c){if(!p(c))return

false;return b.sounds[c].stop()};this.stopAll=function(){for(var c in

b.sounds)b.sounds[c]instanceof aa&&b.sounds[c].stop()};

this.pause=function(c){if(!p(c))return false;return

b.sounds[c].pause()};this.pauseAll=function(){for(var

c=b.soundIDs.length;c--

;)b.sounds[b.soundIDs[c]].pause()};this.resume=function(c){if(!p(c))re

turn false;return

b.sounds[c].resume()};this.resumeAll=function(){for(var

c=b.soundIDs.length;c--

;)b.sounds[b.soundIDs[c]].resume()};this.togglePause=function(c){if(!

p(c))return false;return

b.sounds[c].togglePause()};this.setPan=function(c,a){if(!p(c))return

false;return b.sounds[c].setPan(a)};this.setVolume=

function(c,a){if(!p(c))return false;return

b.sounds[c].setVolume(a)};this.mute=function(c){var a=0;if(typeof

c!=="string")c=null;if(c){if(!p(c))return false;return

b.sounds[c].mute()}else{for(a=b.soundIDs.length;a--

;)b.sounds[b.soundIDs[a]].mute();b.muted=true}return

true};this.muteAll=function(){b.mute()};this.unmute=function(c){if(ty

peof c!=="string")c=null;if(c){if(!p(c))return false;return

b.sounds[c].unmute()}else{for(c=b.soundIDs.length;c--

;)b.sounds[b.soundIDs[c]].unmute();b.muted=false}return true};

this.unmuteAll=function(){b.unmute()};this.toggleMute=function(c){i

f(!p(c))return false;return

b.sounds[c].toggleMute()};this.getMemoryUse=function(){if(l===8)re

turn 0;if(b.o)return

parseInt(b.o._getMemoryUse(),10)};this.disable=function(c){if(typeof

c==="undefined")c=false;if(y)return false;y=true;for(var

a=b.soundIDs.length;a--

;)wa(b.sounds[b.soundIDs[a]]);L(c);q.remove(k,"load",E);return

true};this.canPlayMIME=function(c){var

a;if(b.hasHTML5)a=O({type:c});return!C||a?a:c?c.match(b.mimePatte

rn)?

true:false:null};this.canPlayURL=function(c){var

a;if(b.hasHTML5)a=O(c);return!C||a?a:c?c.match(b.filePattern)?true:f

alse:null};this.canPlayLink=function(c){if(typeof

c.type!=="undefined"&&c.type)if(b.canPlayMIME(c.type))return

true;return

b.canPlayURL(c.href)};this.getSoundById=function(c){if(!c)throw

Error("soundManager.getSoundById(): sID is null/undefined");return

b.sounds[c]};this.onready=function(c,a){if(c&&c instanceof

Function){a||(a=k);ca("onready",c,a);z();return true}else throw

B("needFunction",

"onready");};this.ontimeout=function(c,a){if(c&&c instanceof

Function){a||(a=k);ca("ontimeout",c,a);z({type:"ontimeout"});return

true}else throw

B("needFunction","ontimeout");};this.getMoviePercent=function(){ret

urn b.o&&typeof

b.o.PercentLoaded!=="undefined"?b.o.PercentLoaded():null};this._w

D=this._writeDebug=function(){return

true};this._debug=function(){};this.reboot=function(){var

c,a;for(c=b.soundIDs.length;c--

;)b.sounds[b.soundIDs[c]].destruct();try{if(v)ia=b.o.innerHTML;N=b.

o.parentNode.removeChild(b.o)}catch(g){}ia=

N=null;b.enabled=r=Y=la=J=K=y=b.swfLoaded=false;b.soundIDs=b.s

ounds=[];b.o=null;for(c in

w)if(w.hasOwnProperty(c))for(a=w[c].length;a--

;)w[c][a].fired=false;k.setTimeout(function(){b.beginDelayedInit()},20

)};this.destruct=function(){b.disable(true)};this.beginDelayedInit=func

tion(){sa=true;F();setTimeout(ua,20);T()};this._html5_events={abort:o

(function(){}),canplay:o(function(){this._t._onbufferchange(0);var

c=!isNaN(this._t.position)?this._t.position/1E3:null;this._t._html5_can

play=true;if(this._t.position&&

this.currentTime!==c)try{this.currentTime=c}catch(a){}}),load:o(func

tion(){if(!this._t.loaded){this._t._onbufferchange(0);this._t._whileloadi

ng(this._t.bytesTotal,this._t.bytesTotal,this._t._get_html5_duration());t

his._t._onload(true)}}),emptied:o(function(){}),ended:o(function(){thi

s._t._onfinish()}),error:o(function(){this._t._onload(false)}),loadeddat

a:o(function(){}),loadedmetadata:o(function(){}),loadstart:o(function(

){this._t._onbufferchange(1)}),play:o(function(){this._t._onbufferchan

ge(0)}),

playing:o(function(){this._t._onbufferchange(0)}),progress:o(function(

c){if(this._t.loaded)return false;var

a,g=0,h=c.type==="progress",e=c.target.buffered;a=c.loaded||0;var

d=c.total||1;if(e&&e.length){for(a=e.length;a--;)g=e.end(a)-

e.start(a);a=g/c.target.duration;h&&isNaN(a)}if(!isNaN(a)){this._t._o

nbufferchange(0);this._t._whileloading(a,d,this._t._get_html5_duration

());a&&d&&a===d&&b._html5_events.load.call(this,c)}}),ratechange

:o(function(){}),suspend:o(function(c){b._html5_events.progress.call(t

his,

c)}),stalled:o(function(){}),timeupdate:o(function(){this._t._onTimer()

}),waiting:o(function(){this._t._onbufferchange(1)})};aa=function(c){

var

a=this,g,h,e;this.sID=c.id;this.url=c.url;this._iO=this.instanceOptions=t

his.options=s(c);this.pan=this.options.pan;this.volume=this.options.vol

ume;this._lastURL=null;this.isHTML5=false;this._a=null;this.id3={};t

his._debug=function(){};this._debug();this.load=function(d){var

f=null;if(typeof

d!=="undefined"){a._iO=s(d);a.instanceOptions=a._iO}else{d=a.optio

ns;

a._iO=d;a.instanceOptions=a._iO;if(a._lastURL&&a._lastURL!==a.ur

l){a._iO.url=a.url;a.url=null}}if(!a._iO.url)a._iO.url=a.url;if(a._iO.url

===a.url&&a.readyState!==0&&a.readyState!==2)return

a;a._lastURL=a.url;a.loaded=false;a.readyState=1;a.playState=0;if(Z(a

._iO)){f=a._setup_html5(a._iO);if(!f._called_load){f.load();f._called_l

oad=true;a._iO.autoPlay&&a.play()}}else

try{a.isHTML5=false;a._iO=X(W(a._iO));l===8?b.o._load(a.sID,a._i

O.url,a._iO.stream,a._iO.autoPlay,a._iO.whileloading?1:0,a._iO.loops||

1,a._iO.usePolicyFile):b.o._load(a.sID,a._iO.url,a._iO.stream?true:fals

e,a._iO.autoPlay?true:false,a._iO.loops||1,a._iO.autoLoad?true:false,a.

_iO.usePolicyFile)}catch(i){ha()}return

a};this.unload=function(){if(a.readyState!==0){if(a.isHTML5){h();if(

a._a){a._a.pause();a._a.src=""}}else

l===8?b.o._unload(a.sID,b.nullURL):b.o._unload(a.sID);g()}return

a};this.destruct=function(d){if(a.isHTML5){h();if(a._a){a._a.pause();a

._a.src="";P||a._remove_html5_events()}}else{a._iO.onfailure=null;b.

o._destroySound(a.sID)}d||

b.destroySound(a.sID,true)};this.start=this.play=function(d,f){var

i;f=f===undefined?true:f;d||(d={});a._iO=s(d,a._iO);a._iO=s(a._iO,a.o

ptions);a.instanceOptions=a._iO;if(a._iO.serverURL)if(!a.connected){

a.getAutoPlay()||a.setAutoPlay(true);return

a}if(Z(a._iO)){a._setup_html5(a._iO);e()}if(a.playState===1&&!a.pa

used)if(i=a._iO.multiShot)a.isHTML5&&a.setPosition(a._iO.position)

;else return

a;if(!a.loaded)if(a.readyState===0){if(!a.isHTML5)a._iO.autoPlay=tru

e;a.load(a._iO)}else if(a.readyState===2)return a;

if(a.paused&&a.position&&a.position>0)a.resume();else{a.playState=

1;a.paused=false;if(!a.instanceCount||a._iO.multiShotEvents||l>8&&!a.

isHTML5&&!a.getAutoPlay())a.instanceCount++;a.position=typeof

a._iO.position!=="undefined"&&!isNaN(a._iO.position)?a._iO.positio

n:0;if(!a.isHTML5)a._iO=X(W(a._iO));if(a._iO.onplay&&f){a._iO.on

play.apply(a);a._onplay_called=true}a.setVolume(a._iO.volume,true);

a.setPan(a._iO.pan,true);if(a.isHTML5){e();a._setup_html5().play()}el

se b.o._start(a.sID,a._iO.loops||1,l===

9?a.position:a.position/1E3)}return

a};this.stop=function(d){if(a.playState===1){a._onbufferchange(0);a.r

esetOnPosition(0);if(!a.isHTML5)a.playState=0;a.paused=false;a._iO.

onstop&&a._iO.onstop.apply(a);if(a.isHTML5){if(a._a){a.setPosition(

0);a._a.pause();a.playState=0;a._onTimer();h();a.unload()}}else{b.o._s

top(a.sID,d);a._iO.serverURL&&a.unload()}a.instanceCount=0;a._iO

={}}return

a};this.setAutoPlay=function(d){a._iO.autoPlay=d;if(a.isHTML5)a._a

&&d&&a.play();else

b.o._setAutoPlay(a.sID,d);d&&!a.instanceCount&&

a.readyState===1&&a.instanceCount++};this.getAutoPlay=function()

{return

a._iO.autoPlay};this.setPosition=function(d){if(d===undefined)d=0;v

ar

f=a.isHTML5?Math.max(d,0):Math.min(a.duration||a._iO.duration,Ma

th.max(d,0));a.position=f;d=a.position/1E3;a.resetOnPosition(a.positio

n);a._iO.position=f;if(a.isHTML5){if(a._a)if(a._html5_canplay)if(a._a.

currentTime!==d)try{a._a.currentTime=d}catch(i){}}else{d=l===9?a.

position:d;if(a.readyState&&a.readyState!==2)b.o._setPosition(a.sID,d

,a.paused||!a.playState)}a.isHTML5&&

a.paused&&a._onTimer(true);return

a};this.pause=function(d){if(a.paused||a.playState===0&&a.readyStat

e!==1)return

a;a.paused=true;if(a.isHTML5){a._setup_html5().pause();h()}else

if(d||d===undefined)b.o._pause(a.sID);a._iO.onpause&&a._iO.onpaus

e.apply(a);return a};this.resume=function(){if(!a.paused)return

a;a.paused=false;a.playState=1;if(a.isHTML5){a._setup_html5().play(

);e()}else{a._iO.isMovieStar&&a.setPosition(a.position);b.o._pause(a.

sID)}if(!a._onplay_called&&a._iO.onplay){a._iO.onplay.apply(a);

a._onplay_called=true}else

a._iO.onresume&&a._iO.onresume.apply(a);return

a};this.togglePause=function(){if(a.playState===0){a.play({position:l

===9&&!a.isHTML5?a.position:a.position/1E3});return

a}a.paused?a.resume():a.pause();return

a};this.setPan=function(d,f){if(typeof d==="undefined")d=0;if(typeof

f==="undefined")f=false;a.isHTML5||b.o._setPan(a.sID,d);a._iO.pan=

d;if(!f)a.pan=d;return a};this.setVolume=function(d,f){if(typeof

d==="undefined")d=100;if(typeof

f==="undefined")f=false;if(a.isHTML5){if(a._a)a._a.volume=

d/100}else

b.o._setVolume(a.sID,b.muted&&!a.muted||a.muted?0:d);a._iO.volum

e=d;if(!f)a.volume=d;return

a};this.mute=function(){a.muted=true;if(a.isHTML5){if(a._a)a._a.mut

ed=true}else b.o._setVolume(a.sID,0);return

a};this.unmute=function(){a.muted=false;var d=typeof

a._iO.volume!=="undefined";if(a.isHTML5){if(a._a)a._a.muted=false

}else b.o._setVolume(a.sID,d?a._iO.volume:a.options.volume);return

a};this.toggleMute=function(){return

a.muted?a.unmute():a.mute()};this.onposition=function(d,f,i){a._onPo

sitionItems.push({position:d,

method:f,scope:typeof i!=="undefined"?i:a,fired:false});return

a};this.processOnPosition=function(){var

d,f;d=a._onPositionItems.length;if(!d||!a.playState||a._onPositionFired

>=d)return false;for(d=d;d--

;){f=a._onPositionItems[d];if(!f.fired&&a.position>=f.position){f.met

hod.apply(f.scope,[f.position]);f.fired=true;b._onPositionFired++}}ret

urn true};this.resetOnPosition=function(d){var

f,i;f=a._onPositionItems.length;if(!f)return false;for(f=f;f--

;){i=a._onPositionItems[f];if(i.fired&&d<=i.position){i.fired=

false;b._onPositionFired--}}return

true};this._onTimer=function(d){var

f={};if(a._hasTimer||d)if(a._a&&(d||(a.playState>0||a.readyState===1)

&&!a.paused)){a.duration=a._get_html5_duration();a.durationEstimat

e=a.duration;d=a._a.currentTime?a._a.currentTime*1E3:0;a._whilepla

ying(d,f,f,f,f);return true}else return

false};this._get_html5_duration=function(){var

d=a._a?a._a.duration*1E3:a._iO?a._iO.duration:undefined;return

d&&!isNaN(d)&&d!==Infinity?d:a._iO?a._iO.duration:null};e=functi

on(){a.isHTML5&&

ya(a)};h=function(){a.isHTML5&&za(a)};g=function(){a._onPosition

Items=[];a._onPositionFired=0;a._hasTimer=null;a._onplay_called=fal

se;a._a=null;a._html5_canplay=false;a.bytesLoaded=null;a.bytesTotal

=null;a.position=null;a.duration=a._iO&&a._iO.duration?a._iO.duratio

n:null;a.durationEstimate=null;a.failures=0;a.loaded=false;a.playState

=0;a.paused=false;a.readyState=0;a.muted=false;a.didBeforeFinish=fal

se;a.didJustBeforeFinish=false;a.isBuffering=false;a.instanceOptions=

{};a.instanceCount=0;a.peakData=

{left:0,right:0};a.waveformData={left:[],right:[]};a.eqData=[];a.eqDat

a.left=[];a.eqData.right=[]};g();this._setup_html5=function(d){d=s(a._i

O,d);var f=P?b._global_a:a._a;decodeURI(d.url);var

i=f&&f._t?f._t.instanceOptions:null;if(f){if(f._t&&i.url===d.url)return

f;P&&f._t.playState&&f._t&&d.url!==i.url&&f._t.stop();g();f.src=d.u

rl}else{f=new

Audio(d.url);if(P)b._global_a=f}f._called_load=false;a.isHTML5=true

;a._a=f;f._t=a;a._add_html5_events();f.loop=d.loops>1?"loop":"";if(d.

autoLoad||d.autoPlay){f.autobuffer=

"auto";f.preload="auto";a.load()}else{f.autobuffer=false;f.preload="no

ne"}f.loop=d.loops>1?"loop":"";return

f};this._add_html5_events=function(){if(a._a._added_events)return

false;var d;a._a._added_events=true;for(d in

b._html5_events)b._html5_events.hasOwnProperty(d)&&a._a&&a._a.

addEventListener(d,b._html5_events[d],false);return

true};this._remove_html5_events=function(){a._a._added_events=fals

e;for(var d in

b._html5_events)b._html5_events.hasOwnProperty(d)&&a._a&&a._a.

removeEventListener(d,b._html5_events[d],

false)};this._whileloading=function(d,f,i,m){a.bytesLoaded=d;a.bytes

Total=f;a.duration=Math.floor(i);a.bufferLength=m;if(a._iO.isMovieSt

ar)a.durationEstimate=a.duration;else{a.durationEstimate=a._iO.durati

on?a.duration>a._iO.duration?a.duration:a._iO.duration:parseInt(a.byt

esTotal/a.bytesLoaded*a.duration,10);if(a.durationEstimate===undefi

ned)a.durationEstimate=a.duration}a.readyState!==3&&a._iO.whilelo

ading&&a._iO.whileloading.apply(a)};this._onid3=function(d,f){var

i=[],m,n;m=0;for(n=d.length;m<

n;m++)i[d[m]]=f[m];a.id3=s(a.id3,i);a._iO.onid3&&a._iO.onid3.apply

(a)};this._whileplaying=function(d,f,i,m,n){if(isNaN(d)||d===null)retu

rn

false;if(a.playState===0&&d>0)d=0;a.position=d;a.processOnPosition

();if(l>8&&!a.isHTML5){if(a._iO.usePeakData&&typeof

f!=="undefined"&&f)a.peakData={left:f.leftPeak,right:f.rightPeak};if(

a._iO.useWaveformData&&typeof

i!=="undefined"&&i)a.waveformData={left:i.split(","),right:m.split(","

)};if(a._iO.useEQData)if(typeof

n!=="undefined"&&n&&n.leftEQ){d=n.leftEQ.split(",");

a.eqData=d;a.eqData.left=d;if(typeof

n.rightEQ!=="undefined"&&n.rightEQ)a.eqData.right=n.rightEQ.split

(",")}}if(a.playState===1){!a.isHTML5&&b.flashVersion===8&&!a.

position&&a.isBuffering&&a._onbufferchange(0);a._iO.whileplaying

&&a._iO.whileplaying.apply(a);if((a.loaded||!a.loaded&&a._iO.isMov

ieStar)&&a._iO.onbeforefinish&&a._iO.onbeforefinishtime&&!a.did

BeforeFinish&&a.duration-

a.position<=a._iO.onbeforefinishtime)a._onbeforefinish()}return

true};this._onconnect=function(d){d=d===1;if(a.connected=

d){a.failures=0;if(p(a.sID))if(a.getAutoPlay())a.play(undefined,a.getA

utoPlay());else

a._iO.autoLoad&&a.load();a._iO.onconnect&&a._iO.onconnect.apply

(a,[d])}};this._onload=function(d){d=d?true:false;a.loaded=d;a.readyS

tate=d?3:2;a._onbufferchange(0);a._iO.onload&&a._iO.onload.apply(a

,[d]);return

true};this._onfailure=function(d,f,i){a.failures++;a._iO.onfailure&&a.f

ailures===1&&a._iO.onfailure(a,d,f,i)};this._onbeforefinish=function(

){if(!a.didBeforeFinish){a.didBeforeFinish=true;a._iO.onbeforefinish

&&

a._iO.onbeforefinish.apply(a)}};this._onjustbeforefinish=function(){if(

!a.didJustBeforeFinish){a.didJustBeforeFinish=true;a._iO.onjustbefore

finish&&a._iO.onjustbeforefinish.apply(a)}};this._onfinish=function()

{var

d=a._iO.onfinish;a._onbufferchange(0);a.resetOnPosition(0);a._iO.onb

eforefinishcomplete&&a._iO.onbeforefinishcomplete.apply(a);a.didBe

foreFinish=false;a.didJustBeforeFinish=false;if(a.instanceCount){a.ins

tanceCount--

;if(!a.instanceCount){a.playState=0;a.paused=false;a.instanceCount=0;

a.instanceOptions=

{};a._iO={};h()}if(!a.instanceCount||a._iO.multiShotEvents)d&&d.ap

ply(a)}};this._onbufferchange=function(d){if(a.playState===0)return

false;if(d&&a.isBuffering||!d&&!a.isBuffering)return

false;a.isBuffering=d===1;a._iO.onbufferchange&&a._iO.onbuffercha

nge.apply(a);return

true};this._ondataerror=function(){a.playState>0&&a._iO.ondataerror

&&a._iO.ondataerror.apply(a)}};ga=function(){return

j.body?j.body:j._docElement?j.documentElement:j.getElementsByTag

Name("div")[0]};D=function(c){return j.getElementById(c)};

s=function(c,a){var g={},h,e;for(h in

c)if(c.hasOwnProperty(h))g[h]=c[h];h=typeof

a==="undefined"?b.defaultOptions:a;for(e in

h)if(h.hasOwnProperty(e)&&typeof

g[e]==="undefined")g[e]=h[e];return g};q=function(){function

c(e){e=Ia.call(e);var

d=e.length;if(g){e[1]="on"+e[1];d>3&&e.pop()}else

d===3&&e.push(false);return e}function a(e,d){var

f=e.shift(),i=[h[d]];g?f[i](e[0],e[1]):f[i].apply(f,e)}var

g=k.attachEvent,h={add:g?"attachEvent":"addEventListener",remove:

g?"detachEvent":"removeEventListener"};

return{add:function(){a(c(arguments),"add")},remove:function(){a(c(a

rguments),"remove")}}}();Z=function(c){return!c.serverURL&&(c.ty

pe?O({type:c.type}):O(c.url)||u)};O=function(c){if(!b.useHTML5Audi

o||!b.hasHTML5)return false;var a,g=b.audioFormats;if(!x){x=[];for(a

in

g)if(g.hasOwnProperty(a)){x.push(a);if(g[a].related)x=x.concat(g[a].re

lated)}x=RegExp("\\.("+x.join("|")+")","i")}a=typeof

c.type!=="undefined"?c.type:null;c=typeof

c==="string"?c.toLowerCase().match(x):null;if(!c||!c.length)if(a){c=

a.indexOf(";");c=(c!==-1?a.substr(0,c):a).substr(6)}else return

false;else c=c[0].substr(1);if(c&&typeof

b.html5[c]!=="undefined")return

b.html5[c];else{if(!a)if(c&&b.html5[c])return b.html5[c];else

a="audio/"+c;a=b.html5.canPlayType(a);return

b.html5[c]=a}};Ba=function(){function c(f){var

i,m,n=false;if(!a||typeof a.canPlayType!=="function")return false;if(f

instanceof

Array){i=0;for(m=f.length;i<m&&!n;i++)if(b.html5[f[i]]||a.canPlayTy

pe(f[i]).match(b.html5Test)){n=true;b.html5[f[i]]=true}return n}else

return(f=

a&&typeof

a.canPlayType==="function"?a.canPlayType(f):false)&&(f.match(b.ht

ml5Test)?true:false)}if(!b.useHTML5Audio||typeof

Audio==="undefined")return false;var a=typeof

Audio!=="undefined"?new

Audio(null):null,g,h={},e,d;H();e=b.audioFormats;for(g in

e)if(e.hasOwnProperty(g)){h[g]=c(e[g].type);if(e[g]&&e[g].related)for

(d=e[g].related.length;d--

;)b.html5[e[g].related[d]]=h[g]}h.canPlayType=a?c:null;b.html5=s(b.h

tml5,h);return

true};B=function(){};W=function(c){if(l===8&&c.loops>1&&c.strea

m)c.stream=

false;return

c};X=function(c){if(c&&!c.usePolicyFile&&(c.onid3||c.usePeakData||

c.useWaveformData||c.useEQData))c.usePolicyFile=true;return

c};ka=function(c){typeof console!=="undefined"&&typeof

console.warn!=="undefined"&&console.warn(c)};ba=function(){retur

n false};wa=function(c){for(var a in

c)if(c.hasOwnProperty(a)&&typeof

c[a]==="function")c[a]=ba};V=function(c){if(typeof

c==="undefined")c=false;if(y||c)b.disable(c)};xa=function(c){var

a=null;if(c)if(c.match(/\.swf(\?.*)?$/i)){if(a=c.substr(c.toLowerCase().

lastIndexOf(".swf?")+

4))return c}else if(c.lastIndexOf("/")!==c.length-

1)c+="/";return(c&&c.lastIndexOf("/")!==-

1?c.substr(0,c.lastIndexOf("/")+1):"./")+b.movieURL};ea=function(){i

f(l!==8&&l!==9)b.flashVersion=8;var

c=b.debugMode||b.debugFlash?"_debug.swf":".swf";if(b.useHTML5A

udio&&!u&&b.audioFormats.mp4.required&&b.flashVersion<9)b.fla

shVersion=9;l=b.flashVersion;b.version=b.versionNumber+(u?"

(HTML5-only mode)":l===9?" (AS3/Flash 9)":" (AS2/Flash

8)");if(l>8){b.defaultOptions=s(b.defaultOptions,b.flash9Options);b.fe

atures.buffering=

true}if(l>8&&b.useMovieStar){b.defaultOptions=s(b.defaultOptions,b

.movieStarOptions);b.filePatterns.flash9=RegExp("\\.(mp3|"+b.netStre

amTypes.join("|")+")(\\?.*)?$","i");b.mimePattern=b.netStreamMimeT

ypes;b.features.movieStar=true}else{b.useMovieStar=false;b.features.

movieStar=false}b.filePattern=b.filePatterns[l!==8?"flash9":"flash8"];

b.movieURL=(l===8?"soundmanager2.swf":"soundmanager2_flash9.s

wf").replace(".swf",c);b.features.peakData=b.features.waveformData=

b.features.eqData=l>8};va=function(c,

a){if(!b.o||!b.allowPolling)return

false;b.o._setPolling(c,a)};U=function(c,a){var

g=a?a:b.url,h=b.altURL?b.altURL:g,e;e=ga();var

d,f,i=G(),m,n=null;n=(n=j.getElementsByTagName("html")[0])&&n.d

ir&&n.dir.match(/rtl/i);c=typeof

c==="undefined"?b.id:c;if(J&&K)return

false;if(u){ea();b.oMC=D(b.movieID);S();K=J=true;return

false}J=true;ea();b.url=xa(b._overHTTP?g:h);a=b.url;b.wmode=!b.wm

ode&&b.useHighPerformance&&!b.useMovieStar?"transparent":b.w

mode;if(b.wmode!==null&&(t.match(/msie

8/i)||!v&&!b.useHighPerformance)&&

navigator.platform.match(/win32|win64/i)){b.specialWmodeCase=true

;b.wmode=null}e={name:c,id:c,src:a,width:"100%",height:"100%",qu

ality:"high",allowScriptAccess:b.allowScriptAccess,bgcolor:b.bgColor

,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"a

pplication/x-shockwave-

flash",wmode:b.wmode,hasPriority:"true"};if(b.debugFlash)e.FlashVar

s="debug=1";b.wmode||delete

e.wmode;if(v){g=j.createElement("div");f='<object id="'+c+'"

data="'+a+'" type="'+e.type+'" classid="clsid:D27CDB6E-AE6D-11cf-

96B8-444553540000"

codebase="http://download.macromedia.com/pub/shockwave/cabs/flas

h/swflash.cab#version=6,0,40,0" width="'+

e.width+'" height="'+e.height+'"><param name="movie"

value="'+a+'" /><param name="AllowScriptAccess"

value="'+b.allowScriptAccess+'" /><param name="quality"

value="'+e.quality+'" />'+(b.wmode?'<param name="wmode"

value="'+b.wmode+'" /> ':"")+'<param name="bgcolor"

value="'+b.bgColor+'" />'+(b.debugFlash?'<param name="FlashVars"

value="'+e.FlashVars+'"

/>':"")+"</object>"}else{g=j.createElement("embed");for(d in

e)e.hasOwnProperty(d)&&g.setAttribute(d,e[d])}ra();i=G();if(e=ga()){

b.oMC=D(b.movieID)?

D(b.movieID):j.createElement("div");if(b.oMC.id){m=b.oMC.classNa

me;b.oMC.className=(m?m+" ":b.swfCSS.swfDefault)+(i?"

"+i:"");b.oMC.appendChild(g);if(v){d=b.oMC.appendChild(j.createEl

ement("div"));d.className=b.swfCSS.swfBox;d.innerHTML=f}K=tru

e}else{b.oMC.id=b.movieID;b.oMC.className=b.swfCSS.swfDefault

+"

"+i;d=i=null;if(!b.useFlashBlock)if(b.useHighPerformance)i={position

:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"h

idden"};else{i={position:"absolute",width:"6px",height:"6px",

top:"-9999px",left:"-

9999px"};if(n)i.left=Math.abs(parseInt(i.left,10))+"px"}if(Ka)b.oMC.s

tyle.zIndex=1E4;if(!b.debugFlash)for(m in

i)if(i.hasOwnProperty(m))b.oMC.style[m]=i[m];try{v||b.oMC.append

Child(g);e.appendChild(b.oMC);if(v){d=b.oMC.appendChild(j.createE

lement("div"));d.className=b.swfCSS.swfBox;d.innerHTML=f}K=tr

ue}catch(La){throw Error(B("appXHTML"));}}}return

true};p=this.getSoundById;M=function(){if(u){U();return

false}if(b.o)return

false;b.o=b.getMovie(b.id);if(!b.o){if(N){if(v)b.oMC.innerHTML=

ia;else b.oMC.appendChild(N);N=null;J=true}else

U(b.id,b.url);b.o=b.getMovie(b.id)}b.oninitmovie instanceof

Function&&setTimeout(b.oninitmovie,1);return

true};da=function(c){if(c)b.url=c;M()};T=function(){setTimeout(ta,50

0)};ta=function(){if(Y)return

false;Y=true;q.remove(k,"load",T);if(I&&!pa)return false;var

c;r||(c=b.getMoviePercent());setTimeout(function(){c=b.getMoviePerc

ent();if(!r&&Ea)if(c===null)if(b.useFlashBlock||b.flashLoadTimeout=

==0)b.useFlashBlock&&ja();else V(true);else b.flashLoadTimeout!==

0&&V(true)},b.flashLoadTimeout)};da=function(c){if(c)b.url=c;M()};

G=function(){var

c=[];b.debugMode&&c.push(b.swfCSS.sm2Debug);b.debugFlash&&c

.push(b.swfCSS.flashDebug);b.useHighPerformance&&c.push(b.swfC

SS.highPerf);return c.join(" ")};ja=function(){B("fbHandler");var

c=b.getMoviePercent(),a=b.swfCSS;if(b.ok()){if(b.oMC)b.oMC.class

Name=[G(),a.swfDefault,a.swfLoaded+(b.didFlashBlock?"

"+a.swfUnblocked:"")].join(" ")}else{if(C)b.oMC.className=G()+"

"+a.swfDefault+" "+(c===null?a.swfTimedout:a.swfError);

b.didFlashBlock=true;z({type:"ontimeout",ignoreInit:true});b.onerror

instanceof Function&&b.onerror.apply(k)}};A=function(){function

c(){q.remove(k,"focus",A);q.remove(k,"load",A)}if(pa||!I){c();return

true}pa=Ea=true;Q&&I&&q.remove(k,"mousemove",A);Y=false;c();r

eturn true};L=function(c){if(r)return false;if(u){r=true;z();E();return

true}b.useFlashBlock&&b.flashLoadTimeout&&!b.getMoviePercent()

||(r=true);if(y||c){if(b.useFlashBlock)b.oMC.className=G()+"

"+(b.getMoviePercent()===null?b.swfCSS.swfTimedout:

b.swfCSS.swfError);z({type:"ontimeout"});b.onerror instanceof

Function&&b.onerror.apply(k);return

false}q.add(k,"unload",ba);if(b.waitForWindowLoad&&!sa){q.add(k,"

load",E);return false}else E();return true};ca=function(c,a,g){if(typeof

w[c]==="undefined")w[c]=[];w[c].push({method:a,scope:g||null,fired:f

alse})};z=function(c){c||(c={type:"onready"});if(!r&&c&&!c.ignoreIn

it)return false;var

a={success:c&&c.ignoreInit?b.ok():!y},g=c&&c.type?w[c.type]||[]:[];c

=[];var h,e=C&&b.useFlashBlock&&!b.ok();for(h=

0;h<g.length;h++)g[h].fired!==true&&c.push(g[h]);if(c.length){h=0;fo

r(g=c.length;h<g;h++){c[h].scope?c[h].method.apply(c[h].scope,[a]):c

[h].method(a);if(!e)c[h].fired=true}}return

true};E=function(){k.setTimeout(function(){b.useFlashBlock&&ja();z

();b.onload instanceof

Function&&b.onload.apply(k);b.waitForWindowLoad&&q.add(k,"loa

d",E)},1)};H=function(){if(na!==undefined)return na;var

c=false,a=navigator,g=a.plugins,h,e=k.ActiveXObject;if(g&&g.length)

{if((a=a.mimeTypes)&&a["application/x-shockwave-flash"]&&

a["application/x-shockwave-flash"].enabledPlugin&&a["application/x-

shockwave-flash"].enabledPlugin.description)c=true}else if(typeof

e!=="undefined"){try{h=new

e("ShockwaveFlash.ShockwaveFlash")}catch(d){}c=!!h}return

na=c};Aa=function(){var c,a;if(t.match(/iphone os

(1|2|3_0|3_1)/i)?true:false){b.hasHTML5=false;u=true;if(b.oMC)b.oM

C.style.display="none";return

false}if(b.useHTML5Audio){if(!b.html5||!b.html5.canPlayType){b.ha

sHTML5=false;return true}else b.hasHTML5=true;if(oa)if(H())return

true}else return true;

for(a in

b.audioFormats)if(b.audioFormats.hasOwnProperty(a)&&b.audioForm

ats[a].required&&!b.html5.canPlayType(b.audioFormats[a].type))c=tr

ue;if(b.ignoreFlash)c=false;u=b.useHTML5Audio&&b.hasHTML5&

&!c&&!b.requireFlash;return H()&&c};S=function(){var

c,a=[];if(r)return false;if(b.hasHTML5)for(c in

b.audioFormats)b.audioFormats.hasOwnProperty(c)&&a.push(c+":

"+b.html5[c]);if(u){if(!r){q.remove(k,"load",b.beginDelayedInit);b.ena

bled=true;L()}return

true}M();try{b.o._externalInterfaceTest(false);if(b.allowPolling)va(tru

e,

b.flashPollingInterval?b.flashPollingInterval:b.useFastPolling?10:50);

b.debugMode||b.o._disableDebug();b.enabled=true}catch(g){V(true);L

();return false}L();q.remove(k,"load",b.beginDelayedInit);return

true};ua=function(){if(la)return false;U();M();return

la=true};F=function(){if(fa)return

false;fa=true;ra();if(!b.useHTML5Audio)if(!H())b.useHTML5Audio=t

rue;Ba();b.html5.usingFlash=Aa();C=b.html5.usingFlash;fa=true;j.rem

oveEventListener&&j.removeEventListener("DOMContentLoaded",F,

false);da();return true};

ya=function(c){if(!c._hasTimer)c._hasTimer=true};za=function(c){if(

c._hasTimer)c._hasTimer=false};ha=function(){b.onerror instanceof

Function&&b.onerror();b.disable()};Ca=function(){if(!oa||!H())return

false;var c=b.audioFormats,a,g;for(g in

c)if(c.hasOwnProperty(g))if(g==="mp3"||g==="mp4"){b.html5[g]=fal

se;if(c[g]&&c[g].related)for(;a--

;)b.html5[c[g].related[a]]=false}};this._setSandboxType=function(){};

this._externalInterfaceOK=function(){if(b.swfLoaded)return

false;(new Date).getTime();b.swfLoaded=

true;I=false;oa&&Ca();v?setTimeout(S,100):S()};ma=function(){if(j.r

eadyState==="complete"){F();j.detachEvent("onreadystatechange",ma

)}return

true};if(!b.hasHTML5||C){q.add(k,"focus",A);q.add(k,"load",A);q.add

(k,"load",T);Q&&I&&q.add(k,"mousemove",A)}if(j.addEventListener

)j.addEventListener("DOMContentLoaded",F,false);else

j.attachEvent?j.attachEvent("onreadystatechange",ma):ha();j.readyStat

e==="complete"&&setTimeout(F,100)}var Fa=null;if(typeof

SM2_DEFER==="undefined"||!SM2_DEFER)Fa=new

qa;$.SoundManager=

qa;$.soundManager=Fa})(window);