﻿(function(a){function c(B,S){function V(){if(c.debugURLParam.test(C))c.debugMode=true}this.flashVersion=8;this.debugFlash=this.debugMode=false;this.useConsole=true;this.waitForWindowLoad=this.consoleOnly=false;this.nullURL="about:blank";this.allowPolling=true;this.useFastPolling=false;this.useMovieStar=true;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=1e3;this.wmode=null;this.allowFullScreen=true;this.allowScriptAccess="always";this.useHTML5Audio=this.useFlashBlock=false;this.html5Test=/^probably$/i;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:true,autoPlay:false,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5e3,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,multiShotEvents:false,position:null,pan:0,type:null,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:3,serverURL:null,onconnect:null};this.version=null;this.versionNumber="V2.96a.20100624";this.movieURL=null;this.url=B||null;this.altURL=null;this.enabled=this.swfLoaded=false;this.o=null;this.movieID="sm2-container";this.id=S||"sm2movie";this.swfCSS={swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"};this.oMC=null;this.sounds={};this.soundIDs=[];this.isFullScreen=this.muted=false;this.isIE=navigator.userAgent.match(/MSIE/i);this.isSafari=navigator.userAgent.match(/safari/i);this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.didFlashBlock=this.specialWmodeCase=false;this.filePattern=null;this.filePatterns={flash8:/\.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","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.mimePattern=this.baseMimeTypes;this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null};this.hasHTML5=null;this.html5={usingFlash:null};this.ignoreFlash=false;var T,c=this,p,q=navigator.userAgent,C=a.location.href.toString(),d=this.flashVersion,W,D,r=[],s=false,t=false,f=false,i=false,X=false,u,g,Y,l,m,Z,U,R,j,ab,E,F,v,K,bb,G,cb,db,w,eb,x=null,L=null,y,M,z,H,N,e,I=false,O=false,fb,gb,n=null,hb,J,k=false,A,h,P,ib;B=q.match(/pre\//i);S=q.match(/(ipad|iphone)/i);q.match(/mobile/i);var Q=typeof document.hasFocus!=="undefined"?document.hasFocus():null,o=typeof document.hasFocus==="undefined"&&this.isSafari,jb=!o;this._use_maybe=C.match(/sm2\-useHTML5Maybe\=1/i);this._overHTTP=document.location?document.location.protocol.match(/http/i):null;this.useAltURL=!this._overHTTP;if(S||B){c.useHTML5Audio=true;c.ignoreFlash=true}if(B||this._use_maybe)c.html5Test=/^(probably|maybe)$/i;this.supported=function(){return n?f&&!i:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(b){return c.isIE?a[b]:c.isSafari?p(b)||document[b]:p(b)};this.loadFromXML=function(a){try{c.o._loadFromXML(a)}catch(b){w();return true}};this.createSound=function(j){function i(){h=H(h);c.sounds[a.id]=new T(a);c.soundIDs.push(a.id);return c.sounds[a.id]}var h=null,b=null,a=null;if(!f)throw N("soundManager.createSound(): "+y("notReady"),arguments.callee.caller);if(arguments.length===2)j={id:arguments[0],url:arguments[1]};a=h=g(j);if(e(a.id,true))return c.sounds[a.id];if(J(a)){b=i();b._setup_html5(a)}else{if(d>8&&c.useMovieStar){if(a.isMovieStar===null)a.isMovieStar=a.serverURL||(a.type?a.type.match(c.netStreamPattern):false)||a.url.match(c.netStreamPattern)?true:false;if(a.isMovieStar)if(a.usePeakData)a.usePeakData=false}b=i();if(d===8)c.o._createSound(a.id,a.onjustbeforefinishtime,a.loops||1);else{c.o._createSound(a.id,a.url,a.onjustbeforefinishtime,a.usePeakData,a.useWaveformData,a.useEQData,a.isMovieStar,a.isMovieStar?a.useVideo:false,a.isMovieStar?a.bufferTime:false,a.loops||1,a.serverURL,a.duration||null,a.totalBytes||null,a.autoPlay,true);if(!a.serverURL){b.connected=true;a.onconnect&&a.onconnect.apply(b)}}}if(a.autoLoad||a.autoPlay)if(b)if(c.isHTML5){b.autobuffer="auto";b.preload="auto"}else b.load(a);a.autoPlay&&b.play();return b};this.createVideo=function(a){if(arguments.length===2)a={id:arguments[0],url:arguments[1]};if(d>=9){a.isMovieStar=true;a.useVideo=true}else return false;return c.createSound(a)};this.destroyVideo=this.destroySound=function(a,d){if(!e(a))return false;for(var b=0;b<c.soundIDs.length;b++)c.soundIDs[b]===a&&c.soundIDs.splice(b,1);c.sounds[a].unload();d||c.sounds[a].destruct();delete c.sounds[a]};this.load=function(a,b){return!e(a)?false:c.sounds[a].load(b)};this.unload=function(a){return!e(a)?false:c.sounds[a].unload()};this.start=this.play=function(b,a){if(!f)throw N("soundManager.play(): "+y("notReady"),arguments.callee.caller);if(!e(b)){a instanceof Object||(a={url:a});if(a&&a.url){a.id=b;return c.createSound(a).play()}else return false}return c.sounds[b].play(a)};this.setPosition=function(a,b){return!e(a)?false:c.sounds[a].setPosition(b)};this.stop=function(a){return!e(a)?false:c.sounds[a].stop()};this.stopAll=function(){for(var a in c.sounds)c.sounds[a]instanceof T&&c.sounds[a].stop()};this.pause=function(a){return!e(a)?false:c.sounds[a].pause()};this.pauseAll=function(){for(var a=c.soundIDs.length;a--;)c.sounds[c.soundIDs[a]].pause()};this.resume=function(a){return!e(a)?false:c.sounds[a].resume()};this.resumeAll=function(){for(var a=c.soundIDs.length;a--;)c.sounds[c.soundIDs[a]].resume()};this.togglePause=function(a){return!e(a)?false:c.sounds[a].togglePause()};this.setPan=function(a,b){return!e(a)?false:c.sounds[a].setPan(b)};this.setVolume=function(a,b){return!e(a)?false:c.sounds[a].setVolume(b)};this.mute=function(a){var b=0;if(typeof a!=="string")a=null;if(a)return!e(a)?false:c.sounds[a].mute();else{for(b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].mute();c.muted=true}};this.muteAll=function(){c.mute()};this.unmute=function(a){if(typeof a!=="string")a=null;if(a)return!e(a)?false:c.sounds[a].unmute();else{for(a=c.soundIDs.length;a--;)c.sounds[c.soundIDs[a]].unmute();c.muted=false}};this.unmuteAll=function(){c.unmute()};this.toggleMute=function(a){return!e(a)?false:c.sounds[a].toggleMute()};this.getMemoryUse=function(){return d===8?0:c.o?parseInt(c.o._getMemoryUse(),10):void 0};this.disable=function(b){if(typeof b==="undefined")b=false;if(i)return false;i=true;for(var d=c.soundIDs.length;d--;)db(c.sounds[c.soundIDs[d]]);u(b);a.removeEventListener&&a.removeEventListener("load",m,false)};this.canPlayMIME=function(b){var a;if(c.hasHTML5)a=A({type:b});return!n||a?a:b?b.match(c.mimePattern)?true:false:null};this.canPlayURL=function(b){var a;if(c.hasHTML5)a=A(b);return!n||a?a:b?b.match(c.filePattern)?true:false:null};this.canPlayLink=function(a){if(typeof a.type!=="undefined"&&a.type)if(c.canPlayMIME(a.type))return true;return c.canPlayURL(a.href)};this.getSoundById=function(a){if(!a)throw new Error("SoundManager.getSoundById(): sID is null/undefined");return c.sounds[a]};this.onready=function(c,b){if(c&&c instanceof Function){b||(b=a);Y(c,b);l();return true}else throw y("needFunction");};this.oninitmovie=function(){};this.onload=function(){};this.onerror=function(){};this.getMoviePercent=function(){return c.o&&typeof c.o.PercentLoaded!=="undefined"?c.o.PercentLoaded():null};this._wD=this._writeDebug=function(){};this._debug=function(){};this.reboot=function(){for(var b=c.soundIDs.length;b--;)c.sounds[c.soundIDs[b]].destruct();try{if(c.isIE)L=c.o.innerHTML;x=c.o.parentNode.removeChild(c.o)}catch(d){}x=L=null;i=t=s=O=I=f=c.enabled=false;c.swfLoaded=false;c.soundIDs={};c.sounds=[];c.o=null;for(b=r.length;b--;)r[b].fired=false;a.setTimeout(function(){c.beginDelayedInit()},20)};this.destruct=function(){c.disable(true)};this.beginDelayedInit=function(){X=true;v();setTimeout(U,500);setTimeout(ab,20)};J=function(a){return(a.type?A({type:a.type}):false)||A(a.url)};A=function(a){if(!c.useHTML5Audio||!c.hasHTML5)return false;var b,d=c.audioFormats;if(!h){h=[];for(b in d)if(d.hasOwnProperty(b)){h.push(b);if(d[b].related)h=h.concat(d[b].related)}h=new RegExp("\\.("+h.join("|")+")","i")}b=typeof a.type!=="undefined"?a.type:null;a=typeof a==="string"?a.toLowerCase().match(h):null;if(!a||!a.length){if(!b)return false}else a=a[0].substr(1);if(a&&typeof c.html5[a]!=="undefined")return c.html5[a];else{if(!b)if(a&&c.html5[a])return c.html5[a];else b="audio/"+a;b=c.html5.canPlayType(b);return c.html5[a]=b}};ib=function(){function h(a){var b,f,e=false;if(!d||typeof d.canPlayType!=="function")return false;if(a instanceof Array){b=0;for(f=a.length;b<f&&!e;b++)if(c.html5[a[b]]||d.canPlayType(a[b]).match(c.html5Test)){e=true;c.html5[a[b]]=true}return e}else return(a=d&&typeof d.canPlayType==="function"?d.canPlayType(a):false)&&(a.match(c.html5Test)?true:false)}if(!c.useHTML5Audio||typeof Audio==="undefined")return false;var d=typeof Audio!=="undefined"?new Audio:null,a,e={},b,f;b=c.audioFormats;for(a in b)if(b.hasOwnProperty(a)){e[a]=h(b[a].type);if(b[a]&&b[a].related)for(f=0;f<b[a].related.length;f++)c.html5[b[a].related[f]]=e[a]}e.canPlayType=d?h:null;c.html5=g(c.html5,e)};E={};p=function(a){return document.getElementById(a)};y=function(){var b=Array.prototype.slice.call(arguments),a=b.shift();a=E&&E[a]?E[a]:"";var c,d;if(a&&b&&b.length){c=0;for(d=b.length;c<d;c++)a=a.replace("%s",b[c])}return a};H=function(a){if(d===8&&a.loops>1&&a.stream)a.stream=false;return a};N=function(a,b){if(!b)return new Error("Error: "+a);typeof console!=="undefined"&&typeof console.trace!=="undefined"&&console.trace();a="Error: "+a+". \nCaller: "+b.toString();return new Error(a)};W=function(){return false};db=function(a){for(var b in a)if(a.hasOwnProperty(b)&&typeof a[b]==="function")a[b]=W};w=function(a){if(typeof a==="undefined")a=false;(i||a)&&c.disable(a)};eb=function(a){var b=null;if(a)if(a.match(/\.swf(\?\.*)?$/i)){if(b=a.substr(a.toLowerCase().lastIndexOf(".swf?")+4))return a}else if(a.lastIndexOf("/")!==a.length-1)a+="/";return(a&&a.lastIndexOf("/")!==-1?a.substr(0,a.lastIndexOf("/")+1):"./")+c.movieURL};R=function(){if(d!==8&&d!==9)c.flashVersion=8;var a=c.debugMode||c.debugFlash?"_debug.swf":".swf";if(c.flashVersion<9&&c.useHTML5Audio&&c.audioFormats.mp4.required)c.flashVersion=9;d=c.flashVersion;c.version=c.versionNumber+(k?" (HTML5-only mode)":d===9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(d>8){c.defaultOptions=g(c.defaultOptions,c.flash9Options);c.features.buffering=true}if(d>8&&c.useMovieStar){c.defaultOptions=g(c.defaultOptions,c.movieStarOptions);c.filePatterns.flash9=new RegExp("\\.(mp3|"+c.netStreamTypes.join("|")+")(\\?.*)?$","i");c.mimePattern=c.netStreamMimeTypes;c.features.movieStar=true}else c.features.movieStar=false;c.filePattern=c.filePatterns[d!==8?"flash9":"flash8"];c.movieURL=(d===8?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",a);c.features.peakData=c.features.waveformData=c.features.eqData=d>8};bb=function(){return document.body?document.body:document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]};cb=function(b,a){if(!c.o||!c.allowPolling)return false;c.o._setPolling(b,a)};G=function(f,e){function i(){}var g=null;g=e?e:c.url;e=c.altURL?c.altURL:g;var a,b,h;f=typeof f==="undefined"?c.id:f;if(s&&t)return false;if(k){R();i();c.oMC=p(c.movieID);D();t=s=true;return false}s=true;R();c.url=eb(this._overHTTP?g:e);e=c.url;if(c.useHighPerformance&&c.useMovieStar&&c.defaultOptions.useVideo===true){g="soundManager note: disabling highPerformance, not applicable with movieStar mode+useVideo";c.useHighPerformance=false}c.wmode=!c.wmode&&c.useHighPerformance&&!c.useMovieStar?"transparent":c.wmode;if(c.wmode!==null&&!c.isIE&&!c.useHighPerformance&&navigator.platform.match(/win32/i)){c.specialWmodeCase=true;c.wmode=null}if(d===8)c.allowFullScreen=false;a={name:f,id:f,src:e,width:"100%",height:"100%",quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:c.wmode,allowfullscreen:c.allowFullScreen?"true":"false"};if(c.debugFlash)a.FlashVars="debug=1";c.wmode||delete a.wmode;if(c.isIE){g=document.createElement("div");h='<object id="'+f+'" data="'+e+'" type="'+a.type+'" width="'+a.width+'" height="'+a.height+'"><param name="movie" value="'+e+'" /><param name="AllowScriptAccess" value="'+c.allowScriptAccess+'" /><param name="quality" value="'+a.quality+'" />'+(c.wmode?'<param name="wmode" value="'+c.wmode+'" /> ':"")+'<param name="bgcolor" value="'+c.bgColor+'" /><param name="allowFullScreen" value="'+a.allowFullScreen+'" />'+(c.debugFlash?'<param name="FlashVars" value="'+a.FlashVars+'" />':"")+"<!-- --></object>"}else{g=document.createElement("embed");for(b in a)a.hasOwnProperty(b)&&g.setAttribute(b,a[b])}V();b=z();if(f=bb()){c.oMC=p(c.movieID)?p(c.movieID):document.createElement("div");if(c.oMC.id){f=c.oMC.className;c.oMC.className=(f?f+" ":c.swfCSS.swfDefault)+(b?" "+b:"");c.oMC.appendChild(g);if(c.isIE){b=c.oMC.appendChild(document.createElement("div"));b.className="sm2-object-box";b.innerHTML=h}t=true}else{c.oMC.id=c.movieID;c.oMC.className=c.swfCSS.swfDefault+" "+b;b=e=null;c.useFlashBlock||(e=c.useHighPerformance?{position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:{position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"});a=null;if(!c.debugFlash)for(a in e)if(e.hasOwnProperty(a))c.oMC.style[a]=e[a];try{c.isIE||c.oMC.appendChild(g);f.appendChild(c.oMC);if(c.isIE){b=c.oMC.appendChild(document.createElement("div"));b.className="sm2-object-box";b.innerHTML=h}t=true}catch(j){throw new Error(y("appXHTML"));}}}i()};e=this.getSoundById;g=function(a,f){var d={},e,b;for(e in a)if(a.hasOwnProperty(e))d[e]=a[e];a=typeof f==="undefined"?c.defaultOptions:f;for(b in a)if(a.hasOwnProperty(b)&&typeof d[b]==="undefined")d[b]=a[b];return d};F=function(){if(k){G();return false}if(c.o)return false;c.o=c.getMovie(c.id);if(!c.o){if(x){if(c.isIE)c.oMC.innerHTML=L;else c.oMC.appendChild(x);x=null;s=true}else G(c.id,c.url);c.o=c.getMovie(c.id)}typeof c.oninitmovie==="function"&&setTimeout(c.oninitmovie,1)};Z=function(a){if(a)c.url=a;F()};U=function(){if(I)return false;I=true;if(o&&!Q)return false;var a;f||(a=c.getMoviePercent());setTimeout(function(){a=c.getMoviePercent();if(!f&&jb)if(a===null)if(c.useFlashBlock||c.flashLoadTimeout===0)c.useFlashBlock&&M();else w(true);else c.flashLoadTimeout!==0&&w(true)},c.flashLoadTimeout)};z=function(){var a=[];c.debugMode&&a.push(c.swfCSS.sm2Debug);c.debugFlash&&a.push(c.swfCSS.flashDebug);c.useHighPerformance&&a.push(c.swfCSS.highPerf);return a.join(" ")};M=function(){var b=c.getMoviePercent();if(c.supported()){if(c.oMC)c.oMC.className=z()+" "+c.swfCSS.swfDefault+(" "+c.swfCSS.swfUnblocked)}else{if(n)c.oMC.className=z()+" "+c.swfCSS.swfDefault+" "+(b===null?c.swfCSS.swfTimedout:c.swfCSS.swfError);c.didFlashBlock=true;l(true);c.onerror instanceof Function&&c.onerror.apply(a)}};j=function(){if(Q||!o)return true;Q=jb=true;o&&a.removeEventListener("mousemove",j,false);I=false;setTimeout(U,500);if(a.removeEventListener)a.removeEventListener("focus",j,false);else a.detachEvent&&a.detachEvent("onfocus",j)};u=function(b){if(f)return false;if(k){f=true;l();m();return true}c.useFlashBlock&&c.flashLoadTimeout&&!c.getMoviePercent()||(f=true);if(i||b){if(c.useFlashBlock)c.oMC.className=z()+" "+(c.getMoviePercent()===null?c.swfCSS.swfTimedout:c.swfCSS.swfError);l();c.onerror instanceof Function&&c.onerror.apply(a);return false}if(c.waitForWindowLoad&&!X){if(a.addEventListener)a.addEventListener("load",m,false);else a.attachEvent&&a.attachEvent("onload",m);return false}else m()};Y=function(b,a){r.push({method:b,scope:a||null,fired:false})};l=function(d){if(!f&&!d)return false;d={success:d?c.supported():!i};var b=[],a,e,g=!c.useFlashBlock||c.useFlashBlock&&!c.supported();a=0;for(e=r.length;a<e;a++)r[a].fired!==true&&b.push(r[a]);if(b.length){a=0;for(e=b.length;a<e;a++){b[a].scope?b[a].method.apply(b[a].scope,[d]):b[a].method(d);if(!g)b[a].fired=true}}};m=function(){a.setTimeout(function(){c.useFlashBlock&&M();l();c.onload.apply(a)},1)};hb=function(){var b,a,d=!C.match(/usehtml5audio/i)&&!C.match(/sm2\-ignorebadua/i)&&c.isSafari&&q.match(/OS X 10_6_(3|4)/i)&&q.match(/(531\.22\.7|533\.16)/i);if(q.match(/iphone os (1|2|3_0|3_1)/i)?true:false){c.hasHTML5=false;k=true;if(c.oMC)c.oMC.style.display="none";return false}if(c.useHTML5Audio){if(!c.html5||!c.html5.canPlayType){c.hasHTML5=false;return true}else c.hasHTML5=true;if(d){c.useHTML5Audio=false;c.hasHTML5=false;return true}}else return true;for(a in c.audioFormats)if(c.audioFormats.hasOwnProperty(a))if(c.audioFormats[a].required&&!c.html5.canPlayType(c.audioFormats[a].type))b=true;if(c.ignoreFlash)b=false;k=c.useHTML5Audio&&c.hasHTML5&&!b;return b};D=function(){function d(){if(a.removeEventListener)a.removeEventListener("load",c.beginDelayedInit,false);else a.detachEvent&&a.detachEvent("onload",c.beginDelayedInit)}var b,e=[];if(f)return false;if(c.hasHTML5)for(b in c.audioFormats)c.audioFormats.hasOwnProperty(b)&&e.push(b+": "+c.html5[b]);if(k){if(!f){d();c.enabled=true;u()}return true}F();try{c.o._externalInterfaceTest(false);c.allowPolling&&cb(true,c.useFastPolling?true:false);c.debugMode||c.o._disableDebug();c.enabled=true}catch(g){w(true);u();return false}u();d()};ab=function(){if(O)return false;G();F();return O=true};v=function(){if(K)return false;K=true;V();ib();c.html5.usingFlash=hb();n=c.html5.usingFlash;K=true;Z()};fb=function(a){if(!a._hasTimer)a._hasTimer=true};gb=function(a){if(a._hasTimer)a._hasTimer=false};this._setSandboxType=function(b){var a=c.sandbox;a.type=b;a.description=a.types[typeof a.types[b]!=="undefined"?b:"unknown"];if(a.type==="localWithFile"){a.noRemote=true;a.noLocal=false}else if(a.type==="localWithNetwork"){a.noRemote=false;a.noLocal=true}else if(a.type==="localTrusted"){a.noRemote=false;a.noLocal=false}};this._externalInterfaceOK=function(){if(c.swfLoaded)return false;(new Date).getTime();c.swfLoaded=true;o=false;c.isIE?setTimeout(D,100):D()};this._onfullscreenchange=function(b){c.isFullScreen=b===1?true:false;if(!c.isFullScreen)try{a.focus()}catch(d){}};T=function(i){var a=this,j,k,e,f,h,b;this.sID=i.id;this.url=i.url;this._iO=this.instanceOptions=this.options=g(i);this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this.isHTML5=false;this.id3={};this._debug=function(){};this._debug();this.load=function(b){if(typeof b!=="undefined"){a._iO=g(b);a.instanceOptions=a._iO}else{b=a.options;a._iO=b;a.instanceOptions=a._iO;if(a._lastURL&&a._lastURL!==a.url){a._iO.url=a.url;a.url=null}}if(typeof a._iO.url==="undefined")a._iO.url=a.url;if(a._iO.url===a.url&&a.readyState!==0&&a.readyState!==2)return a;a.url=a._iO.url;a._lastURL=a._iO.url;a.loaded=false;a.readyState=1;a.playState=0;if(J(a._iO)){a._setup_html5(a._iO);a._iO.autoPlay&&a.play()}else try{a.isHTML5=false;a._iO=H(a._iO);if(d===8)c.o._load(a.sID,a._iO.url,a._iO.stream,a._iO.autoPlay,a._iO.whileloading?1:0,a._iO.loops||1);else{c.o._load(a.sID,a._iO.url,a._iO.stream?true:false,a._iO.autoPlay?true:false,a._iO.loops||1);a._iO.isMovieStar&&a._iO.autoLoad&&!a._iO.autoPlay&&a.pause()}}catch(e){c.onerror();c.disable()}return a};this.unload=function(){if(a.readyState!==0){a.readyState!==2&&a.setPosition(0,true);if(a.isHTML5){e();if(b){b.pause();b.src=c.nullURL;b.load();b=a._audio=null}}else if(d===8)c.o._unload(a.sID,c.nullURL);else{a.setAutoPlay(false);c.o._unload(a.sID)}j()}return a};this.destruct=function(){if(a.isHTML5){e();if(b){b.pause();b.src="about:blank";b.load();b=a._audio=null}}else{a._iO.onfailure=null;c.o._destroySound(a.sID)}c.destroySound(a.sID,true)};this.start=this.play=function(b){b||(b={});a._iO=g(b,a._iO);a._iO=g(a._iO,a.options);a.instanceOptions=a._iO;if(a._iO.serverURL)if(!a.connected){a.setAutoPlay(true);return a}if(J(a._iO)){a._setup_html5(a._iO);f()}if(a.playState===1)if(b=a._iO.multiShot)a.isHTML5&&a.setPosition(a._iO.position);else return a;if(!a.loaded)if(a.readyState===0){if(a.isHTML5)a.readyState=1;else if(!a._iO.serverURL){a._iO.autoPlay=true;a.load(a._iO)}}else if(a.readyState===2)return a;if(a.paused)a.resume();else{a.playState=1;if(!a.instanceCount||d>8&&!a.isHTML5)a.instanceCount++;a.position=typeof a._iO.position!=="undefined"&&!isNaN(a._iO.position)?a._iO.position:0;a._iO=H(a._iO);a._iO.onplay&&a._iO.onplay.apply(a);a.setVolume(a._iO.volume,true);a.setPan(a._iO.pan,true);if(a.isHTML5){f();a._setup_html5().play()}else{d===9&&a._iO.serverURL&&a.setAutoPlay(true);c.o._start(a.sID,a._iO.loops||1,d===9?a.position:a.position/1e3)}}return a};this.stop=function(d){if(a.playState===1){a._onbufferchange(0);a.resetOnPosition(0);if(!a.isHTML5)a.playState=0;a.paused=false;a._iO.onstop&&a._iO.onstop.apply(a);if(a.isHTML5){if(b){a.setPosition(0);b.pause();a.playState=0;a._onTimer();e();a.unload()}}else{c.o._stop(a.sID,d);a._iO.serverURL&&a.unload()}a.instanceCount=0;a._iO={}}return a};this.setAutoPlay=function(b){a._iO.autoPlay=b;c.o._setAutoPlay(a.sID,b);if(b)a.instanceCount||a.instanceCount++};this.setPosition=function(e){if(typeof e==="undefined")e=0;e=a.isHTML5?Math.max(e,0):Math.min(a.duration,Math.max(e,0));a._iO.position=e;a.resetOnPosition(a._iO.position);if(a.isHTML5){if(b){if(a.playState)try{b.currentTime=a._iO.position/1e3}catch(f){}if(a.paused){a._onTimer(true);a._iO.useMovieStar&&a.resume()}}}else c.o._setPosition(a.sID,d===9?a._iO.position:a._iO.position/1e3,a.paused||!a.playState);return a};this.pause=function(b){if(a.paused||a.playState===0&&a.readyState!==1)return a;a.paused=true;if(a.isHTML5){a._setup_html5().pause();e()}else(b||b===undefined)&&c.o._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){if(!a.paused||a.playState===0)return a;a.paused=false;a.playState=1;if(a.isHTML5){a._setup_html5().play();f()}else c.o._pause(a.sID);a._iO.onresume&&a._iO.onresume.apply(a);return a};this.togglePause=function(){if(a.playState===0){a.play({position:d===9&&!a.isHTML5?a.position:a.position/1e3});return a}a.paused?a.resume():a.pause();return a};this.setPan=function(b,d){if(typeof b==="undefined")b=0;if(typeof d==="undefined")d=false;a.isHTML5||c.o._setPan(a.sID,b);a._iO.pan=b;if(!d)a.pan=b;return a};this.setVolume=function(d,e){if(typeof d==="undefined")d=100;if(typeof e==="undefined")e=false;if(a.isHTML5){if(b)b.volume=d/100}else c.o._setVolume(a.sID,c.muted&&!a.muted||a.muted?0:d);a._iO.volume=d;if(!e)a.volume=d;return a};this.mute=function(){a.muted=true;if(a.isHTML5){if(b)b.muted=true}else c.o._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=false;var d=typeof a._iO.volume!=="undefined";if(a.isHTML5){if(b)b.muted=false}else c.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(c,d,b){a._onPositionItems.push({position:c,method:d,scope:typeof b!=="undefined"?b:a,fired:false});return a};this.processOnPosition=function(){var b,d;b=a._onPositionItems.length;if(!b||!a.playState||a._onPositionFired>=b)return false;for(b=b;b--;){d=a._onPositionItems[b];if(!d.fired&&a.position>=d.position){d.method.apply(d.scope,[d.position]);d.fired=true;c._onPositionFired++}}};this.resetOnPosition=function(e){var b,d;b=a._onPositionItems.length;if(!b)return false;for(b=b;b--;){d=a._onPositionItems[b];if(d.fired&&e<=d.position){d.fired=false;c._onPositionFired--}}};this._onTimer=function(c){if(a._hasTimer||c)if(b&&(c||(a.playState>0||a.readyState===1)&&!a.paused)){a.duration=h();a.durationEstimate=a.duration;c=b.currentTime?b.currentTime*1e3:0;a._whileplaying(c,{},{},{},{});return true}else return false};h=function(){var a=b?b.duration*1e3:undefined;if(a)return!isNaN(a)?a:null};f=function(){a.isHTML5&&fb(a)};e=function(){a.isHTML5&&gb(a)};j=function(){a._onPositionItems=[];a._onPositionFired=0;a._hasTimer=null;a._added_events=null;b=a._audio=null;a.bytesLoaded=null;a.bytesTotal=null;a.position=null;a.duration=null;a.durationEstimate=null;a.failures=0;a.loaded=false;a.playState=0;a.paused=false;a.readyState=0;a.muted=false;a.didBeforeFinish=false;a.didJustBeforeFinish=false;a.isBuffering=false;a.instanceOptions={};a.instanceCount=0;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.eqData=[];a.eqData.left=[];a.eqData.right=[]};j();this._setup_html5=function(c){c=g(a._iO,c);if(b){if(a.url!==c.url)b.src=c.url}else{a._audio=new Audio(c.url);b=a._audio;a.isHTML5=true;k()}b.loop=c.loops>1?"loop":"";return a._audio};k=function(){function c(a,c,d){return b?b.addEventListener(a,c,d||false):null}if(a._added_events)return false;a._added_events=true;c("load",function(){if(b){a._onbufferchange(0);a._whileloading(a.bytesTotal,a.bytesTotal,h());a._onload(1)}},false);c("canplay",function(){a._onbufferchange(0)},false);c("waiting",function(){a._onbufferchange(1)},false);c("progress",function(c){if(!a.loaded&&b){a._onbufferchange(0);a._whileloading(c.loaded||0,c.total||1,h())}},false);c("end",function(){a._onfinish()},false);c("error",function(){b&&a._onload(0)},false);c("loadstart",function(){a._onbufferchange(1)},false);c("play",function(){a._onbufferchange(0)},false);c("playing",function(){a._onbufferchange(0)},false);c("timeupdate",function(){a._onTimer()},false);setTimeout(function(){a&&b&&c("ended",function(){a._onfinish()},false)},250)};this._whileloading=function(b,c,d,e){a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(d);if(a._iO.isMovieStar){a.durationEstimate=a.duration;a.readyState!==3&&a._iO.whileloading&&a._iO.whileloading.apply(a)}else{a.durationEstimate=parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10);if(a.durationEstimate===undefined)a.durationEstimate=a.duration;a.bufferLength=e;(a._iO.isMovieStar||a.readyState!==3)&&a._iO.whileloading&&a._iO.whileloading.apply(a)}};this._onid3=function(c,f){var d=[],b,e;b=0;for(e=c.length;b<e;b++)d[c[b]]=f[b];a.id3=g(a.id3,d);a._iO.onid3&&a._iO.onid3.apply(a)};this._whileplaying=function(b,e,f,g,c){if(isNaN(b)||b===null)return false;if(a.playState===0&&b>0)b=0;a.position=b;a.processOnPosition();if(d>8&&!a.isHTML5){if(a._iO.usePeakData&&typeof e!=="undefined"&&e)a.peakData={left:e.leftPeak,right:e.rightPeak};if(a._iO.useWaveformData&&typeof f!=="undefined"&&f)a.waveformData={left:f.split(","),right:g.split(",")};if(a._iO.useEQData)if(typeof c!=="undefined"&&c&&c.leftEQ){b=c.leftEQ.split(",");a.eqData=b;a.eqData.left=b;if(typeof c.rightEQ!=="undefined"&&c.rightEQ)a.eqData.right=c.rightEQ.split(",")}}if(a.playState===1){!a.isHTML5&&a.isBuffering&&a._onbufferchange(0);a._iO.whileplaying&&a._iO.whileplaying.apply(a);(a.loaded||!a.loaded&&a._iO.isMovieStar)&&a._iO.onbeforefinish&&a._iO.onbeforefinishtime&&!a.didBeforeFinish&&a.duration-a.position<=a._iO.onbeforefinishtime&&a._onbeforefinish()}};this._onconnect=function(b){b=b===1;if(a.connected=b){a.failures=0;(a._iO.autoLoad||a._iO.autoPlay)&&a.load(a._iO);a._iO.autoPlay&&a.play();a._iO.onconnect&&a._iO.onconnect.apply(a,[b])}};this._onload=function(b){b=b===1?true:false;a.loaded=b;a.readyState=b?3:2;a._iO.onload&&a._iO.onload.apply(a)};this._onfailure=function(b){a.failures++;a._iO.onfailure&&a.failures===1&&a._iO.onfailure(a,b)};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.onjustbeforefinish&&a._iO.onjustbeforefinish.apply(a)}};this._onfinish=function(){a._onbufferchange(0);a.resetOnPosition(0);a._iO.onbeforefinishcomplete&&a._iO.onbeforefinishcomplete.apply(a);a.didBeforeFinish=false;a.didJustBeforeFinish=false;if(a.instanceCount){a.instanceCount--;if(!a.instanceCount){a.playState=0;a.paused=false;a.instanceCount=0;a.instanceOptions={};e()}if(!a.instanceCount||a._iO.multiShotEvents)a._iO.onfinish&&a._iO.onfinish.apply(a);a.isHTML5&&a.unload()}};this._onmetadata=function(b){if(!b.width&&!b.height){b.width=320;b.height=240}a.metadata=b;a.width=b.width;a.height=b.height;a._iO.onmetadata&&a._iO.onmetadata.apply(a)};this._onbufferchange=function(b){if(a.playState===0)return false;if(b&&a.isBuffering||!b&&!a.isBuffering)return false;a.isBuffering=b===1?true:false;a._iO.onbufferchange&&a._iO.onbufferchange.apply(a)};this._ondataerror=function(){a.playState>0&&a._iO.ondataerror&&a._iO.ondataerror.apply(a)}};if(!c.hasHTML5||n)if(a.addEventListener){a.addEventListener("focus",j,false);a.addEventListener("load",c.beginDelayedInit,false);a.addEventListener("unload",c.destruct,false);o&&a.addEventListener("mousemove",j,false)}else if(a.attachEvent){a.attachEvent("onfocus",j);a.attachEvent("onload",c.beginDelayedInit);a.attachEvent("unload",c.destruct)}else{b.onerror();b.disable()}P=function(){if(document.readyState==="complete"){v();document.detachEvent("onreadystatechange",P)}};if(document.addEventListener)document.addEventListener("DOMContentLoaded",v,false);else document.attachEvent&&document.attachEvent("onreadystatechange",P);document.readyState==="complete"&&setTimeout(v,100)}var b=null;if(typeof SM2_DEFER==="undefined"||!SM2_DEFER)b=new c;a.SoundManager=c;a.soundManager=b})(window);(function(a){a.fn.hint=function(b){if(!b)b="blur";return this.each(function(){var c=a(this);title=c.attr("title");$form=a(this.form);$win=a(window);function d(){c.val()===title&&c.hasClass(b)&&c.val("").removeClass(b)}if(title){c.blur(function(){this.value===""&&c.val(title).addClass(b)}).focus(d).blur();$form.submit(d);$win.unload(d)}})}})(jQuery);
/*
 * jQuery blockUI plugin
 * Version 2.35 (23-SEP-2010)
 * @requires jQuery v1.2.3 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2008 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */
(function(a){if(/1\.(0|1|2)\.(0|1|2)/.test(a.fn.jquery)||/^1.1/.test(a.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+a.fn.jquery);return}a.fn._fadeIn=a.fn.fadeIn;var g=function(){},f=document.documentMode||0,n=a.browser.msie&&(a.browser.version<8&&!f||f<8),m=a.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!f;a.blockUI=function(a){i(window,a)};a.unblockUI=function(a){e(window,a)};a.growlUI=function(e,d,b,f){var c=a('<div class="growlUI"></div>');e&&c.append("<h1>"+e+"</h1>");d&&c.append("<h2>"+d+"</h2>");if(b==undefined)b=3e3;a.blockUI({message:c,fadeIn:700,fadeOut:1e3,centerY:false,timeout:b,showOverlay:false,onUnblock:f,css:a.blockUI.defaults.growlCSS})};a.fn.block=function(b){return this.unblock({fadeOut:0}).each(function(){if(a.css(this,"position")=="static")this.style.position="relative";if(a.browser.msie)this.style.zoom=1;i(this,b)})};a.fn.unblock=function(a){return this.each(function(){e(this,a)})};a.blockUI.version=2.35;a.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:true,theme:false,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1e3,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"};var c=null,b=[];function i(p,f){var i=p==window,h=f&&f.message!==undefined?f.message:undefined;f=a.extend({},a.blockUI.defaults,f||{});f.overlayCSS=a.extend({},a.blockUI.defaults.overlayCSS,f.overlayCSS||{});var H=a.extend({},a.blockUI.defaults.css,f.css||{}),B=a.extend({},a.blockUI.defaults.themedCSS,f.themedCSS||{});h=h===undefined?f.message:h;i&&c&&e(window,{fadeOut:0});if(h&&typeof h!="string"&&(h.parentNode||h.jquery)){var t=h.jquery?h[0]:h,q={};a(p).data("blockUI.history",q);q.el=t;q.parent=t.parentNode;q.display=t.style.display;q.position=t.style.position;q.parent&&q.parent.removeChild(t)}var s=f.baseZ,v=a.browser.msie||f.forceIframe?a('<iframe class="blockUI" style="z-index:'+s+++';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+f.iframeSrc+'"></iframe>'):a('<div class="blockUI" style="display:none"></div>'),r=a('<div class="blockUI blockOverlay" style="z-index:'+s+++';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),k,u;if(f.theme&&i)u='<div class="blockUI '+f.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+s+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(f.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>';else if(f.theme)u='<div class="blockUI '+f.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+s+';display:none;position:absolute"><div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(f.title||"&nbsp;")+'</div><div class="ui-widget-content ui-dialog-content"></div></div>';else if(i)u='<div class="blockUI '+f.blockMsgClass+' blockPage" style="z-index:'+s+';display:none;position:fixed"></div>';else u='<div class="blockUI '+f.blockMsgClass+' blockElement" style="z-index:'+s+';display:none;position:absolute"></div>';k=a(u);if(h)if(f.theme){k.css(B);k.addClass("ui-widget-content")}else k.css(H);(!f.applyPlatformOpacityRules||!(a.browser.mozilla&&/Linux/.test(navigator.platform)))&&r.css(f.overlayCSS);r.css("position",i?"fixed":"absolute");(a.browser.msie||f.forceIframe)&&v.css("opacity",0);var C=[v,r,k],D=i?a("body"):a(p);a.each(C,function(){this.appendTo(D)});f.theme&&f.draggable&&a.fn.draggable&&k.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var E=n&&(!a.boxModel||a("object,embed",i?null:p).length>0);if(m||E){i&&f.allowBodyStretch&&a.boxModel&&a("html,body").css("height","100%");if((m||!a.boxModel)&&!i)var A=d(p,"borderTopWidth"),z=d(p,"borderLeftWidth"),x=A?"(0 - "+A+")":0,w=z?"(0 - "+z+")":0;a.each([v,r,k],function(d,e){var a=e[0].style;a.position="absolute";if(d<2){i?a.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+f.quirksmodeOffsetHack+') + "px"'):a.setExpression("height",'this.parentNode.offsetHeight + "px"');i?a.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):a.setExpression("width",'this.parentNode.offsetWidth + "px"');w&&a.setExpression("left",w);x&&a.setExpression("top",x)}else if(f.centerY){i&&a.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');a.marginTop=0}else if(!f.centerY&&i){var c=f.css&&f.css.top?parseInt(f.css.top):0,b="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+c+') + "px"';a.setExpression("top",b)}})}if(h){if(f.theme)k.find(".ui-widget-content").append(h);else k.append(h);(h.jquery||h.nodeType)&&a(h).show()}(a.browser.msie||f.forceIframe)&&f.showOverlay&&v.show();if(f.fadeIn){var y=f.onBlock?f.onBlock:g,F=f.showOverlay&&!h?y:g,G=h?y:g;f.showOverlay&&r._fadeIn(f.fadeIn,F);h&&k._fadeIn(f.fadeIn,G)}else{f.showOverlay&&r.show();h&&k.show();f.onBlock&&f.onBlock()}l(1,p,f);if(i){c=k[0];b=a(":input:enabled:visible",c);f.focusInput&&setTimeout(j,20)}else o(k[0],f.centerX,f.centerY);if(f.timeout){var I=setTimeout(function(){i?a.unblockUI(f):a(p).unblock(f)},f.timeout);a(p).data("blockUI.timeout",I)}}function e(e,d){var i=e==window,g=a(e),h=g.data("blockUI.history"),j=g.data("blockUI.timeout");if(j){clearTimeout(j);g.removeData("blockUI.timeout")}d=a.extend({},a.blockUI.defaults,d||{});l(0,e,d);var f;if(i)f=a("body").children().filter(".blockUI").add("body > .blockUI");else f=a(".blockUI",e);if(i)c=b=null;if(d.fadeOut){f.fadeOut(d.fadeOut);setTimeout(function(){k(f,h,d,e)},d.fadeOut)}else k(f,h,d,e)}function k(e,b,c,d){e.each(function(){this.parentNode&&this.parentNode.removeChild(this)});if(b&&b.el){b.el.style.display=b.display;b.el.style.position=b.position;b.parent&&b.parent.appendChild(b.el);a(d).removeData("blockUI.history")}if(typeof c.onUnblock=="function")c.onUnblock(d,c)}function l(b,i,e){var d=i==window,g=a(i);if(!b&&(d&&!c||!d&&!g.data("blockUI.isBlocked")))return;!d&&g.data("blockUI.isBlocked",b);if(!e.bindEvents||b&&!e.showOverlay)return;var f="mousedown mouseup keydown keypress";b?a(document).bind(f,e,h):a(document).unbind(f,h)}function h(d){if(d.keyCode&&d.keyCode==9)if(c&&d.data.constrainTabKey){var e=b,h=!d.shiftKey&&d.target==e[e.length-1],f=d.shiftKey&&d.target==e[0];if(h||f){setTimeout(function(){j(f)},10);return false}}var g=d.data;return a(d.target).parents("div."+g.blockMsgClass).length>0?true:a(d.target).parents().children().filter("div.blockUI").length==0}function j(c){if(!b)return;var a=b[c===true?b.length-1:0];a&&a.focus()}function o(a,g,h){var b=a.parentNode,e=a.style,c=(b.offsetWidth-a.offsetWidth)/2-d(b,"borderLeftWidth"),f=(b.offsetHeight-a.offsetHeight)/2-d(b,"borderTopWidth");if(g)e.left=c>0?c+"px":"0";if(h)e.top=f>0?f+"px":"0"}function d(b,c){return parseInt(a.css(b,c))||0}})(jQuery);function setCookie(c,d,b){var a=new Date;a.setDate(a.getDate()+b);document.cookie=c+"="+escape(d)+(b==null?"":";expires="+a.toUTCString())}function getCookie(a){if(document.cookie.length>0){c_start=document.cookie.indexOf(a+"=");if(c_start!=-1){c_start=c_start+a.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end))}}return""}$(document).ready(function(){$(".navi-toggle > a").click(function(){if($(this).parent().hasClass("selected")){$(this).parent().removeClass("selected");soundManager.play("01-menu-toggle")}else{$(this).parent().addClass("selected");soundManager.play("01-menu-toggle")}return false});$(".complete-payment-button").click(function(){Page_ClientValidate()&&$.blockUI({message:'<div id="please-wait"><img src="/img/loader.gif" /> Please wait ...</div>'});return true});$(".wishlist-overlay").colorbox({iframe:"true",height:"400px",opacity:"0.4",width:"300px"});$(".share-friend-overlay").colorbox({iframe:"true",height:"400px",opacity:"0.4",width:"300px"});$(".login-overlay").colorbox({iframe:"true",height:"380px",opacity:"0.4",width:"230px"});$(".ring-guide-overlay").colorbox({iframe:"true",height:"720px",opacity:"0.4",width:"590px"});$(".toc-overlay, .overlay a, a .overlay").colorbox({iframe:"true",height:"420px",opacity:"0.4",width:"590px"});$("#product-item-scroller .items a").colorbox({height:"820px",opacity:"0.4",width:"945px",photo:true});$("#product-item-scroller .scrollable").scrollable({onSeek:function(b,a){$(".current-item").text(a+1)}});$("#products-scroller .scrollable, #gallery .scrollable").scrollable();if($("#products-scroller .items img.active").length>0){var b=$("#products-scroller .scrollable").data("scrollable"),a=$("#products-scroller .items img.active").parent("a").attr("class");a=Number(a.replace("panel-",""));b.seekTo(a)}$("#product-item-scroller .items a").each(function(b){var a=b+1;$(this).addClass("item-"+a)});$("#products-scroller .items img").click(function(){$("#products-scroller .items img").removeClass("active");$(this).addClass("active")});$("#gallery .items a").click(function(){if($(this).find("img").hasClass("active"))return false;var c=$(this).attr("href"),d=$(this).find("img").attr("title"),a=$("#image_wrap").fadeTo("medium",.5),b=new Image;b.onload=function(){a.fadeTo("fast",1);a.find("img").attr("src",c);a.find("span").text(d)};b.src=c;$(".items img").removeClass("active");$(this).find("img").addClass("active");return false}).filter(":first").click();$("#product-grid .item a").hover(function(){var b=$(this).find("strong").text(),a=$(this).find("span").text();$("#price-info h6").text(b);$("#price-info span").text(a);$("#price-info").fadeIn()},function(){$("#price-info").fadeOut()});$("#product-info a.expand").click(function(){$("#product-info .extra-info").css({display:"inline-block"});$(this).hide();return false});$("#product-info a.collapse").click(function(){$("#product-info .extra-info").hide();$(this).hide();$("#product-info a.expand").show();return false});$("h6.collapseHeader").click(function(){var a=$(this).next();$(a).slideToggle("slow")})});function log(a){window.console&&console.log(a)}$(document).ready(function(){$("#searchQuery").hint().keydown(function(a){if(a.keyCode==13){$("#searchBtn").click();return false}});$("#searchBtn").click(function(){var a=$("#searchQuery").val();if(a!="")location.href="/collection?term="+a;return false});$(".search-refine input:first").hint().keydown(function(a){if(a.keyCode==13){$(".search-refine input:last").click();return false}});$(".search-refine input:last").click(function(){var a=$(".search-refine input:first").val();if(a!="")location.href="/collection?term="+a;return false})});var originalWidth="2092",originalHeight="1671";$(function(){updateImageSize();$(window).resize(function(){updateImageSize()})});function ss(a,c){var b,d;b=a>window.document.body.clientWidth?window.document.body.clientWidth:a;d=b==a?c:Math.floor(window.document.body.clientWidth/(a/c));return{w:b,h:d}}function updateImageSize(){var a=ss(originalWidth,originalHeight);$("img.bg").css({width:a.w,height:a.h})}function updateBg(a){$(document).ready(function(){!a&&$("#wrapper").show()});$(window).load(function(){if(a){$("img.old").fadeTo("slow",0);$("img.new").fadeTo("slow",.5);$("#wrapper").delay(3e3).fadeIn("slow")}})}$(document).ready(function(){soundManager.url="/swf/soundmanager2.swf";soundManager.useFlashBlock=false;soundManager.onload=function(){soundManager.createSound("01-menu-toggle","/media/mp3/01-menu-toggle.mp3");soundManager.createSound("02-normal-menu-click","/media/mp3/02-normal-menu-click.mp3");soundManager.createSound("03-zoom","/media/mp3/03-zoom.mp3");soundManager.createSound("04-gallery-scroll","/media/mp3/04-gallery-scroll.mp3");soundManager.createSound("05-thumbnail","/media/mp3/05-thumbnail.mp3");soundManager.createSound("06-basket","/media/mp3/06-basket.mp3");soundManager.createSound("07-wishlist","/media/mp3/07-wishlist.mp3");soundManager.createSound("08-share-friend","/media/mp3/08-share-friend.mp3");soundManager.createSound("09-login-logout","/media/mp3/09-login-logout.mp3");soundManager.createSound("10-expand-gallery-dropdown","/media/mp3/10-expand-gallery-dropdown.mp3");$("#navi ul li:not(.navi-toggle) a").click(function(){soundManager.play("02-normal-menu-click")});$("a[rel=product-gallery]").click(function(){soundManager.play("03-zoom")});$("a.prev, a.next, #product-list-type a").click(function(){soundManager.play("04-gallery-scroll")});$("#product-grid .item, #products-scroller .items a").click(function(){soundManager.play("05-thumbnail")});$("a.addBasket, a.viewBasket").click(function(){soundManager.play("06-basket")});$("a.addToWishlist, a.viewWishlist").click(function(){soundManager.play("07-wishlist")});$("a.share-friend-overlay").click(function(){soundManager.play("08-share-friend")});$("a.login-overlay, a.logout").click(function(){soundManager.play("09-login-logout")});$("#product-info a.expand, select").click(function(){soundManager.play("10-expand-gallery-dropdown")});$("#currency-selector li:first > a, #product-filters > ul > li > a").mouseover(function(){soundManager.play("10-expand-gallery-dropdown")});var a=getCookie("soundToggle");if(a=="mute"){$("a.sound").removeClass("soundOn").addClass("soundOff");soundManager.mute()}else if(a=="unmute"){$("a.sound").removeClass("soundOff").addClass("soundOn");soundManager.unmute()}$("a.soundOn").click(function(){$(this).removeClass("soundOn").addClass("soundOff");soundManager.mute();setCookie("soundToggle","mute","1")});$("a.soundOff").click(function(){$(this).removeClass("soundOff").addClass("soundOn");soundManager.unmute();setCookie("soundToggle","unmute","1")})}})
